浏览代码

仓库管理修改调整

sunlupeng 6 月之前
父节点
当前提交
b0a9f1a908

+ 8 - 0
src/api/assembly.js

@@ -47,3 +47,11 @@ export function deleteAssembly(query) {
     params:query
   })
 }
+
+export function cancelAssembly(query) {
+  return request({
+    url: '/warehouse-assembly/cancel',
+    method: 'post',
+    params:query
+  })
+}

+ 8 - 0
src/api/breakage.js

@@ -47,3 +47,11 @@ export function deleteBreakage(query) {
     params:query
   })
 }
+
+export function cancelBreakage(query) {
+  return request({
+    url: '/warehouse-breakage/cancel',
+    method: 'post',
+    params:query
+  })
+}

+ 8 - 0
src/api/disassembly.js

@@ -47,3 +47,11 @@ export function deleteDisassembly(query) {
     params:query
   })
 }
+
+export function cancelDisassembly(query) {
+  return request({
+    url: '/warehouse-disassembly/cancel',
+    method: 'post',
+    params:query
+  })
+}

+ 8 - 0
src/api/requisition.js

@@ -47,3 +47,11 @@ export function deleteRequisition(query) {
     params:query
   })
 }
+
+export function cancelRequisition(query) {
+  return request({
+    url: '/warehouse-requisition/cancel',
+    method: 'post',
+    params:query
+  })
+}

+ 9 - 0
src/api/retrieval.js

@@ -47,3 +47,12 @@ export function deleteRetrieval(query) {
     params:query
   })
 }
+
+export function cancelRetrieval(query) {
+  return request({
+    url: '/warehouse-out/cancel',
+    method: 'post',
+    params:query
+  })
+}
+

+ 8 - 0
src/api/swap.js

@@ -47,3 +47,11 @@ export function deleteSwap(query) {
     params:query
   })
 }
+
+export function cancelSwap(query) {
+  return request({
+    url: '/warehouse-swap/cancel',
+    method: 'post',
+    params:query
+  })
+}

+ 8 - 0
src/api/warehousing.js

@@ -47,3 +47,11 @@ export function deleteWarehousing(query) {
     params:query
   })
 }
+
+export function cancelWarehousing(query) {
+  return request({
+    url: '/warehouse-entry/cancel',
+    method: 'post',
+    params:query
+  })
+}

+ 55 - 2
src/views/stock/assembly/assembly.vue

@@ -58,13 +58,17 @@
         <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>
+            <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 != '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>
@@ -76,10 +80,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 { listAssembly, deleteAssembly, executeAssembly } from "@/api/assembly";
+import { listAssembly, deleteAssembly, executeAssembly, cancelAssembly } from "@/api/assembly";
 import { warehouseList } from "@/api/warehouse";
 import { allUserList } from "@/api/public";
 import waves from "@/directive/waves"; // 水波纹指令
@@ -88,6 +104,14 @@ export default {
   directives: { waves },
   data() {
     return {
+      cancelId: '',
+      dialogFormVisible: false,
+      dataForm: {
+        cancelMsg: ''
+      },
+      rules: {
+        cancelMsg: [{ required: true, message: "作废原因不能为空", trigger: "blur" }],
+      },
       warehouseList: [],
       userSelsctList:[],
       typeList: [
@@ -99,6 +123,10 @@ export default {
           type: '1',
           name: "待组装",
         },
+         {
+          type: '2',
+          name: "已作废",
+        },
       ],
       list: [
 
@@ -125,6 +153,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) {
+          cancelAssembly({ 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 => {

+ 3 - 0
src/views/stock/assembly/assemblyAdd.vue

@@ -40,6 +40,9 @@
                     :disabled="type === 'detail'" :autosize="{ minRows: 1, maxRows: 4 }"
                     placeholder="请输入组装原因 最大120字"></el-input>
             </el-form-item>
+            <el-form-item label="作废原因" v-if="dataForm.cancelMsg">
+                <el-input style="width:535px" v-model="dataForm.cancelMsg" type="textarea" disabled :autosize="{ minRows: 1, maxRows: 4 }"></el-input>
+            </el-form-item>
             <div class="mx">
                 <h3>子商品清单</h3>
                 <el-button size="small" type="primary" v-if="type !== 'detail'" @click="handleSelectGoods('inventoryOutInfos')"

+ 55 - 2
src/views/stock/breakage/breakage.vue

@@ -52,6 +52,7 @@
         <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>
+            <span v-if="props.row.isRunFinish == '2'" style="color: #E6A23C;font-weight: bold;">已作废</span>
           </template>
       </el-table-column>
       <el-table-column align="center" min-width="200px" label="报损原因" prop="remarks">
@@ -60,7 +61,10 @@
         <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 != '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>
@@ -72,10 +76,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 { listBreakage, deleteBreakage, executeBreakage } from "@/api/breakage";
+import { listBreakage, deleteBreakage, executeBreakage, cancelBreakage } from "@/api/breakage";
 import { warehouseList } from "@/api/warehouse";
 import { allUserList } from "@/api/public";
 import waves from "@/directive/waves"; // 水波纹指令
@@ -84,6 +100,14 @@ export default {
   directives: { waves },
   data() {
     return {
+       cancelId: '',
+      dialogFormVisible: false,
+      dataForm: {
+        cancelMsg: ''
+      },
+      rules: {
+        cancelMsg: [{ required: true, message: "作废原因不能为空", trigger: "blur" }],
+      },
       typeList: [
         {
           type: '0',
@@ -93,6 +117,10 @@ export default {
           type: '1',
           name: "待报损",
         },
+         {
+          type: '2',
+          name: "已作废",
+        },
       ],
       warehouseList: [],
       userSelsctList:[],
@@ -120,6 +148,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) {
+          cancelBreakage({ 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 => {

+ 3 - 0
src/views/stock/breakage/breakageAdd.vue

@@ -31,6 +31,9 @@
                     type="textarea" :disabled="type === 'detail'" :autosize="{ minRows: 1, maxRows: 4 }"
                     placeholder="请输入报损原因 最大120字"></el-input>
             </el-form-item>
+            <el-form-item label="作废原因" v-if="dataForm.cancelMsg">
+                <el-input style="width:535px" v-model="dataForm.cancelMsg" type="textarea" disabled :autosize="{ minRows: 1, maxRows: 4 }"></el-input>
+            </el-form-item>
             <div class="mx">
         <h3>报损明细</h3>
         <el-button size="small" type="primary" v-if="type !== 'detail'"

+ 55 - 2
src/views/stock/disassembly/disassembly.vue

@@ -58,13 +58,17 @@
         <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>
+            <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 != '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>
@@ -76,10 +80,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 { listDisassembly, deleteDisassembly, executeDisassembly } from "@/api/disassembly";
+import { listDisassembly, deleteDisassembly, executeDisassembly, cancelDisassembly } from "@/api/disassembly";
 import { warehouseList } from "@/api/warehouse";
 import { allUserList } from "@/api/public";
 import waves from "@/directive/waves"; // 水波纹指令
@@ -88,6 +104,14 @@ export default {
   directives: { waves },
   data() {
     return {
+      cancelId: '',
+      dialogFormVisible: false,
+      dataForm: {
+        cancelMsg: ''
+      },
+      rules: {
+        cancelMsg: [{ required: true, message: "作废原因不能为空", trigger: "blur" }],
+      },
       warehouseList: [],
       userSelsctList:[],
       typeList: [
@@ -99,6 +123,10 @@ export default {
           type: '1',
           name: "待拆卸",
         },
+        {
+          type: '2',
+          name: "已作废",
+        },
       ],
       list: [
 
@@ -125,6 +153,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) {
+          cancelDisassembly({ 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 => {

+ 3 - 0
src/views/stock/disassembly/disassemblyAdd.vue

@@ -40,6 +40,9 @@
                     :disabled="type === 'detail'" :autosize="{ minRows: 1, maxRows: 4 }"
                     placeholder="请输入拆卸原因 最大120字"></el-input>
             </el-form-item>
+            <el-form-item label="作废原因" v-if="dataForm.cancelMsg">
+                <el-input style="width:535px" v-model="dataForm.cancelMsg" type="textarea" disabled :autosize="{ minRows: 1, maxRows: 4 }"></el-input>
+            </el-form-item>
             <div class="mx">
                 <h3>子商品清单</h3>
                 <el-button size="small" type="primary" v-if="type !== 'detail'" @click="handleSelectGoods('inventoryEntryInfos')"

+ 55 - 2
src/views/stock/requisition/requisition.vue

@@ -64,13 +64,17 @@
         <template slot-scope="props">
             <span v-if="props.row.isDelivery == '0'" style="color: #67C23A;font-weight: bold;">已发货</span>
             <span v-if="props.row.isDelivery == '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.isDelivery == '1'" type="success" size="small" @click="handleExecute(scope.row)">发货</el-button>
           <el-button v-if="scope.row.isDelivery == '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 != '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>
@@ -82,10 +86,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 { listRequisition, deleteRequisition, executeRequisition } from "@/api/requisition";
+import { listRequisition, deleteRequisition, executeRequisition, cancelRequisition } from "@/api/requisition";
 import { warehouseList } from "@/api/warehouse";
 import { allUserList } from "@/api/public";
 import waves from "@/directive/waves"; // 水波纹指令
@@ -94,6 +110,14 @@ export default {
   directives: { waves },
   data() {
     return {
+       cancelId: '',
+      dialogFormVisible: false,
+      dataForm: {
+        cancelMsg: ''
+      },
+      rules: {
+        cancelMsg: [{ required: true, message: "作废原因不能为空", trigger: "blur" }],
+      },
       warehouseList: [],
       userSelsctList:[],
       typeList: [
@@ -105,6 +129,10 @@ export default {
           type: '1',
           name: "待发货",
         },
+         {
+          type: '2',
+          name: "已作废",
+        },
       ],
       list: [
 
@@ -132,6 +160,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) {
+          cancelRequisition({ 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 => {

+ 4 - 2
src/views/stock/requisition/requisitionAdd.vue

@@ -37,12 +37,14 @@
                     placeholder="请输入备注 最大120字"></el-input>
             </el-form-item>
             <el-form-item label="附件" prop="fileIds">
-                <el-upload :limit="1" :action="fileUrl" :file-list="dataForm.fileList" :on-success="handleFileSuccess"
+                <el-upload style="width: 200px" :limit="1" :action="fileUrl" :file-list="dataForm.fileList" :on-success="handleFileSuccess"
                     :before-upload="beforeUploadFile" :on-remove="handleRemove">
                     <el-button size="small" type="primary" :disabled="type === 'detail'">点击上传</el-button>
                 </el-upload>
             </el-form-item>
-            
+            <el-form-item label="作废原因" v-if="dataForm.cancelMsg">
+                <el-input style="width:535px" v-model="dataForm.cancelMsg" type="textarea" disabled :autosize="{ minRows: 1, maxRows: 4 }"></el-input>
+            </el-form-item>
             <div class="mx">
         <h3>调拨明细</h3>
         <el-button size="small" type="primary" v-if="type !== 'detail'"

+ 55 - 2
src/views/stock/retrieval/retrieval.vue

@@ -57,13 +57,17 @@
         <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>
+            <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 != '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>
@@ -75,10 +79,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 { listRetrieval, deleteRetrieval, executeRetrieval } from "@/api/retrieval";
+import { listRetrieval, deleteRetrieval, executeRetrieval,cancelRetrieval } from "@/api/retrieval";
 import { storeList } from "@/api/store";
 import { warehouseList } from "@/api/warehouse";
 import { listDept } from "@/api/dept";
@@ -91,6 +107,14 @@ export default {
   directives: { waves },
   data() {
     return {
+      cancelId: '',
+      dialogFormVisible: false,
+      dataForm: {
+        cancelMsg: ''
+      },
+      rules: {
+        cancelMsg: [{ required: true, message: "作废原因不能为空", trigger: "blur" }],
+      },
       // 树选项
       deptOptions: [],
       storeList: [],
@@ -104,6 +128,10 @@ export default {
           type: '1',
           name: "待发货",
         },
+         {
+          type: '2',
+          name: "已作废",
+        },
       ],
       list: [
 
@@ -131,6 +159,31 @@ export default {
     this.getListDept();
   },
   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) {
+          cancelRetrieval({ id: this.cancelId, cancelMsg: this.dataForm.cancelMsg }).then(() => {
+            this.dialogFormVisible = false;
+            this.$notify({
+              title: "成功",
+              message: "操作成功",
+              type: "success",
+              duration: 2000,
+            });
+            this.getList();
+          });
+        }
+      })
+
+    },
     getListDept() {
             listDept().then(response => {
                 this.deptOptions = this.handleTree(response.data.data, "deptId");

+ 3 - 0
src/views/stock/retrieval/retrievalAdd.vue

@@ -28,6 +28,9 @@
                     type="textarea" :disabled="type === 'detail'" :autosize="{ minRows: 1, maxRows: 4 }"
                     placeholder="请输入备注 最大120字"></el-input>
             </el-form-item>
+            <el-form-item label="作废原因" v-if="dataForm.cancelMsg">
+                <el-input style="width:535px" v-model="dataForm.cancelMsg" type="textarea" disabled :autosize="{ minRows: 1, maxRows: 4 }"></el-input>
+            </el-form-item>
             <div class="mx">
         <h3>出库明细</h3>
         <el-button size="small" type="primary" v-if="type !== 'detail'"

+ 55 - 2
src/views/stock/swap/swap.vue

@@ -54,13 +54,17 @@
         <template slot-scope="props">
             <span v-if="props.row.isDelivery == '0'" style="color: #67C23A;font-weight: bold;">已发货</span>
             <span v-if="props.row.isDelivery == '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.isDelivery == '1'" type="success" size="small" @click="handleExecute(scope.row)">发货</el-button>
           <el-button v-if="scope.row.isDelivery == '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 != '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>
@@ -72,10 +76,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 { listSwap, deleteSwap, executeSwap } from "@/api/swap";
+import { listSwap, deleteSwap, executeSwap, cancelSwap } from "@/api/swap";
 import { warehouseList } from "@/api/warehouse";
 import { allUserList } from "@/api/public";
 import waves from "@/directive/waves"; // 水波纹指令
@@ -84,6 +100,14 @@ export default {
   directives: { waves },
   data() {
     return {
+       cancelId: '',
+      dialogFormVisible: false,
+      dataForm: {
+        cancelMsg: ''
+      },
+      rules: {
+        cancelMsg: [{ required: true, message: "作废原因不能为空", trigger: "blur" }],
+      },
       warehouseList: [],
       userSelsctList:[],
       typeList: [
@@ -95,6 +119,10 @@ export default {
           type: '1',
           name: "待发货",
         },
+        {
+          type: '2',
+          name: "已作废",
+        },
       ],
       list: [
 
@@ -120,6 +148,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) {
+          cancelSwap({ 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 => {

+ 3 - 0
src/views/stock/swap/swapAdd.vue

@@ -32,6 +32,9 @@
                     :disabled="type === 'detail'" :autosize="{ minRows: 1, maxRows: 4 }"
                     placeholder="请输入换货原因 最大120字"></el-input>
             </el-form-item>
+            <el-form-item label="作废原因" v-if="dataForm.cancelMsg">
+                <el-input style="width:535px" v-model="dataForm.cancelMsg" type="textarea" disabled :autosize="{ minRows: 1, maxRows: 4 }"></el-input>
+            </el-form-item>
             <div class="mx">
                 <h3>退回明细</h3>
                 <el-button size="small" type="primary" v-if="type !== 'detail'" @click="handleSelectGoods('inventoryEntryInfos')"

+ 65 - 11
src/views/stock/warehousing/warehousing.vue

@@ -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 => {

+ 3 - 0
src/views/stock/warehousing/warehousingAdd.vue

@@ -42,6 +42,9 @@
                     <el-button size="small" type="primary" :disabled="type === 'detail'">点击上传</el-button>
                 </el-upload>
             </el-form-item>
+            <el-form-item label="作废原因" v-if="dataForm.cancelMsg">
+                <el-input style="width:535px" v-model="dataForm.cancelMsg" type="textarea" disabled :autosize="{ minRows: 1, maxRows: 4 }"></el-input>
+            </el-form-item>
             <div class="mx">
         <h3>入库明细</h3>
         <el-button size="small" type="primary" v-if="type !== 'detail'"