瀏覽代碼

6.8问题

AlanWong 2 年之前
父節點
當前提交
59f3f6b066

+ 3 - 3
src/components/Assembly/order.vue

@@ -1,7 +1,7 @@
 <template>
 	<div>
-		<el-tag size='mini' :type="propValue==0?'info':'primary'"
-			disable-transitions>{{propValue==0?'未接单':'已接单'}}</el-tag>
+		<el-tag size='mini' :type="propValue===0?'info':'primary'"
+			disable-transitions>{{propValue===0?'未接单':'已接单'}}</el-tag>
 	</div>
 </template>
 <script lang="ts">
@@ -12,7 +12,7 @@ import { Component, Prop, Vue, Watch, Mixins } from "vue-property-decorator";
 		propValue : any
 		
 		created(){
-			// console.log(this.propValue);
+			console.log(this.propValue);
 		}
 	}
 

+ 3 - 3
src/views/audit/order/index.vue

@@ -204,10 +204,10 @@
 										placeholder: '请选择状态',
 										clearable: true,
 										data: [{
-											value: 0,
+											value: 1,
 											label: '未接单'
 										}, {
-											value: 1,
+											value: 2,
 											label: '已接单'
 										}]
 									}
@@ -292,7 +292,7 @@
 								name: '接单',
 								event: {
 									show: (item : any) => {
-										return item.status === 0
+										return item.status === 1
 									},
 									click: (item : any) => {
 										(this as any).getOrder(item)

+ 31 - 27
src/views/audit/orderTask/index.vue

@@ -27,6 +27,7 @@
 		baseInfo : any = {}
 		isSubmit : any = false
 		isChange : any = false
+		dataId : any = ''
 		// 右边
 		supplierInfo : any = {} // 机构信息
 		tableData : any = []
@@ -45,11 +46,11 @@
 						save: true,
 					}
 				},
-				log:{
-				  request:{
-				    url:'/supply/supplyTaskOrderOperateLog/page',
-				    method:'GET'
-				  }
+				log: {
+					request: {
+						url: '/supply/supplyTaskOrderOperateLog/page',
+						method: 'GET'
+					}
 				},
 				form: {
 					attr: {
@@ -166,11 +167,6 @@
 										},
 									}
 								},
-								{
-									width: 140,
-									title: '已交付数量',
-									field: 'deliveryNumber',
-								},
 								{
 									width: 140,
 									title: '单价',
@@ -853,6 +849,10 @@
 			console.log('保存tabType ==>', this.tabType);
 			(this as any).$refs.bill.$refs.billForm.validate().then(() => {
 				let query = (this.$refs.bill as any).getBillFormValue(); // 获取单据数据
+				// 手机验证
+				let reg = /^1[3456789]\d{9}$/;
+				// let reg = /^0\d{2,3}-\d{7,8}$/ 
+				if (query.deliveryPhone && !reg.test(query.deliveryPhone)) return this.$message.warning('请输入正确手机号码');
 				// 供应商数据
 				if (!query.organizationName) query.organizationName = this.supplierInfo.name;
 				if (!query.organizationId) query.organizationId = this.supplierInfo.id;
@@ -879,12 +879,13 @@
 				if (this.isAdd) {
 					api.saveList(query, 'supplyTaskOrder').then((res : any) => {
 						if (res.code === 200) {
-							// this.isAdd = false;
-							// this.isChange = false;
-							// this.isSubmit = true;
-							this.getDataList();
+							this.isAdd = false;
+							this.isChange = false;
+							this.isSubmit = true;
 							this.$message.success('保存成功');
-							(this.$refs.bill as any).showTab = 'all';
+							this.dataId = res.data;
+							// this.getDataList();
+							// (this.$refs.bill as any).showTab = 'all';
 						} else this.$message.error(res.msg);
 					})
 				} else if (this.tabType === 'all' || this.tabType === 'draftsBox') {
@@ -912,11 +913,11 @@
 				let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
 				billConfig.form.attr.readonly = false; // 设置只读
 				billConfig.tool.tools = { save: true, };
-				// if (e === 'all') {
-				// 	billConfig.tool.tools = { save: true, smt: true };
-				// 	this.tableData = [];
-				// 	(this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
-				// }
+				if (e === 'all') {
+					billConfig.tool.tools = { save: true, smt: true };
+					this.tableData = [];
+					(this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
+				};
 				billConfig.tableConfig[0].tool.tools = { add: true };
 				this.isAdd = true;
 				(this.$refs.bill as any).setBillConfig(billConfig);
@@ -938,12 +939,12 @@
 						// 已提交
 						if (parentData.submitState === 1) {
 							loading.close();
-							return this.setReadonly(parentData,true)
+							return this.setReadonly(parentData, true)
 						};
 						// 回收站
-						if(this.tabType === 'recycleBin' ){
+						if (this.tabType === 'recycleBin') {
 							loading.close();
-							return this.setReadonly(parentData,false)
+							return this.setReadonly(parentData, false)
 						};
 						let data = parentData.suborderList
 						data.map((v : any, i : any) => {
@@ -977,17 +978,18 @@
 						(this.$refs.bill as any).setBillFormValue(parentData);// 设置单据表单数据
 						(this.$refs.bill as any).setBillTableValue(data, 0);// 设置第1张单据表格数据
 						this.isAdd = false;
+						this.dataId = '';
 						(this.$refs.bill as any).showTab = 'bill';
 						loading.close();
 					} else {
 						loading.close();
-						this.setReadonly(parentData,false);
+						this.setReadonly(parentData, false);
 					};
 				}
 			})
 		}
 		// 设置只读
-		setReadonly(e : any,isReturn:any) {
+		setReadonly(e : any, isReturn : any) {
 			let readonly = (this as any).$lodash.cloneDeep(this.config.bill);
 			readonly.form.attr.readonly = true; // 设置只读
 			readonly.tool.tools = {};
@@ -1031,11 +1033,13 @@
 						type: 'warning',
 						center: true
 					}).then(() => {
-						api.submitTo({ id: this.baseInfo.id }, 'supplyTaskOrder').then((res : any) => {
+						let id = this.dataId ? this.dataId : this.baseInfo.id;
+						api.submitTo({ id: id }, 'supplyTaskOrder').then((res : any) => {
 							if (res.code === 200) {
 								this.$message.success('提交成功');
 								this.clickTab(this.tabType);
 								this.isSubmit = false;
+								this.dataId = '';
 								(this.$refs.bill as any).showTab = this.tabType;
 							} else this.$message.error(res.msg)
 						})
@@ -1193,7 +1197,7 @@
 			if (e === 'recycleBin') this.getSelectDeleteList({}) // 回收站数据
 			if (e === 'bill') {
 				let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
-				billConfig.tool.tools={};
+				billConfig.tool.tools = {};
 				billConfig.tool.customTools = [];
 				(this.$refs.bill as any).setBillConfig(billConfig);
 			}

+ 32 - 27
src/views/audit/outbound/index.vue

@@ -785,31 +785,37 @@
 		// 引单
 		citationOrder() {
 			let parentData : any = (this as any).$refs.bill.getSourceTableSelectData(0);
-			console.log(parentData);
 			if (parentData.length <= 0) return this.$message.warning('请选择引单数据');
-			parentData = parentData.map((item : any, i : any) => {
-				item.dataIndex = i;
-				item.receiveAddress = item.address
-				item.receive = item.consignee
-				item.receivePhone = item.phone
-				const { ...newData } = item
-				return newData
+			let loading = this.$loading({ target: '.main-container' });
+			api.single({ id: parentData[0].id }, 'supplyPurchaseOrder').then((res : any) => {
+				if (res.code === 200) {
+					parentData = res.data ? [res.data] : parentData;
+					parentData = parentData.map((item : any, i : any) => {
+						item.dataIndex = i;
+						item.receiveAddress = item.address
+						item.receive = item.consignee
+						item.receivePhone = item.phone
+						const { ...newData } = item
+						return newData
+					})
+					let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
+					parentData[0].suborderList.map((v : any) => {
+						v.deliveryNumber = v.number - v.outNumber;
+						if (v.deliveryNumber < v.number) v.number = v.deliveryNumber;
+					});
+					this.isAdd = true;
+					this.tableData = parentData[0];
+					// console.log('this.tableData ==> ', this.tableData);
+					billConfig.tool.tools = { save: 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);
-			parentData[0].suborderList.map((v : any) => {
-				// v.outNumber = v.outNumber ? v.outNumber : 0;
-				v.deliveryNumber = v.number - v.outNumber;
-			});
-			this.isAdd = true;
-			this.tableData = parentData[0];
-			console.log('this.tableData ==> ', this.tableData);
-			billConfig.tool.tools = { save: true };
-			(this.$refs.bill as any).showTab = 'bill';
-			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)
 		}
 		// 获取机构数据
 		getSupplierModal(e : any) {
@@ -951,15 +957,14 @@
 						let data : any = parentData.suborderList;
 						let array : any = [];
 						data.map((v : any, i : any) => {
-							console.log(this.tabType);
 							v.dataIndex = i;
 							v.towInOne = v.storehouseName + ',' + v.storingLocationName; // 仓库仓位
 							array.push({
-								storidId: v.storehouseId,
+								storidId: v.storingLocationId,
 								skuid: v.materialSku,
 							})
 						});
-						console.log('data', data);
+						console.log('array', array);
 						//  查库存
 						api.getInventoryByStoridsAndSkuids(array).then((res : any) => {
 							if (res.code === 200) {
@@ -999,7 +1004,7 @@
 			data.map((v : any) => {
 				v.towInOne = v.storehouseName + ',' + v.storingLocationName; // 仓库仓位
 				array.push({
-					storidId: v.storehouseId,
+					storidId: v.storingLocationId,
 					skuid: v.materialSku,
 				})
 			});

+ 3 - 2
src/views/audit/saleOrder/index.vue

@@ -327,7 +327,7 @@
 								{
 									width: 150,
 									title: '已交付数量',
-									field: 'deliveryNumber',
+									field: 'outNumber',
 								},
 								{
 									width: 150,
@@ -609,6 +609,7 @@
 		// 引单
 		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
@@ -622,7 +623,7 @@
 			billConfig.tool.tools = { order: true };
 			billConfig.tool.customTools = [];
 			this.isCitation = true;
-			(this.$refs.bill as any).showTab = 'bill';
+			// (this.$refs.bill as any).showTab = 'bill';
 			setTimeout(() => {
 				(this.$refs.bill as any).setBillConfig(billConfig);
 				(this.$refs.bill as any).setBillFormValue(data[0]); // 设置单据表单数据