1.添加单据编辑功能页面
							parent
							
								
									fdefbad953
								
							
						
					
					
						commit
						9993061db5
					
				| @ -0,0 +1,323 @@ | |||||||
|  | <template> | ||||||
|  |     <div> | ||||||
|  |         <el-form :inline="true" :model="query" class="query-form" size="mini"> | ||||||
|  |             <el-form-item class="query-form-item"> | ||||||
|  |                 <el-input v-model="query.code" placeholder="条码查询"></el-input> | ||||||
|  |             </el-form-item> | ||||||
|  | 
 | ||||||
|  |             <el-form-item> | ||||||
|  |                 <el-button-group> | ||||||
|  |                     <el-button type="primary" icon="search" @click="getCodeList" | ||||||
|  |                     >查询 | ||||||
|  |                     </el-button | ||||||
|  |                     > | ||||||
|  |                 </el-button-group> | ||||||
|  |             </el-form-item> | ||||||
|  |         </el-form> | ||||||
|  |         <el-table v-loading="loading" :data="codeArry" style="width: 100%"> | ||||||
|  |             <el-table-column label="序号" type="index"></el-table-column> | ||||||
|  |             <el-table-column | ||||||
|  |                 label="条码" | ||||||
|  |                 prop="code" | ||||||
|  |                 show-overflow-tooltip | ||||||
|  |             ></el-table-column> | ||||||
|  |             <el-table-column | ||||||
|  |                 label="扫码数量" | ||||||
|  |                 prop="count" | ||||||
|  |                 width="180" | ||||||
|  |                 show-overflow-tooltip | ||||||
|  |             ></el-table-column> | ||||||
|  |             <el-table-column label="创建时间" prop="actDate" width="220" show-overflow-tooltip> | ||||||
|  |                 <template slot-scope="scope"> | ||||||
|  |                     <i class="el-icon-time"></i> | ||||||
|  |                     <span>{{ scope.row.actDate }}</span> | ||||||
|  |                 </template> | ||||||
|  |             </el-table-column> | ||||||
|  |             <el-table-column label="操作员" prop="actor" width="180"></el-table-column> | ||||||
|  |             <el-table-column label="操作" fixed="right" width="180"> | ||||||
|  |                 <template slot-scope="scope"> | ||||||
|  |                     <el-button | ||||||
|  |                         size="small" | ||||||
|  |                         type="text" | ||||||
|  |                         @click.native.stop="replaceCodes(scope.row)" | ||||||
|  |                     > | ||||||
|  |                         删除 | ||||||
|  |                     </el-button> | ||||||
|  |                 </template> | ||||||
|  |             </el-table-column> | ||||||
|  |         </el-table> | ||||||
|  | 
 | ||||||
|  |         <el-pagination | ||||||
|  |             :page-size="query.limit" | ||||||
|  |             @current-change="handleCurrentChange" | ||||||
|  |             layout="prev, pager, next,total" | ||||||
|  |             :total="total" | ||||||
|  |         > | ||||||
|  |         </el-pagination> | ||||||
|  | 
 | ||||||
|  |         <el-dialog | ||||||
|  |             title="码替换" | ||||||
|  |             :visible.sync="replaceVisible" | ||||||
|  |             :append-to-body="true" | ||||||
|  |             width="70%" | ||||||
|  |         > | ||||||
|  |             <el-row :gutter="20" class="el-row" type="flex"> | ||||||
|  |                 <el-col :span="10" class="el-col"> | ||||||
|  |                     <div class="text item"> | ||||||
|  |                         <div class="itemTag"> | ||||||
|  |                             <span>条码: </span> | ||||||
|  |                         </div> | ||||||
|  |                         <el-input | ||||||
|  |                             style="width: 400px" | ||||||
|  |                             size="small" | ||||||
|  |                             splaceholder="请输入内容" | ||||||
|  |                             disabled="true" | ||||||
|  |                             v-model="codeDetail.code" | ||||||
|  |                         ></el-input> | ||||||
|  |                     </div> | ||||||
|  |                 </el-col> | ||||||
|  |                 <el-col :span="10" class="el-col"> | ||||||
|  |                     <div class="text item"> | ||||||
|  |                         <div class="itemTag"> | ||||||
|  |                             <span>扫码数量: </span> | ||||||
|  |                         </div> | ||||||
|  |                         <el-input | ||||||
|  |                             style="width: 400px" | ||||||
|  |                             disabled="true" | ||||||
|  |                             size="small" | ||||||
|  |                             splaceholder="请输入内容" | ||||||
|  |                             v-model="codeDetail.count" | ||||||
|  |                         ></el-input> | ||||||
|  |                     </div> | ||||||
|  |                 </el-col> | ||||||
|  |             </el-row> | ||||||
|  | 
 | ||||||
|  |             <el-row :gutter="20" class="el-row" type="flex"> | ||||||
|  |                 <el-col :span="10" class="el-col"> | ||||||
|  |                     <div class="text item"> | ||||||
|  |                         <div class="itemTag"> | ||||||
|  |                             <span>替换条码: </span> | ||||||
|  |                         </div> | ||||||
|  |                         <el-input | ||||||
|  |                             style="width: 400px" | ||||||
|  |                             size="small" | ||||||
|  |                             splaceholder="请输入内容" | ||||||
|  |                             v-model="codeDetail.newCode" | ||||||
|  |                         ></el-input> | ||||||
|  |                     </div> | ||||||
|  |                 </el-col> | ||||||
|  |                 <el-col :span="10" class="el-col"> | ||||||
|  |                     <div class="text item"> | ||||||
|  |                         <div class="itemTag"> | ||||||
|  |                             <span>扫码数量: </span> | ||||||
|  |                         </div> | ||||||
|  |                         <el-input | ||||||
|  |                             style="width: 400px" | ||||||
|  |                             size="small" | ||||||
|  |                             splaceholder="请输入内容" | ||||||
|  |                             v-model="codeDetail.newCount" | ||||||
|  |                         ></el-input> | ||||||
|  |                     </div> | ||||||
|  |                 </el-col> | ||||||
|  |             </el-row> | ||||||
|  | 
 | ||||||
|  |             <div style="text-align: center"> | ||||||
|  |                 <el-button type="primary" size="small" icon="search" @click="replaceCodes" | ||||||
|  |                 >提交 | ||||||
|  |                 </el-button | ||||||
|  |                 > | ||||||
|  |                 <el-button type="primary" size="small" icon="search" @click="cancelDialog" | ||||||
|  |                 >取消 | ||||||
|  |                 </el-button | ||||||
|  |                 > | ||||||
|  |             </div> | ||||||
|  |         </el-dialog> | ||||||
|  |     </div> | ||||||
|  | </template> | ||||||
|  | 
 | ||||||
|  | <script> | ||||||
|  |     import {codeList} from "../../api/inout/order"; | ||||||
|  |     import draggable from "vuedraggable"; | ||||||
|  |     import {replaceCodes} from "../../api/basic/invWarehouse"; | ||||||
|  | 
 | ||||||
|  |     export default { | ||||||
|  |         name: "idQuery", | ||||||
|  |         props: { | ||||||
|  |             idQuery: { | ||||||
|  |                 type: Object, | ||||||
|  |                 required: true, | ||||||
|  |             }, | ||||||
|  |         }, | ||||||
|  |         data() { | ||||||
|  |             return { | ||||||
|  |                 query: { | ||||||
|  |                     code: "", | ||||||
|  |                     corpOrderId: "", | ||||||
|  |                     page: 1, | ||||||
|  |                     limit: 20, | ||||||
|  |                 }, | ||||||
|  |                 codeArry: [], | ||||||
|  |                 total: 0, | ||||||
|  |                 loading: true, | ||||||
|  |                 index: null, | ||||||
|  |                 formLoading: false, | ||||||
|  |                 formVisible: false, | ||||||
|  |                 replaceVisible: false, | ||||||
|  |                 deleteLoading: false, | ||||||
|  |                 orderNo: null, | ||||||
|  |                 busTypes: [], | ||||||
|  |                 codeDetail: { | ||||||
|  |                     code: null, | ||||||
|  |                     count: null, | ||||||
|  |                     newCode: null, | ||||||
|  |                     newCount: null, | ||||||
|  |                     orderId: null | ||||||
|  |                 } | ||||||
|  |             }; | ||||||
|  |         }, | ||||||
|  |         components: { | ||||||
|  |             draggable, | ||||||
|  |         }, | ||||||
|  |         methods: { | ||||||
|  |             onReset() { | ||||||
|  |                 this.$router.push({ | ||||||
|  |                     path: "", | ||||||
|  |                 }); | ||||||
|  |                 this.query = { | ||||||
|  |                     code: "", | ||||||
|  |                     corpOrderId: "", | ||||||
|  |                     page: 1, | ||||||
|  |                     limit: 20, | ||||||
|  |                 }; | ||||||
|  |                 this.getCodeList(); | ||||||
|  |             }, | ||||||
|  |             onSubmit() { | ||||||
|  |                 this.$router.push({ | ||||||
|  |                     path: "", | ||||||
|  |                     query: this.query, | ||||||
|  |                 }); | ||||||
|  |                 this.getCodeList(); | ||||||
|  |             }, | ||||||
|  |             handleSizeChange(val) { | ||||||
|  |                 this.query.limit = val; | ||||||
|  |                 this.getCodeList(); | ||||||
|  |             }, | ||||||
|  |             handleCurrentChange(val) { | ||||||
|  |                 this.query.page = val; | ||||||
|  |                 this.getCodeList(); | ||||||
|  |             }, | ||||||
|  | 
 | ||||||
|  |             getCodeList() { | ||||||
|  |                 this.loading = true; | ||||||
|  |                 this.query.corpOrderId = this.idQuery.id; | ||||||
|  |                 codeList(this.query) //查找该单号下的所有条码 | ||||||
|  |                     .then((response) => { | ||||||
|  |                         this.loading = false; | ||||||
|  |                         this.codeArry = response.data.list || []; | ||||||
|  |                         this.total = response.data.total || 0; | ||||||
|  |                     }) | ||||||
|  |                     .catch(() => { | ||||||
|  |                         this.loading = false; | ||||||
|  |                         this.list = []; | ||||||
|  |                         this.total = 0; | ||||||
|  |                     }); | ||||||
|  |             }, | ||||||
|  |             intentBack() { | ||||||
|  |                 this.$router.go(-1); | ||||||
|  |             }, | ||||||
|  |             showReplaceDialog(row) { | ||||||
|  |                 this.replaceVisible = true; | ||||||
|  |                 this.codeDetail = { | ||||||
|  |                     code: row.code, | ||||||
|  |                     count: row.count, | ||||||
|  |                     orderId: row.orderId | ||||||
|  |                 } | ||||||
|  |             }, | ||||||
|  |             cancelDialog() { | ||||||
|  |                 this.replaceVisible = false; | ||||||
|  |                 this.codeDetail = { | ||||||
|  |                     code: null, | ||||||
|  |                     count: null, | ||||||
|  |                     newCode: null, | ||||||
|  |                     newCount: null | ||||||
|  |                 }; | ||||||
|  |             }, | ||||||
|  |             replaceCodes(row) { | ||||||
|  |                 this.$confirm("是否确认删除条码和相关库存单据数据", "提示", { | ||||||
|  |                     confirmButtonText: '确定', | ||||||
|  |                     cancelButtonText: '取消', | ||||||
|  |                     type: 'warning' | ||||||
|  |                 }).then(() => { | ||||||
|  |                     this.codeDetail = { | ||||||
|  |                         code: row.code, | ||||||
|  |                         count: row.count, | ||||||
|  |                         orderId: row.orderId | ||||||
|  |                     } | ||||||
|  |                     replaceCodes(this.codeDetail).then((res) => { | ||||||
|  |                         if (res.code === 20000) { | ||||||
|  |                             this.$message.success("删除成功"); | ||||||
|  |                             this.getCodeList(); | ||||||
|  |                         } else { | ||||||
|  |                             this.$message.error(res.message); | ||||||
|  |                         } | ||||||
|  |                     }).catch((error) => { | ||||||
|  |                         this.$message.error(error.message); | ||||||
|  |                     }); | ||||||
|  |                 }).catch(() => { | ||||||
|  |                     this.$message({ | ||||||
|  |                         type: 'info', | ||||||
|  |                         message: '已取消删除' | ||||||
|  |                     }); | ||||||
|  |                 }); | ||||||
|  |             } | ||||||
|  |         }, | ||||||
|  |         filters: {}, | ||||||
|  |         mounted() { | ||||||
|  |             document.body.ondrop = function (event) { | ||||||
|  |                 event.preventDefault(); | ||||||
|  |                 event.stopPropagation(); | ||||||
|  |             }; | ||||||
|  |         }, | ||||||
|  |         created() { | ||||||
|  |             // 将参数拷贝进查询对象 | ||||||
|  |             let query = this.$route.query; | ||||||
|  |             this.orderNo = query.id; | ||||||
|  | 
 | ||||||
|  |             this.query = Object.assign(this.query, query); | ||||||
|  |             this.query.limit = parseInt(this.query.limit); | ||||||
|  |             this.query.corpOrderId = query.id; | ||||||
|  | 
 | ||||||
|  |             // 加载表格数据 | ||||||
|  |             this.getCodeList(); | ||||||
|  |         }, | ||||||
|  |     }; | ||||||
|  | </script> | ||||||
|  | 
 | ||||||
|  | <style scoped> | ||||||
|  |     .itemTag { | ||||||
|  |         float: left; | ||||||
|  |         text-align: left; | ||||||
|  |         margin-top: 10px; | ||||||
|  |         width: 100px; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     .text { | ||||||
|  |         font-size: 13px; | ||||||
|  |         font-family: "Microsoft YaHei"; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     .el-row { | ||||||
|  |         display: flex; | ||||||
|  |         flex-wrap: wrap; | ||||||
|  |         margin-bottom: 20px; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     .el-col { | ||||||
|  |         border-radius: 4px; | ||||||
|  |         flex-wrap: wrap; | ||||||
|  |     } | ||||||
|  | </style> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
					Loading…
					
					
				
		Reference in New Issue