|
|
@@ -3,10 +3,10 @@
|
|
|
<!-- 查询和其他操作 -->
|
|
|
<div class="filter-container">
|
|
|
<el-date-picker v-model="listQuery.startDate" value-format="yyyy-MM-dd" type="date" placeholder="开始日期"
|
|
|
- class="filter-item" style="width:200px">
|
|
|
+ class="filter-item" style="width:200px">
|
|
|
</el-date-picker>
|
|
|
<el-date-picker v-model="listQuery.endDate" value-format="yyyy-MM-dd" type="date" placeholder="结束日期"
|
|
|
- class="filter-item" style="width:200px">
|
|
|
+ class="filter-item" style="width:200px">
|
|
|
</el-date-picker>
|
|
|
<el-select v-model="listQuery.warehouseId" clearable placeholder="请选择仓库" class="filter-item" style="width: 200px">
|
|
|
<el-option :key="item.id" v-for="item in warehouseList" :label="item.warehouseName" :value="item.id">
|
|
|
@@ -19,8 +19,7 @@
|
|
|
<el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">查找</el-button>
|
|
|
<el-button class="filter-item" v-waves icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
|
|
<el-button class="filter-item" type="primary" @click="handleCreate" icon="el-icon-plus">添加</el-button>
|
|
|
- <el-button class="filter-item" v-waves icon="el-icon-download"
|
|
|
- @click="handleDownload">导出</el-button>
|
|
|
+ <el-button class="filter-item" v-waves icon="el-icon-download" @click="handleDownload">导出</el-button>
|
|
|
<!-- <el-button class="filter-item" type="success" icon="el-icon-takeaway-box" @click="executeAll">批量入库</el-button> -->
|
|
|
<el-button class="filter-item" type="warning" icon="el-icon-delete" @click="delAll">批量删除</el-button>
|
|
|
</div>
|
|
|
@@ -48,15 +47,21 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" min-width="100px" label="入库状态">
|
|
|
<template slot-scope="props">
|
|
|
- <span v-if="props.row.isRunFinish == '0'" style="color: #67C23A;font-weight: bold;">已入库</span>
|
|
|
- <span v-if="props.row.isRunFinish == '1'" style="color: #E6A23C;font-weight: bold;">待入库</span>
|
|
|
- </template>
|
|
|
+ <span v-if="props.row.isRunFinish == '0'" style="color: #67C23A;font-weight: bold;">已入库</span>
|
|
|
+ <span v-if="props.row.isRunFinish == '1'" style="color: #E6A23C;font-weight: bold;">待入库</span>
|
|
|
+ <span v-if="props.row.isRunFinish == '2'" style="color: #E6A23C;font-weight: bold;">已作废</span>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" label="操作" width="240px" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button v-if="scope.row.isRunFinish == '1'" type="success" size="small" @click="handleExecute(scope.row)">入库</el-button>
|
|
|
- <el-button v-if="scope.row.isRunFinish == '1'" type="primary" size="small" @click="handleUpdate(scope.row)">编辑</el-button>
|
|
|
- <el-button v-if="scope.row.isRunFinish == '1'" type="danger" size="small" @click="handleDelete(scope.row)">删除</el-button>
|
|
|
+ <el-button v-if="scope.row.isRunFinish == '1'" type="success" size="small"
|
|
|
+ @click="handleExecute(scope.row)">入库</el-button>
|
|
|
+ <el-button v-if="scope.row.isRunFinish == '1'" type="primary" size="small"
|
|
|
+ @click="handleUpdate(scope.row)">编辑</el-button>
|
|
|
+ <el-button v-if="scope.row.isRunFinish != '0'" type="danger" size="small"
|
|
|
+ @click="handleDelete(scope.row)">删除</el-button>
|
|
|
+ <el-button v-if="scope.row.isRunFinish == '0'" type="warning" size="small"
|
|
|
+ @click="handleCancelShow(scope.row.id)">作废</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -68,10 +73,22 @@
|
|
|
layout="total, sizes, prev, pager, next, jumper" :total="total">
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
+ <!-- 作废原因对话框 -->
|
|
|
+ <el-dialog :close-on-click-modal="false" title="单据作废" :visible.sync="dialogFormVisible" width="40%">
|
|
|
+ <el-form :rules="rules" ref="dataForm" :model="dataForm" status-icon label-position="left" label-width="80px">
|
|
|
+ <el-form-item label="作废原因" prop="cancelMsg">
|
|
|
+ <el-input type="textarea" :rows="2" placeholder="请输入作废原因" v-model="dataForm.cancelMsg"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogFormVisible = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="handleCancel()">确定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { listWarehousing, deleteWarehousing, executeWarehousing } from "@/api/warehousing";
|
|
|
+import { listWarehousing, deleteWarehousing, executeWarehousing,cancelWarehousing } from "@/api/warehousing";
|
|
|
import { warehouseList } from "@/api/warehouse";
|
|
|
import waves from "@/directive/waves"; // 水波纹指令
|
|
|
|
|
|
@@ -79,6 +96,14 @@ export default {
|
|
|
directives: { waves },
|
|
|
data() {
|
|
|
return {
|
|
|
+ cancelId: '',
|
|
|
+ dialogFormVisible: false,
|
|
|
+ dataForm: {
|
|
|
+ cancelMsg: ''
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ cancelMsg: [{ required: true, message: "作废原因不能为空", trigger: "blur" }],
|
|
|
+ },
|
|
|
warehouseList: [],
|
|
|
typeList: [
|
|
|
{
|
|
|
@@ -89,6 +114,10 @@ export default {
|
|
|
type: '1',
|
|
|
name: "待入库",
|
|
|
},
|
|
|
+ {
|
|
|
+ type: '2',
|
|
|
+ name: "已作废",
|
|
|
+ },
|
|
|
],
|
|
|
list: [
|
|
|
|
|
|
@@ -112,6 +141,31 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleCancelShow(id) {
|
|
|
+ this.dialogFormVisible = true;
|
|
|
+ this.cancelId = id;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.dataForm.cancelMsg = '';
|
|
|
+ this.$refs["dataForm"].clearValidate();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleCancel() {
|
|
|
+ this.$refs["dataForm"].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ cancelWarehousing({ id: this.cancelId, cancelMsg: this.dataForm.cancelMsg }).then(() => {
|
|
|
+ this.dialogFormVisible = false;
|
|
|
+ this.$notify({
|
|
|
+ title: "成功",
|
|
|
+ message: "操作成功",
|
|
|
+ type: "success",
|
|
|
+ duration: 2000,
|
|
|
+ });
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
/** 获取仓库列表数据 */
|
|
|
getStoreList() {
|
|
|
warehouseList().then(response => {
|