Преглед изворни кода

Merge branch 'master' of http://47.107.53.207:3000/ymy/oms

ymy пре 2 година
родитељ
комит
48df8e3eb6
1 измењених фајлова са 94 додато и 147 уклоњено
  1. 94 147
      src/views/audit/orderTask/index.vue

+ 94 - 147
src/views/audit/orderTask/index.vue

@@ -105,7 +105,7 @@
 									attr: {
 										size: 'mini',
 										placeholder: '请输入备注',
-										type:'textarea'
+										type: 'textarea'
 									},
 								}
 							},
@@ -122,8 +122,9 @@
 						table: {
 							attr: {
 								size: 'mini',
-								height: 580,
+								height: 500,
 								align: 'center',
+								readonly:true
 							},
 							columns:
 								[{
@@ -132,40 +133,29 @@
 									field: 'materialName',
 								},
 								{
+									width: 140,
 									title: '单位',
 									field: 'unit',
-									component: 'by-input',
-									compConfig: {
-										attr: {
-											size: 'mini',
-											placeholder: ' ',
-											readonly: true
-										},
-									}
 								},
 								{
+									width: 140,
 									title: '数量',
 									field: 'number',
 									component: 'by-input',
 									compConfig: {
 										attr: {
 											size: 'mini',
+											type: 'number'
 										},
 									}
 								},
 								{
+									width: 140,
 									title: '已交付数量',
 									field: 'deliveryNumber',
-									component: 'by-input',
-									compConfig: {
-										attr: {
-											size: 'mini',
-											placeholder: '0',
-											readonly: true
-										},
-									}
 								},
 								{
+									width: 140,
 									title: '单价',
 									field: 'unitPrice',
 									component: 'by-input',
@@ -176,40 +166,30 @@
 									}
 								},
 								{
+									width: 140,
 									title: '实际金额',
 									field: 'realityPrice',
-									// component: 'by-input',
-									// compConfig: {
-									// 	attr: {
-									// 		size: 'mini',
-									// 		readonly: true
-									// 	},
-									// }
 								},
 								{
+									width: 140,
 									title: '优惠金额',
 									field: 'prePrice',
 									component: 'by-input',
 									compConfig: {
 										attr: {
 											size: 'mini',
-											defaultValue: '0'
+											defaultValue: '0',
+											type: 'number'
 										},
 									}
 								},
 								{
+									width: 140,
 									title: '合计金额',
 									field: 'totalPrice',
-									// component: 'by-input',
-									// compConfig: {
-									// 	attr: {
-									// 		size: 'mini',
-									// 		readonly: true
-									// 	},
-									// }
 								},
 								{
-									width: 80,
+									width: 90,
 									title: '操作',
 									action: true,
 									plugins: [{
@@ -263,14 +243,12 @@
 							},
 							{
 								span: 6,
-								label: '交货',
-								prop: 'delivery',
-								component: 'by-input',
+								label: '交货时间',
+								prop: 'deliveryData',
+								component: 'by-date-picker',
 								compConfig: {
-									attr: {
-										placeholder: '请输入交货人',
-										clearable: true
-									}
+									format: 'yyyy-MM-dd hh:ss:mm',
+									type: 'datetime'
 								}
 							},
 							{
@@ -293,18 +271,6 @@
 								}
 							},
 						],
-						[
-							{
-								span: 6,
-								label: '交货时间',
-								prop: 'deliveryData',
-								component: 'by-date-picker',
-								compConfig: {
-									format: 'yyyy-MM-dd hh:ss:mm',
-									type: 'datetime'
-								}
-							},
-						]
 					]
 				},
 				tool: {
@@ -316,24 +282,24 @@
 				},
 				table: {
 					attr: {
-						height: 600,
+						height: 620,
 						size: 'mini',
 						seq: true,
 						align: 'center',
 						checkbox: true
 					},
 					columns: [
-						{
-							width: 70,
-							title: '单据编号',
-							field: 'orderNumber',
-						},
 						{
 							width: 200,
 							title: '机构名称',
 							field: 'organizationName',
 							isDetail: true,
 						},
+						{
+							width: 150,
+							title: '单据编号',
+							field: 'orderNumber',
+						},
 						{
 							width: 80,
 							title: '状态',
@@ -351,21 +317,20 @@
 							field: 'deliveryData',
 						},
 						{
+							width: 130,
 							title: '交货人',
 							field: 'delivery',
 						},
 						{
-							title: '交货人联系方式',
+							width: 130,
+							title: '联系方式',
 							field: 'deliveryPhone',
 						},
 						{
+							width: 130,
 							title: '交货方式',
 							field: 'deliveryWay',
 						},
-						{
-							title: '备注',
-							field: 'remark',
-						},
 						{
 							width: 110,
 							title: '操作',
@@ -375,8 +340,8 @@
 								name: '编辑',
 								audit: '',
 								event: {
-									click: (item : any) => {
-										(this as any).openEdit(item)
+									click: (e : any) => {
+										(this as any).setReadonly(e)
 									}
 								}
 							}, {
@@ -421,18 +386,6 @@
 									}
 								}
 							},
-							{
-								span: 6,
-								label: '交货人',
-								prop: 'delivery',
-								component: 'by-input',
-								compConfig: {
-									attr: {
-										placeholder: '请输入交货人',
-										clearable: true
-									}
-								}
-							},
 							{
 								span: 6,
 								label: '交货时间',
@@ -443,6 +396,25 @@
 									type: 'datetime'
 								}
 							},
+							{
+								span: 6,
+								label: '状态',
+								prop: 'status',
+								component: 'by-select',
+								compConfig: {
+									attr: {
+										placeholder: '请选择状态',
+										clearable: true,
+										data: [{
+											value: 0,
+											label: '未接单'
+										}, {
+											value: 1,
+											label: '已接单'
+										}]
+									}
+								}
+							},
 						],
 					]
 				},
@@ -456,7 +428,7 @@
 				},
 				table: {
 					attr: {
-						height: 600,
+						height: 620,
 						size: 'mini',
 						seq: true,
 						align: 'center',
@@ -557,14 +529,12 @@
 							},
 							{
 								span: 6,
-								label: '交货',
-								prop: 'delivery',
-								component: 'by-input',
+								label: '交货时间',
+								prop: 'deliveryData',
+								component: 'by-date-picker',
 								compConfig: {
-									attr: {
-										placeholder: '请输入交货人',
-										clearable: true
-									}
+									format: 'yyyy-MM-dd hh:ss:mm',
+									type: 'datetime'
 								}
 							},
 							{
@@ -587,18 +557,6 @@
 								}
 							},
 						],
-						[
-							{
-								span: 6,
-								label: '交货时间',
-								prop: 'deliveryData',
-								component: 'by-date-picker',
-								compConfig: {
-									format: 'yyyy-MM-dd hh:ss:mm',
-									type: 'datetime'
-								}
-							},
-						]
 					]
 				},
 				tool: {
@@ -612,7 +570,7 @@
 				},
 				table: {
 					attr: {
-						height: 600,
+						height: 620,
 						size: 'mini',
 						seq: true,
 						align: 'center',
@@ -719,14 +677,12 @@
 							},
 							{
 								span: 6,
-								label: '交货',
-								prop: 'delivery',
-								component: 'by-input',
+								label: '交货时间',
+								prop: 'deliveryData',
+								component: 'by-date-picker',
 								compConfig: {
-									attr: {
-										placeholder: '请输入交货人',
-										clearable: true
-									}
+									format: 'yyyy-MM-dd hh:ss:mm',
+									type: 'datetime'
 								}
 							},
 							{
@@ -749,18 +705,6 @@
 								}
 							},
 						],
-						[
-							{
-								span: 6,
-								label: '交货时间',
-								prop: 'deliveryData',
-								component: 'by-date-picker',
-								compConfig: {
-									format: 'yyyy-MM-dd hh:ss:mm',
-									type: 'datetime'
-								}
-							},
-						]
 					]
 				},
 				tool: {
@@ -771,7 +715,7 @@
 				},
 				table: {
 					attr: {
-						height: 600,
+						height: 620,
 						size: 'mini',
 						seq: true,
 						align: 'center',
@@ -830,8 +774,8 @@
 								name: '查看',
 								audit: '',
 								event: {
-									click: () => {
-										(this as any).setReadonly()
+									click: (e : any) => {
+										(this as any).setReadonly(e)
 									}
 								}
 							}]
@@ -846,25 +790,10 @@
 				this.getDataList()
 			}, 500)
 		}
-		// 设置只读
-		setReadonly() {
-			let readonly = (this as any).$lodash.cloneDeep(this.config.bill);
-			readonly.form.attr.readonly = true; // 设置只可读
-			for (let key in readonly.tool) {
-				delete readonly.tool[key]
-			};
-			for (let key in readonly.tableConfig[0].tool) {
-				delete readonly.tableConfig[0].tool[key]
-			};
-			console.log('setBillConfig ==> ', readonly);
-			(this.$refs.bill as any).setBillConfig(readonly);
-			(this.$refs.bill as any).showTab = 'bill';
-		}
 		// 监听表格数据变化
 		onChangeRow(e : any) {
 			e.realityPrice = e.number * e.unitPrice;
-			// console.log(this.tableData);
-			// (this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
+			e.totalPrice = e.realityPrice - e.prePrice;
 		}
 		// 保存
 		onSave(e : any) {
@@ -934,16 +863,34 @@
 		// 打开编辑
 		openEdit(e : any) {
 			console.log('编辑 ==>', e);
-			e = e.row ? e.row : e;
-			let data = e.suborderList
-			data.map((v : any, i : any) => {
-				v.dataIndex = i
-			});
-			this.tableData = data;
-			// let readonly = (this as any).$lodash.cloneDeep(this.config.bill);
-			// console.log(this.config.bill);
-			// (this.$refs.bill as any).setBillConfig(readonly);
-			(this.$refs.bill as any).setBillFormValue(e); // 设置单据表单数据
+			if (e.tpye === 'all') {
+				e = e.row ? e.row : e;
+				let data = e.suborderList
+				data.map((v : any, i : any) => {
+					v.dataIndex = i
+				});
+				this.tableData = data;
+				// let readonly = (this as any).$lodash.cloneDeep(this.config.bill);
+				// console.log(this.config.bill);
+				// (this.$refs.bill as any).setBillConfig(readonly);
+				(this.$refs.bill as any).setBillFormValue(e); // 设置单据表单数据
+				(this.$refs.bill as any).setBillTableValue(data, 0);// 设置第1张单据表格数据
+				(this.$refs.bill as any).showTab = 'bill';
+			} else this.setReadonly(e.row ? e.row : e);
+		}
+		// 设置只读
+		setReadonly(e : any) {
+			let readonly = (this as any).$lodash.cloneDeep(this.config.bill);
+			readonly.form.attr.readonly = true; // 设置只可读
+			for (let key in readonly.tool) {
+				delete readonly.tool[key]
+			};
+			for (let key in readonly.tableConfig[0].tool) {
+				delete readonly.tableConfig[0].tool[key]
+			};
+			let data = e.suborderList;
+			console.log('setBillConfig ==> ', readonly);
+			(this.$refs.bill as any).setBillConfig(readonly);
 			(this.$refs.bill as any).setBillTableValue(data, 0);// 设置第1张单据表格数据
 			(this.$refs.bill as any).showTab = 'bill';
 		}