Kaynağa Gözat

仓位库存跟销售单引单问题

AlanWong 2 yıl önce
ebeveyn
işleme
a7418f537d

+ 11 - 3
src/views/audit/depots/index.vue

@@ -27,6 +27,10 @@
 								<el-button slot="append" icon="el-icon-more" @click="handleSupplier"></el-button>
 							</el-input>
 						</template>
+						<template v-slot:stock="{value}">
+							<vxe-input v-if="isAdd" v-model="value.stock" style="width: 100%;" size="small" type="text"></vxe-input>
+							<span v-else>{{ value.stock }}</span>
+						</template>
 					</by-form>
 					<div slot="footer" class="dialog-footer">
 						<el-button @click="dialogFormVisible2 = false">取 消</el-button>
@@ -52,6 +56,7 @@
 		tableData : any = {}
 		dialogFormVisible : boolean = false
 		dialogFormVisible2 : boolean = false
+		isAdd : any = false
 		config : any = {
 			search: {
 				attr: {
@@ -192,8 +197,8 @@
 								attr: {
 									placeholder: '请输入库存',
 									clearable: true
-								}
-							}
+								},
+							},
 						},
 						{
 							span: 6,
@@ -388,7 +393,7 @@
 						span: 23,
 						label: '库存',
 						prop: 'stock',
-						component: 'by-input',
+						slot: true
 					},
 					{
 						labelWidth: '110px',
@@ -555,6 +560,7 @@
 		onAdd2() {
 			this.popTitle = '注册'
 			this.dialogFormVisible2 = true;
+			this.isAdd = true;
 			setTimeout(() => {
 				if ((this as any).$refs.addFormId2) (this as any).$refs.addFormId2.setValue({});
 			}, 0)
@@ -563,6 +569,8 @@
 		openEdit2(e : any) {
 			this.popTitle = '编辑'
 			this.dialogFormVisible2 = true;
+			this.isAdd = false;
+			console.log(e);
 			setTimeout(() => {
 				if ((this as any).$refs.addFormId2) (this as any).$refs.addFormId2.setValue(e);
 			}, 0)

+ 1 - 1
src/views/audit/saleOrder/components/orderType.vue

@@ -1,7 +1,7 @@
 <template>
 	<div @click="onChange" class="orderType">
 		{{propValue}}
-		<div class="typeText" v-if="parentValue.isMaster===1" key="master1">被拆</div>
+		<div class="typeText" v-if="parentValue.isMaster===1" key="master1"></div>
 		<div class="typeText typeText2" v-else key="master2">拆</div>
 	</div>
 </template>

+ 34 - 27
src/views/audit/saleOrder/index.vue

@@ -225,11 +225,11 @@
 				tool: {
 					customTools: []
 				},
-				log:{
-				  request:{
-				    url:'/supply/supplyPurchaseOrderOperateLog/page',
-				    method:'GET'
-				  }
+				log: {
+					request: {
+						url: '/supply/supplyPurchaseOrderOperateLog/page',
+						method: 'GET'
+					}
 				},
 				form: {
 					attr: {
@@ -608,27 +608,34 @@
 		}
 		// 引单
 		citationOrder() {
-			let data : any = (this as any).$refs.bill.getSourceTableSelectData(0);
-			console.log(data);
-			if (data.length <= 0) return this.$message.warning('请选择引单数据');
-			data = data.map((item : any) => {
-				item.address = item.deliveryAddress
-				item.consignee = item.delivery
-				item.phone = item.deliveryPhone
-				item.planDeliveryData = item.deliveryData
-				const { ...newData } = item
-				return newData
+			let parentData : any = (this as any).$refs.bill.getSourceTableSelectData(0);
+			console.log(parentData);
+			if (parentData.length <= 0) return this.$message.warning('请选择引单数据');
+			let loading = this.$loading({ target: '.main-container' });
+			api.single({ id: parentData[0].id }, 'supplyTaskOrder').then((res : any) => {
+				if (res.code === 200) {
+					parentData = res.data ? [res.data] : parentData;
+					parentData = parentData.map((item : any) => {
+						item.address = item.deliveryAddress
+						item.consignee = item.delivery
+						item.phone = item.deliveryPhone
+						item.planDeliveryData = item.deliveryData
+						const { ...newData } = item
+						return newData
+					});
+					let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
+					billConfig.tool.tools = { order: true };
+					billConfig.tool.customTools = [];
+					this.isCitation = true;
+					(this.$refs.bill as any).showTab = 'bill';
+					loading.close();
+					setTimeout(() => {
+						(this.$refs.bill as any).setBillConfig(billConfig);
+						(this.$refs.bill as any).setBillFormValue(parentData[0]); // 设置单据表单数据
+						(this.$refs.bill as any).setBillTableValue(parentData[0].suborderList, 0);// 设置第1张单据表格数据
+					}, 0)
+				}
 			})
-			let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
-			billConfig.tool.tools = { order: true };
-			billConfig.tool.customTools = [];
-			this.isCitation = true;
-			// (this.$refs.bill as any).showTab = 'bill';
-			setTimeout(() => {
-				(this.$refs.bill as any).setBillConfig(billConfig);
-				(this.$refs.bill as any).setBillFormValue(data[0]); // 设置单据表单数据
-				(this.$refs.bill as any).setBillTableValue(data[0].suborderList, 0);// 设置第1张单据表格数据
-			}, 0)
 		};
 		// 接单
 		onOrder() {
@@ -850,7 +857,7 @@
 					} else this.$message.error(res.msg)
 				})
 			}).catch(() => this.$message.info('已取消终止订单'));
-		}	
+		}
 		// 单据操作终止订单
 		doBackOrder2(e : any) {
 			this.$confirm('确定终止订单吗!', '注意', {
@@ -903,7 +910,7 @@
 			} else {
 				(this as any).$refs.bill.$refs[data].clearSearch();
 				if (data === 'all') this.getPageList({}, 'all'); // 综合数据
-				if (data === 'returnOrder') this.getPageList({status:2}, 'returnOrder'); // 终止订单数据
+				if (data === 'returnOrder') this.getPageList({ status: 2 }, 'returnOrder'); // 终止订单数据
 			}
 		}
 	}