Răsfoiți Sursa

订单任务问题

AlanWong 2 ani în urmă
părinte
comite
4bd1865d96

+ 14 - 25
src/views/audit/brand/index.vue

@@ -186,6 +186,13 @@
 						label: '备注',
 						prop: 'remark',
 						component: 'by-input',
+						compConfig: {
+							attr: {
+								size: 'mini',
+								placeholder: '请输入备注',
+								type:'textarea'
+							},
+						}
 					},
 				]
 			]
@@ -214,12 +221,9 @@
 				if (this.popTitle === '新增') {
 					api.saveList(query, 'maindataMaterialBrand').then((res : any) => {
 						if (res.code === 200) {
-							this.$message({
-								type: 'success',
-								message: this.popTitle + '成功!'
-							});
+							this.$message.success(this.popTitle + '成功!');
 							this.getDataList();
-						} else this.failHandle(res)
+						} else this.$message.error(res.msg);
 					})
 				} else if (this.popTitle === '编辑') {
 					api.updateList(query, 'maindataMaterialBrand').then((res : any) => {
@@ -229,7 +233,7 @@
 								message: this.popTitle + '成功!'
 							});
 							this.getDataList();
-						} else this.failHandle(res)
+						} else this.$message.error(res.msg);
 					})
 				}
 			})
@@ -254,7 +258,7 @@
 						total: res.data.total //总条数
 					};
 					(this.$refs.moduleView as any).setPage(page)
-				} else this.failHandle(res)
+				} else this.$message.error(res.msg);
 			})
 		}
 		// 工具栏方法
@@ -305,7 +309,7 @@
 							type: 'success',
 							message: '删除成功!'
 						});
-					} else this.failHandle(res)
+					} else this.$message.error(res.msg);
 				})
 			}).catch(() => {
 				this.$message({
@@ -329,21 +333,12 @@
 							type: 'success',
 							message: '删除成功!'
 						});
-					} else this.failHandle(res)
+					} else this.$message.error(res.msg);
 				})
 			}).catch(() => {
-				this.$message({
-					type: 'info',
-					message: '已取消删除'
-				});
+				this.$message.info('已取消删除');
 			});
 		}
-		handleRemove(file : any, fileList : any) {
-			console.log(file, fileList);
-		}
-		handlePictureCardPreview(file : any) {
-			console.log(file);
-		}
 		//导出
 		onExport() {
 			let urlArr = '/maindata/maindataMaterial';
@@ -352,12 +347,6 @@
 				...query
 			}, urlArr[urlArr.length - 1] + `_${new Date().getTime()}.xlsx`)
 		}
-		// 运行错误
-		failHandle(err : any) {
-			let msg = err.msg ? err.msg : '运行错误!';
-			this.$message.error(msg)
-		}
-
 	}
 </script>
 <style lang="scss" scoped>

+ 168 - 41
src/views/audit/order/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<div>
 		<by-bill ref="bill" :propConfig="config" @search="search" @onSmt="doSave" @onAdd="onAdd" @onOrder="onOrder"
-			@resert="resert" @clickHandle="clickHandle" @detail="openEdit">
+			@resert="resert" @refresh="clickHandle" @detail="openEdit">
 		</by-bill>
 	</div>
 </template>
@@ -35,6 +35,12 @@
 								label: '机构名称',
 								prop: 'organizationName',
 								component: 'by-input',
+								compConfig: {
+									attr: {
+										size: 'mini',
+										readonly: true
+									},
+								}
 							},
 							{
 								span: 8,
@@ -42,38 +48,63 @@
 								slot: true,
 								prop: 'orderNumber',
 								component: 'by-input',
+								compConfig: {
+									attr: {
+										size: 'mini',
+										readonly: true
+									},
+								}
 							},
 							{
 								span: 8,
-								label: '交货地点',
+								label: '联系方式',
 								slot: true,
-								prop: 'deliveryAddress',
+								prop: 'deliveryPhone',
 								component: 'by-input',
+								compConfig: {
+									attr: {
+										size: 'mini',
+										readonly: true
+									},
+								}
 							},
 							{
 								span: 8,
-								label: '交货时间',
+								label: '交货',
 								slot: true,
-								prop: 'deliveryData',
-								component: 'by-date-picker',
+								prop: 'delivery',
+								component: 'by-input',
 								compConfig: {
-									format: 'yyyy-MM-dd hh:ss:mm',
-									type: 'datetime'
+									attr: {
+										size: 'mini',
+										readonly: true
+									},
 								}
 							},
 							{
 								span: 8,
-								label: '交货',
+								label: '交货时间',
 								slot: true,
-								prop: 'delivery',
-								component: 'by-input',
+								prop: 'deliveryData',
+								component: 'by-date-picker',
+								compConfig: {
+									format: 'yyyy-MM-dd hh:ss:mm',
+									type: 'datetime',
+									readonly: true
+								}
 							},
 							{
 								span: 8,
-								label: '联系方式',
+								label: '交货地点',
 								slot: true,
-								prop: 'deliveryPhone',
+								prop: 'deliveryAddress',
 								component: 'by-input',
+								compConfig: {
+									attr: {
+										size: 'mini',
+										readonly: true
+									},
+								}
 							},
 							{
 								span: 8,
@@ -81,17 +112,127 @@
 								slot: true,
 								prop: 'deliveryWay',
 								component: 'by-input',
+								compConfig: {
+									attr: {
+										size: 'mini',
+										readonly: true
+									},
+								}
 							},
+						],
+						[
 							{
-								span: 8,
+								span: 28,
 								label: '备注',
 								slot: true,
 								prop: 'remark',
 								component: 'by-input',
+								compConfig: {
+									attr: {
+										size: 'mini',
+										readonly: true,
+										type:'textarea'
+									},
+								}
 							},
-						],
+						]
 					]
-				}
+				},
+				tableConfig: [
+					{
+						table: {
+							attr: {
+								size: 'mini',
+								height: 580,
+								align: 'center',
+							},
+							columns:
+								[{
+									width: 300,
+									title: '物料名称',
+									field: 'materialName',
+								},
+								{
+									title: '单位',
+									field: 'unit',
+									component: 'by-input',
+									compConfig: {
+										attr: {
+											size: 'mini',
+											readonly: true
+										},
+									}
+								},
+								{
+									title: '数量',
+									field: 'number',
+									component: 'by-input',
+									compConfig: {
+										attr: {
+											size: 'mini',
+											readonly: true
+										},
+									}
+								},
+								{
+									title: '已交付数量',
+									field: 'deliveryNumber',
+									component: 'by-input',
+									compConfig: {
+										attr: {
+											size: 'mini',
+											readonly: true
+										},
+									}
+								},
+								{
+									title: '单价',
+									field: 'unitPrice',
+									component: 'by-input',
+									compConfig: {
+										attr: {
+											size: 'mini',
+											readonly: true
+										},
+									}
+								},
+								{
+									title: '实际金额',
+									field: 'realityPrice',
+									component: 'by-input',
+									compConfig: {
+										attr: {
+											size: 'mini',
+											readonly: true
+										},
+									}
+								},
+								{
+									title: '优惠金额',
+									field: 'prePrice',
+									component: 'by-input',
+									compConfig: {
+										attr: {
+											size: 'mini',
+											readonly: true
+										},
+									}
+								},
+								{
+									title: '合计金额',
+									field: 'totalPrice',
+									component: 'by-input',
+									compConfig: {
+										attr: {
+											size: 'mini',
+											readonly: true
+										},
+									}
+								},
+							]
+						}
+					}
+				]
 			},
 			// 综合
 			all: {
@@ -127,14 +268,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',
+									type: 'datetime'
 								}
 							},
 							{
@@ -157,24 +296,11 @@
 								}
 							},
 						],
-						[
-							{
-								span: 6,
-								label: '交货时间',
-								prop: 'deliveryData',
-								component: 'by-date-picker',
-								compConfig: {
-									format: 'yyyy-MM-dd',
-									type: 'datetime'
-								}
-							},
-						]
 					]
 				},
 				tool: {
 					tools: {
 						order: true,
-						export: true,
 						search: true,
 						refresh: true
 					}
@@ -247,7 +373,7 @@
 							}, {
 								name: '接单',
 								event: {
-									show:(item:any)=>{
+									show: (item : any) => {
 										return item.status === 0
 									},
 									click: (item : any) => {
@@ -267,7 +393,7 @@
 		}
 		// 工具栏方法
 		clickHandle(e : any) {
-			console.log(e);
+			console.log('工具栏方法 ==> ', e);
 		}
 		// 保存新增
 		doSave() {
@@ -332,16 +458,17 @@
 		// 打开新增
 		onAdd(e : any) {
 			console.log(e);
-			// this.orderType = '新增';
 			(this.$refs.bill as any).setBillFormValue({}); // 设置单据表单数据
 			(this.$refs.bill as any).showTab = 'bill';
 		}
 		// 打开编辑
 		openEdit(e : any) {
-			console.log(e);
 			e = e.row ? e.row : e;
-			// this.orderType = '编辑';
+			// 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(e.suborderList, 0);// 设置第1张单据表格数据
 			(this.$refs.bill as any).showTab = 'bill';
 		}
 		// 搜索

+ 48 - 42
src/views/audit/orderTask/index.vue

@@ -17,12 +17,13 @@
 	export default class OrderTask extends Vue {
 		// 右边
 		tableData : any = []
+		mergeObj : any = []
 		setStatusData : any = ''
 		timeNum = 0;
 		timer : any = null
 		config : any = {
 			attr: {
-				activeName: 'bill'
+				activeName: 'all'
 			},
 			// 单据
 			bill: {
@@ -60,8 +61,14 @@
 							},
 							{
 								span: 8,
-								label: '交货地点',
-								prop: 'deliveryAddress',
+								label: '联系方式',
+								prop: 'deliveryPhone',
+								component: 'by-input',
+							},
+							{
+								span: 8,
+								label: '交货人',
+								prop: 'delivery',
 								component: 'by-input',
 							},
 							{
@@ -76,14 +83,8 @@
 							},
 							{
 								span: 8,
-								label: '交货人',
-								prop: 'delivery',
-								component: 'by-input',
-							},
-							{
-								span: 8,
-								label: '联系方式',
-								prop: 'deliveryPhone',
+								label: '交货地点',
+								prop: 'deliveryAddress',
 								component: 'by-input',
 							},
 							{
@@ -92,14 +93,23 @@
 								prop: 'deliveryWay',
 								component: 'by-input',
 							},
+						],
+						[
 							{
-								span: 8,
+								span: 28,
 								label: '备注',
 								slot: true,
 								prop: 'remark',
 								component: 'by-input',
+								compConfig: {
+									attr: {
+										size: 'mini',
+										placeholder: '请输入备注',
+										type:'textarea'
+									},
+								}
 							},
-						],
+						]
 					]
 				},
 				tableConfig: [
@@ -114,15 +124,12 @@
 								size: 'mini',
 								height: 580,
 								align: 'center',
-								// seq: true,
-								// checkbox: true
 							},
 							columns:
 								[{
 									width: 300,
 									title: '物料名称',
 									field: 'materialName',
-									// component: 'by-input'
 								},
 								{
 									title: '单位',
@@ -158,17 +165,6 @@
 										},
 									}
 								},
-								// {
-								// 	title: '规格',
-								// 	field: 'specs',
-								// 	component: 'by-input',
-								// 	compConfig: {
-								// 		attr: {
-								// 			size: 'mini',
-								// 			readonly:true
-								// 		},
-								// 	}
-								// },
 								{
 									title: '单价',
 									field: 'unitPrice',
@@ -834,8 +830,8 @@
 								name: '查看',
 								audit: '',
 								event: {
-									click: (item : any) => {
-										(this as any).openEdit(item)
+									click: () => {
+										(this as any).setReadonly()
 									}
 								}
 							}]
@@ -850,10 +846,25 @@
 				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) {
-			// console.log(e);
-			// this.tableData.filter((v:any) => v.id == e.id);
+			this.tableData[e.dataIndex].realityPrice = e.number * e.unitPrice;
+			// console.log(this.tableData);
+			(this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
 		}
 		// 保存
 		onSave(e : any) {
@@ -922,13 +933,16 @@
 		}
 		// 打开编辑
 		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;
-			console.log('表格数据 ==> ', this.tableData);
+			// 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';
@@ -957,19 +971,11 @@
 		}
 		// 切换tab栏
 		clickTab(e : any) {
-			// console.log(e);
+			console.log('切换tab ==> ', e);
 			// submitState: 提交状态
 			if (e === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
 			if (e === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
-			if (e === 'recycleBin') { // 回收站数据
-				// let data = (this as any).$lodash.cloneDeep(this.config.bill);
-				// data.form.attr.readonly = true;
-				// for (const item of data.tableConfig) {
-				// 	delete item.tool
-				// }
-				// (this.$refs.bill as any).setBillConfig(data)
-				this.getSelectDeleteList('supplyTaskOrder')
-			}
+			if (e === 'recycleBin') this.getSelectDeleteList('supplyTaskOrder'); // 回收站数据
 		}
 		// 初始化
 		getDataList() {

+ 34 - 54
src/views/audit/productManagement/index.vue

@@ -145,28 +145,6 @@
 				align: 'center',
 			},
 			columns: [
-				// {
-				// 	title: '标题',
-				// 	field: 'skuTitle',
-				// 	component: 'by-input',
-				// 	compConfig: {
-				// 		attr: {
-				// 			size: 'mini',
-				// 			placeholder: ' '
-				// 		},
-				// 	}
-				// },
-				// {
-				// 	title: '副标题',
-				// 	field: 'skuSubtitle',
-				// 	component: 'by-input',
-				// 	compConfig: {
-				// 		attr: {
-				// 			size: 'mini',
-				// 			placeholder: ' '
-				// 		},
-				// 	}
-				// },
 				{
 					title: '价格',
 					field: 'price',
@@ -180,6 +158,18 @@
 						},
 					}
 				},
+				{
+					title: '单位',
+					field: 'unit',
+					component: 'by-input',
+					compConfig: {
+						attr: {
+							size: 'mini',
+							placeholder: ' ',
+							defaultValue: '袋'
+						},
+					}
+				},
 				{
 					title: '库存',
 					field: 'stock',
@@ -317,6 +307,19 @@
 						},
 					}
 				},
+				{
+					width: '100px',
+					title: '单位',
+					field: 'unit',
+					component: 'by-input',
+					compConfig: {
+						attr: {
+							size: 'mini',
+							placeholder: ' ',
+							defaultValue: '袋'
+						},
+					}
+				},
 				{
 					width: '100px',
 					title: '库存',
@@ -502,12 +505,13 @@
 					},
 					{
 						span: 6,
-						label: '单位',
-						prop: 'unit',
+						label: '国际码',
+						prop: 'nsCode',
 						component: 'by-input',
+						labelWidth: '70px',
 						compConfig: {
 							attr: {
-								placeholder: '请输入单位',
+								placeholder: '请输入国际码',
 								clearable: true
 							}
 						}
@@ -549,18 +553,6 @@
 							}
 						}
 					},
-					{
-						span: 6,
-						label: '国际码',
-						prop: 'nsCode',
-						component: 'by-input',
-						compConfig: {
-							attr: {
-								placeholder: '请输入国际码',
-								clearable: true
-							}
-						}
-					},
 				],
 				[
 					{
@@ -756,19 +748,6 @@
 								}
 							}
 						},
-						{
-							span: 6,
-							label: '国际码',
-							prop: 'nsCode',
-							component: 'by-input',
-							labelWidth: '70px',
-							compConfig: {
-								attr: {
-									placeholder: '请输入国际码',
-									clearable: true
-								}
-							}
-						},
 						// {
 						// 	span: 6,
 						// 	label: '价格',
@@ -855,11 +834,12 @@
 				// 	title: '价格', // 价格(成交、成本价)
 				// 	field: 'price'
 				// }, 
+				// {
+				// 	width: 80,
+				// 	title: '单位',
+				// 	field: 'unit'
+				// },
 				{
-					width: 80,
-					title: '单位',
-					field: 'unit'
-				}, {
 					width: 120,
 					title: '操作',
 					action: true,

+ 15 - 37
src/views/audit/saleOrder/index.vue

@@ -2,11 +2,6 @@
 	<div>
 		<by-bill :propConfig="config" @search="search" @onSmt="doSave" ref="bill" @onAdd="onAdd" @onOrder="onOrder"
 			@resert="resert" @clickHandle="clickHandle" @detail="openEdit">
-			<template v-slot:remark>
-				<!-- <div>123</div> -->
-				<el-input type="textarea" :rows="5" placeholder="请输入备注" v-model="textarea">
-				</el-input>
-			</template>
 		</by-bill>
 	</div>
 </template>
@@ -18,10 +13,9 @@
 	export default class OrderTask extends Vue {
 		timeNum = 0;
 		timer : any = null
-		textarea='123'
 		config : any = {
 			attr: {
-				activeName: 'bill'
+				activeName: 'all'
 			},
 			// 单据
 			bill: {
@@ -180,20 +174,6 @@
 									}
 								}
 							},
-							{
-								span: 6,
-								label: '交货人',
-								prop: 'delivery',
-								component: 'by-input',
-								compConfig: {
-									attr: {
-										placeholder: '请输入交货人',
-										clearable: true
-									}
-								}
-							},
-						],
-						[
 							{
 								span: 6,
 								label: '交货时间',
@@ -204,12 +184,11 @@
 									type: 'datetime'
 								}
 							},
-						]
+						],
 					]
 				},
 				tool: {
 					tools: {
-						// export: true,
 						search: true,
 						refresh: true
 					},
@@ -246,19 +225,14 @@
 							isDetail: true,
 						},
 						{
-							width: 180,
+							// width: 180,
 							title: '单据编号',
 							field: 'orderNumber',
 						},
 						{
-							width: 200,
-							title: '交货地点',
-							field: 'deliveryAddress',
-						},
-						{
-							width: 150,
-							title: '交货时间',
-							field: 'deliveryData',
+							// width: 180,
+							title: '退单编号',
+							field: 'chargebackNo',
 						},
 						{
 							title: '交货人',
@@ -266,16 +240,20 @@
 						},
 						{
 							width: 120,
-							title: '交货人联系方式',
+							title: '联系方式',
 							field: 'deliveryPhone',
 						},
 						{
-							title: '交货方式',
-							field: 'deliveryWay',
+							title: '交货时间',
+							field: 'deliveryData',
+						},
+						{
+							title: '交货地点',
+							field: 'deliveryAddress',
 						},
 						{
-							title: '备注',
-							field: 'remark',
+							title: '交货方式',
+							field: 'deliveryWay',
 						},
 						{
 							width: 110,