浏览代码

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

ymy 2 年之前
父节点
当前提交
74e4504b88

+ 1 - 1
src/benyun/components/byBill/byBill.vue

@@ -264,7 +264,7 @@ export default class ByBill extends VueViews {
   getTableSelectData(n:string){
     let d:Array<any> = [];
     if(this.$refs[n]){
-      d = (this.$refs[n] as any).getTableValue()
+      d = (this.$refs[n] as any).getSelectTable()
     }  
     return d;
   }

+ 10 - 11
src/views/audit/Information/index.vue

@@ -9,13 +9,13 @@
 				<div class="left-field">机构负责人:</div>
 				<div class="right-field">{{baseInfo.contacts}}</div>
 			</div>
-			<div class="field-box">
+			<!-- 			<div class="field-box">
 				<div class="left-field">供应商id:</div>
 				<div class="right-field">{{baseInfo.id}}</div>
-			</div>
+			</div> -->
 			<!-- <div class="field-box">
 				<div class="left-field">分销商id:</div>
-				<div class="right-field">{{baseInfo.name}}</div>
+				<div class="right-field">{{baseInfo.id}}</div>
 			</div> -->
 			<div class="field-box">
 				<div class="left-field">联系电话:</div>
@@ -29,10 +29,10 @@
 				<div class="left-field">电子邮箱:</div>
 				<div class="right-field">{{baseInfo.email}}</div>
 			</div>
-			<div class="field-box">
+<!-- 			<div class="field-box">
 				<div class="left-field">类型(字典):</div>
 				<div class="right-field">{{baseInfo.type}}</div>
-			</div>
+			</div> -->
 			<div class="field-box">
 				<div class="left-field">状态:</div>
 				<div class="right-field" style="padding: 0 10px 10px;">
@@ -52,12 +52,11 @@
 				<div class="left-field">纳税人识别号:</div>
 				<div class="right-field">{{baseInfo.taxnum}}</div>
 			</div>
-			<div class="field-box">
-				<div class="left-field">备注:</div>
-				<div class="right-field">{{baseInfo.remark}}</div>
-			</div>
 		</div>
-
+		<div class="field-box" style="width: 100%;">
+			<div class="left-field">备注:</div>
+			<div class="right-field">{{baseInfo.remark}}</div>
+		</div>
 	</div>
 </template>
 
@@ -93,7 +92,7 @@
 	.information {
 		width: 1200px;
 		min-width: 1200px;
-		margin: 100px auto;
+		margin: 100px auto 0;
 	}
 
 	.field-box {

+ 5 - 15
src/views/audit/order/index.vue

@@ -125,20 +125,6 @@
 									}
 								}
 							},
-							{
-								span: 6,
-								label: '交货地点',
-								prop: 'deliveryAddress',
-								component: 'by-input',
-								compConfig: {
-									attr: {
-										placeholder: '请输入交货地点',
-										clearable: true
-									}
-								}
-							},
-						],
-						[
 							{
 								span: 6,
 								label: '交货人',
@@ -170,6 +156,8 @@
 									}
 								}
 							},
+						],
+						[
 							{
 								span: 6,
 								label: '交货时间',
@@ -259,8 +247,10 @@
 							}, {
 								name: '接单',
 								event: {
+									show:(item:any)=>{
+										return item.status === 0
+									},
 									click: (item : any) => {
-										// console.log(Assembly);
 										(this as any).getOrder(item)
 									}
 								}

+ 196 - 134
src/views/audit/orderTask/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<div>
-		<by-bill :propConfig="config" @search="search" @onSmt="doSave" ref="bill" @onAdd="onAdd" @onOrder="onOrder"
-			@resert="resert" @clickHandle="clickHandle" @detail="openEdit" @clickTab="clickTab">
+		<by-bill ref="bill" :propConfig="config" @search="search" @onSmt="onSmt" @onAdd="onAdd" @onDelete="onDelete"
+			@onDispatch="onDispatch" @onRefresh="onRefresh" @detail="openEdit" @onSave="onSave" @clickTab="clickTab">
 		</by-bill>
 	</div>
 </template>
@@ -26,7 +26,6 @@
 				tool: {
 					tools: {
 						save: true,
-						smt: true,
 					}
 				},
 				form: {
@@ -53,21 +52,18 @@
 							{
 								span: 8,
 								label: '单据编号',
-								slot: true,
 								prop: 'orderNumber',
 								component: 'by-input',
 							},
 							{
 								span: 8,
 								label: '交货地点',
-								slot: true,
 								prop: 'deliveryAddress',
 								component: 'by-input',
 							},
 							{
 								span: 8,
 								label: '交货时间',
-								slot: true,
 								prop: 'deliveryData',
 								component: 'by-date-picker',
 								compConfig: {
@@ -78,21 +74,18 @@
 							{
 								span: 8,
 								label: '交货人',
-								slot: true,
 								prop: 'delivery',
 								component: 'by-input',
 							},
 							{
 								span: 8,
 								label: '联系方式',
-								slot: true,
 								prop: 'deliveryPhone',
 								component: 'by-input',
 							},
 							{
 								span: 8,
 								label: '交货方式',
-								slot: true,
 								prop: 'deliveryWay',
 								component: 'by-input',
 							},
@@ -105,7 +98,110 @@
 							},
 						],
 					]
-				}
+				},
+				tableConfig: [
+					{
+						tool: {
+							tools: {
+								add: true
+							}
+						},
+						table: {
+							attr: {
+								size: 'mini',
+								height: 580,
+								align: 'center',
+								// seq: true,
+								// checkbox: true
+							},
+							columns:
+								[{
+									width: 300,
+									title: '物料名称',
+									field: 'materialName',
+									component: 'by-input'
+								},
+								{
+									title: '单位',
+									field: 'unit',
+									component: 'by-input'
+								},
+								{
+									title: '数量',
+									field: 'number',
+									component: 'by-input'
+								},
+								{
+									title: '已交付数量',
+									field: 'deliveryNumber',
+									component: 'by-input'
+								},
+								{
+									title: '规格',
+									field: 'specs',
+									component: 'by-input'
+								},
+								{
+									title: '单价',
+									field: 'unitPrice',
+									component: 'by-input'
+								},
+								{
+									title: '实际金额',
+									field: 'realityPrice',
+									component: 'by-input'
+								},
+								{
+									title: '优惠金额',
+									field: 'prePrice',
+									component: 'by-input'
+								},
+								{
+									title: '合计金额',
+									field: 'totalPrice',
+									component: 'by-input'
+								},
+								{
+									width: 80,
+									title: '操作',
+									action: true,
+									plugins: [{
+										icon: 'el-icon-delete',
+										name: '删除',
+										audit: '',
+										event: {
+											click: (item : any) => {
+												console.log('该行数据:', item)
+												item.isDeleted = 1;
+												this.$confirm('确定删除吗', '注意', {
+													confirmButtonText: '确定',
+													cancelButtonText: '取消',
+													type: 'warning',
+													center: true
+												}).then(() => {
+													// api.deleteList({ ids: item.id }, 'supplyTaskOrder').then((res : any) => {
+													// 	if (res.code === 200) {
+													// 		this.getDataList();
+													// 		this.$message({
+													// 			type: 'success',
+													// 			message: '删除成功!'
+													// 		});
+													// 	} else this.failHandle(res)
+													// })
+												}).catch(() => {
+													this.$message({
+														type: 'info',
+														message: '已取消删除'
+													});
+												});
+											}
+										}
+									}]
+								},
+								]
+						}
+					}
+				]
 			},
 			// 已提交
 			smt: {
@@ -139,20 +235,6 @@
 									}
 								}
 							},
-							{
-								span: 6,
-								label: '交货地点',
-								prop: 'deliveryAddress',
-								component: 'by-input',
-								compConfig: {
-									attr: {
-										placeholder: '请输入交货地点',
-										clearable: true
-									}
-								}
-							},
-						],
-						[
 							{
 								span: 6,
 								label: '交货人',
@@ -184,6 +266,8 @@
 									}
 								}
 							},
+						],
+						[
 							{
 								span: 6,
 								label: '交货时间',
@@ -199,7 +283,6 @@
 				},
 				tool: {
 					tools: {
-						export: true,
 						delete: true,
 						search: true,
 						refresh: true
@@ -312,20 +395,6 @@
 									}
 								}
 							},
-							{
-								span: 6,
-								label: '交货地点',
-								prop: 'deliveryAddress',
-								component: 'by-input',
-								compConfig: {
-									attr: {
-										placeholder: '请输入交货地点',
-										clearable: true
-									}
-								}
-							},
-						],
-						[
 							{
 								span: 6,
 								label: '交货人',
@@ -348,13 +417,12 @@
 									type: 'datetime'
 								}
 							},
-						]
+						],
 					]
 				},
 				tool: {
 					tools: {
 						smt: true,
-						export: true,
 						delete: true,
 						search: true,
 						refresh: true
@@ -461,20 +529,6 @@
 									}
 								}
 							},
-							{
-								span: 6,
-								label: '交货地点',
-								prop: 'deliveryAddress',
-								component: 'by-input',
-								compConfig: {
-									attr: {
-										placeholder: '请输入交货地点',
-										clearable: true
-									}
-								}
-							},
-						],
-						[
 							{
 								span: 6,
 								label: '交货人',
@@ -506,6 +560,8 @@
 									}
 								}
 							},
+						],
+						[
 							{
 								span: 6,
 								label: '交货时间',
@@ -523,7 +579,6 @@
 					tools: {
 						add: true,
 						dispatch: true,
-						export: true,
 						delete: true,
 						search: true,
 						refresh: true
@@ -636,20 +691,6 @@
 									}
 								}
 							},
-							{
-								span: 6,
-								label: '交货地点',
-								prop: 'deliveryAddress',
-								component: 'by-input',
-								compConfig: {
-									attr: {
-										placeholder: '请输入交货地点',
-										clearable: true
-									}
-								}
-							},
-						],
-						[
 							{
 								span: 6,
 								label: '交货人',
@@ -681,6 +722,8 @@
 									}
 								}
 							},
+						],
+						[
 							{
 								span: 6,
 								label: '交货时间',
@@ -694,6 +737,12 @@
 						]
 					]
 				},
+				tool: {
+					tools: {
+						search: true,
+						refresh: true
+					}
+				},
 				table: {
 					attr: {
 						height: 600,
@@ -771,13 +820,71 @@
 				this.getDataList()
 			}, 500)
 		}
-		// 工具栏方法
-		clickHandle(e : any) {
-			console.log(e);
+		// 保存
+		onSave(e : any) {
+			console.log('保存 ==>', e);
+			if(e==='bill'){
+				(this as any).$refs.bill.$refs.billForm.validate().then(() => {
+					let query = (this.$refs.bill as any).getBillFormValue(); // 获取单据数据
+					query.suborderList.unshift({materialName:'test'})
+					console.log(query);
+					api.updateList(query, 'supplyTaskOrder').then((res : any) => {
+						if (res.code === 200) {
+							this.$message.success(res.msg);
+							this.getDataList();
+							(this.$refs.bill as any).showTab = 'all';
+							(this.$refs.bill as any).setBillFormValue({});
+						} else this.failHandle(res)
+					})
+				})
+			}
+		}
+		// 打开新增
+		onAdd(e : any) {
+			console.log('新增 ==>', e);
+			if(e==='billTable_0'){
+				let data = (this.$refs.bill as any).getBillFormValue();
+				data.suborderList.unshift({isDeleted:0,taskOrderId:data.id})
+				console.log(data);
+				(this.$refs.bill as any).setBillTableValue(data, 0);// 设置第1张单据表格数据
+			}
+			// (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.$refs.bill as any).setBillFormValue(e); // 设置单据表单数据
+			(this.$refs.bill as any).setBillTableValue(e.suborderList, 0);// 设置第1张单据表格数据
+			(this.$refs.bill as any).showTab = 'bill';
+		}
+		// 派单
+		onDispatch(e : any) {
+			console.log('派单 ==>', e);
+		}
+		// 提交
+		onSmt(e : any) {
+			console.log('提交 ==>', e);
+			// (this as any).$refs.bill.$refs.billForm.validate().then(() => {
+			// 	let query = (this as any).$refs.bill.$refs.billForm.getValue();
+			// 	api.saveList(query, 'supplyTaskOrder').then((res : any) => {
+			// 		if (res.code === 200) {
+			// 			this.$message({
+			// 				type: 'success',
+			// 				message: '提交成功!'
+			// 			});
+			// 			this.getDataList();
+			// 			(this.$refs.bill as any).showTab = 'all';
+			// 			(this.$refs.bill as any).setBillFormValue({});
+			// 		} else this.failHandle(res)
+			// 	})
+			// })
 		}
 		// 切换tab栏
 		clickTab(e : any) {
-			console.log(e);
+			// console.log(e);
+			// submitState: 提交状态
 			if (e === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
 			if (e === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
 			if (e === 'recycleBin') { // 回收站数据
@@ -790,41 +897,7 @@
 				this.getSelectDeleteList('supplyTaskOrder')
 			}
 		}
-		// 保存新增
-		doSave() {
-			// (this.$refs.product as any).setShow(true)
-			(this as any).$refs.bill.$refs.billForm.validate().then(() => {
-				let query = (this as any).$refs.bill.$refs.billForm.getValue();
-				// query.suborderList = [] // 子表单数据
-				query.status = 0; // 默认未接单
-				api.saveList(query, 'supplyTaskOrder').then((res : any) => {
-					if (res.code === 200) {
-						this.$message({
-							type: 'success',
-							message: '提交成功!'
-						});
-						this.getDataList();
-						(this.$refs.bill as any).showTab = 'all';
-						(this.$refs.bill as any).setBillFormValue({});
-					} else this.failHandle(res)
-				})
-			})
-		}
-		// 保存修改
-		orderTaking() {
-			let query : any = (this as any).$refs.bill.$refs.billForm.getValue();
-			api.updateList(query, 'supplyTaskOrder').then((res : any) => {
-				if (res.code === 200) {
-					this.$message({
-						type: 'success',
-						message: '保存成功!'
-					});
-					this.getDataList();
-					(this.$refs.bill as any).showTab = 'all';
-					(this.$refs.bill as any).setBillFormValue({});
-				} else this.failHandle(res)
-			})
-		}
+		// 初始化
 		getDataList() {
 			if (!this.$refs.bill) {
 				if (this.timeNum > 5) {
@@ -834,7 +907,6 @@
 				return
 			}
 			clearInterval(this.timer)
-			// submitState: 提交状态
 			this.getPageList({}, 'all'); // 综合数据
 		}
 		// 获取分页数据
@@ -865,31 +937,28 @@
 				} else this.failHandle(res)
 			});
 		}
-		// 打开新增
-		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 = '编辑';
-			(this.$refs.bill as any).setBillFormValue(e); // 设置单据表单数据
-			(this.$refs.bill as any).showTab = 'bill';
-		}
 		// 搜索
 		search(parames : any) {
+			console.log('搜索 ==> ', parames);
 			let query = parames.value
 			if (parames.type === 'draftsBox') query.submitState = 0 // 草稿箱数据
 			if (parames.type === 'smt') query.submitState = 1 // 草稿箱数据
+			// if (parames.type === 'recycleBin')  // 回收站
 			this.getPageList(query, parames.type) // 获取分页数据
 		}
+		// 刷新
+		onRefresh(e : any) {
+			console.log('刷新 ==>', e);
+			(this as any).$refs.bill.$refs[e].resert();
+			if (e === 'all') this.getPageList({}, 'all'); // 草稿箱数据
+			if (e === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
+			if (e === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
+			if (e === 'recycleBin') this.getSelectDeleteList('supplyTaskOrder') // 回收站数据
+		}
 		// 工具栏删除
-		onDelete() {
-			let selectData = (this.$refs.bill as any).getSelectData()
+		onDelete(e:any) {
+			console.log('工具栏删除 ==> ',e);
+			let selectData = (this.$refs.bill as any).getTableSelectData(e)
 			let ids = '';
 			if (selectData.length > 0) {
 				selectData.map((v : any) => {
@@ -943,13 +1012,6 @@
 				});
 			});
 		}
-		resert(parames : any) {
-			console.log('重置回传参数', parames);
-		}
-		// 工具栏接单
-		onOrder(n : string) {
-			console.log(n + ':工具栏执行操作onOrder')
-		}
 		// 运行错误
 		failHandle(err : any) {
 			let msg = err.msg ? err.msg : '运行错误!';

+ 65 - 19
src/views/audit/saleOrder/index.vue

@@ -2,6 +2,11 @@
 	<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>
@@ -13,9 +18,10 @@
 	export default class OrderTask extends Vue {
 		timeNum = 0;
 		timer : any = null
+		textarea='123'
 		config : any = {
 			attr: {
-				activeName: 'all'
+				activeName: 'bill'
 			},
 			// 单据
 			bill: {
@@ -41,32 +47,40 @@
 								label: '机构名称',
 								prop: 'organizationName',
 								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入机构名称',
+										clearable: true
+									}
+								}
 							},
 							{
 								span: 8,
 								label: '单据编号',
-								slot: true,
 								prop: 'orderNumber',
 								component: 'by-input',
-							},
-							{
-								span: 8,
-								label: '机构',
-								slot: true,
-								prop: 'organizationId',
-								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入单据编号',
+										clearable: true
+									}
+								}
 							},
 							{
 								span: 8,
 								label: '交货地点',
-								slot: true,
 								prop: 'deliveryAddress',
 								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入交货地点',
+										clearable: true
+									}
+								}
 							},
 							{
 								span: 8,
 								label: '交货时间',
-								slot: true,
 								prop: 'deliveryData',
 								component: 'by-date-picker',
 								compConfig: {
@@ -77,32 +91,48 @@
 							{
 								span: 8,
 								label: '交货人',
-								slot: true,
 								prop: 'delivery',
 								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入交货人',
+										clearable: true
+									}
+								}
 							},
 							{
 								span: 8,
 								label: '联系方式',
-								slot: true,
 								prop: 'deliveryPhone',
 								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入联系方式',
+										clearable: true
+									}
+								}
 							},
 							{
 								span: 8,
 								label: '交货方式',
-								slot: true,
 								prop: 'deliveryWay',
 								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入交货方式',
+										clearable: true
+									}
+								}
 							},
+						],
+						[
 							{
-								span: 8,
+								span: 30,
 								label: '备注',
 								slot: true,
 								prop: 'remark',
-								component: 'by-input',
-							},
-						],
+							}
+						]
 					]
 				}
 			},
@@ -183,6 +213,22 @@
 						search: true,
 						refresh: true
 					},
+					customTools: [
+						{
+							name: '入库', icon: 'el-icon-plus', audit: [''], event: {
+								click: () => {
+									// (this as any).orderTaking()
+								}
+							}
+						},
+						{
+							name: '退单', icon: 'el-icon-top', audit: [''], event: {
+								click: () => {
+									// (this as any).orderTaking()
+								}
+							}
+						}
+					]
 				},
 				table: {
 					attr: {
@@ -330,7 +376,7 @@
 			})
 		}
 		// 回收站数据
-		getSelectDeleteList(url:any){
+		getSelectDeleteList(url : any) {
 			api.selectDeleteList(url).then((res : any) => {
 				if (res.code === 200) {
 					(this.$refs.bill as any).setTabTableValue('recycleBin', res.data);

+ 2 - 1
src/views/demo/table.vue

@@ -31,7 +31,8 @@ export default class DemoTable extends Vue {
       title:'姓名',
       field:'name',
       isDetail:true,
-      width:100
+      width:100,
+			component:'by-input'
     },
     {
       title:'日期',