浏览代码

5.20合并

AlanWong 2 年之前
父节点
当前提交
e78431adee

+ 6 - 5
src/benyun/compVue/ModuleViewHandle.ts

@@ -104,11 +104,12 @@ export default class ModuleViewHandle extends VueViews{
   // }
 
   //刷新
-  onRefresh(){
-    // (this.$refs[this.tableID] as any).setPage({pageNo:1,total:0})
-    // this.getList();
-		this.$emit('onRefresh')
-  }
+  // onRefresh(){
+		// (this.$refs[this.searchID] as any).setValue({});
+  //   (this.$refs[this.tableID] as any).setPage({pageNo:1,total:0})
+  //   // this.getList();
+		// this.$emit('onRefresh')
+  // }
 
   //搜索
   searchHandle(){

+ 4 - 3
src/views/audit/attribute/index.vue

@@ -2,7 +2,7 @@
 	<div class="my-container">
 		<div class="bill-main">
 			<module-view :propConfig="config" ref="moduleView" @pagination="getDataList" @search="getDataList"
-				@resert="getDataList" @clickHandle="clickHandle" @detail="openEdit">
+				@resert="getDataList" @clickHandle="clickHandle" @detail="openEdit" @onRefresh="getDataList">
 			</module-view>
 		</div>
 		<!-- 新增/编辑弹窗 -->
@@ -221,7 +221,7 @@
 						labelWidth: '80px',
 						label: '属性类型',
 						slot: true,
-						prop: 'attributeType',
+						prop: 'attributeTypeName',
 						component: 'by-select',
 						compConfig: {
 							attr: {
@@ -361,7 +361,8 @@
 			this.popTitle = '编辑'
 			this.dialogFormVisible = true;
 			this.radio = e.status
-			this.tableConfig = JSON.parse(e.attributeValue)
+			this.tableConfig = JSON.parse(e.attributeValue);
+			e.attributeTypeName = e.attributeType === 0 ? '销售属性' : '基本属性';
 			setTimeout(() => {
 				console.log('编辑 ==> ', e);
 				if ((this as any).$refs.addFormId) (this as any).$refs.addFormId.setValue(e);

+ 6 - 3
src/views/audit/brand/index.vue

@@ -2,7 +2,7 @@
 	<div class="my-container">
 		<div class="bill-main">
 			<module-view :propConfig="config" ref="moduleView" @pagination="getDataList" @search="getDataList"
-				@resert="getDataList" @clickHandle="clickHandle" @detail="openEdit">
+				@resert="getDataList" @clickHandle="clickHandle" @detail="openEdit" @onRefresh="getDataList">
 			</module-view>
 		</div>
 		<!-- 新增/编辑弹窗 -->
@@ -108,10 +108,12 @@
 					field: 'name',
 					isDetail: true,
 					width: 300,
+					// align: 'left'
 				}, {
 					title: '简称',
 					field: 'shortName',
-					width: 300
+					width: 300,
+					// align: 'left'
 				},
 				{
 					width: 80,
@@ -120,7 +122,8 @@
 					component: Assembly,
 				}, {
 					title: '备注',
-					field: 'remark'
+					field: 'remark',
+					// align: 'left'
 				}, {
 					width: 120,
 					title: '操作',

+ 100 - 76
src/views/audit/orderTask/index.vue

@@ -17,6 +17,7 @@
 	export default class OrderTask extends Vue {
 		// 左边
 		tabType : any = 'all';
+		isAdd : any = false
 		// 右边
 		tableData : any = []
 		mergeObj : any = []
@@ -147,7 +148,8 @@
 									compConfig: {
 										attr: {
 											size: 'mini',
-											type: 'number'
+											type: 'number',
+											defaultValue: 1,
 										},
 									}
 								},
@@ -180,8 +182,8 @@
 									compConfig: {
 										attr: {
 											size: 'mini',
-											defaultValue: '0',
-											type: 'number'
+											type: 'number',
+											defaultValue: 0,
 										},
 									}
 								},
@@ -437,17 +439,23 @@
 						checkbox: true
 					},
 					columns: [
-						{
-							width: 70,
-							title: '单据编号',
-							field: 'orderNumber',
-						},
 						{
 							width: 200,
 							title: '机构名称',
 							field: 'organizationName',
 							isDetail: true,
 						},
+						{
+							width: 150,
+							title: '单据编号',
+							field: 'orderNumber',
+						},
+						{
+							width: 80,
+							title: '状态',
+							field: 'status',
+							component: Assembly,
+						},
 						{
 							width: 200,
 							title: '交货地点',
@@ -459,21 +467,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: '操作',
@@ -483,8 +490,8 @@
 								name: '编辑',
 								audit: '',
 								event: {
-									click: (item : any) => {
-										(this as any).openEdit(item)
+									click: (e : any) => {
+										(this as any).openEdit(e)
 									}
 								}
 							}, {
@@ -586,7 +593,7 @@
 							isDetail: true,
 						},
 						{
-							width: 120,
+							width: 150,
 							title: '单据编号',
 							field: 'orderNumber',
 						},
@@ -607,21 +614,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: '操作',
@@ -631,8 +637,8 @@
 								name: '编辑',
 								audit: '',
 								event: {
-									click: (item : any) => {
-										(this as any).openEdit(item)
+									click: (e : any) => {
+										(this as any).openEdit(e)
 									}
 								}
 							}, {
@@ -724,17 +730,17 @@
 						checkbox: true
 					},
 					columns: [
-						{
-							width: 70,
-							title: '单据编号',
-							field: 'orderNumber',
-						},
 						{
 							width: 200,
 							title: '机构名称',
 							field: 'organizationName',
 							isDetail: true,
 						},
+						{
+							width: 150,
+							title: '单据编号',
+							field: 'orderNumber',
+						},
 						{
 							width: 80,
 							title: '状态',
@@ -752,21 +758,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: '操作',
@@ -800,22 +805,34 @@
 		// 保存
 		onSave(e : any) {
 			console.log('保存 ==>', this.tabType);
-			if (this.tabType === 'all' || this.tabType === 'draftsBox') {
-				(this as any).$refs.bill.$refs.billForm.validate().then(() => {
-					let query = (this.$refs.bill as any).getBillFormValue(); // 获取单据数据
-					// 子表数据
-					query.suborderList = this.tableData;
-					if (query.suborderList.length > 0) {
-						query.suborderList.map((v : any) => {
-							v.taskOrderId = query.id
-						})
-					};
-					// 表格删除
-					query.suborderList.map((v : any, i : any) => {
-						if (v.isDeleted !== 1 && !v.id) {
-							v.splice(i, 1)
-						}
-					});
+			(this as any).$refs.bill.$refs.billForm.validate().then(() => {
+				let query = (this.$refs.bill as any).getBillFormValue(); // 获取单据数据
+				// 子表数据
+				query.suborderList = this.tableData;
+				if (query.suborderList.length > 0) {
+					query.suborderList.map((v : any) => {
+						v.taskOrderId = query.id
+					})
+				};
+				// 表格删除
+				query.suborderList.map((v : any, i : any) => {
+					if (v.isDeleted === 1 && !v.id) {
+						v.splice(i, 1)
+					}
+				});
+				if (this.isAdd) {
+					query.submitState = 0
+					console.log('保存进草稿箱 ==>', query);
+					api.saveList(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.$message.error(res.msg);
+					})
+				} else if (this.tabType === 'all' || this.tabType === 'draftsBox') {
+
 					if (this.tabType === 'draftsBox') query.submitState = 0;
 					console.log('保存 ==>', query);
 					api.updateList(query, 'supplyTaskOrder').then((res : any) => {
@@ -826,8 +843,10 @@
 							(this.$refs.bill as any).setBillFormValue({});
 						} else this.$message.error(res.msg);
 					})
-				})
-			};
+
+				};
+			})
+
 		}
 		// 确定商品新增
 		confirmProduct(e : any) {
@@ -849,49 +868,65 @@
 					confirmButtonText: '确定',
 				});
 			};
+			console.log('this.tableData ==> ', this.tableData);
 			(this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
 		}
 		// 打开新增
 		onAdd(e : any) {
 			console.log('新增 ==>', e);
 			if (e === 'billTable_0') {
-				(this.$refs.product as any).setShow(true)
+				(this.$refs.product as any).setShow(true); // 打开sku弹窗
 				let obj = (this.$refs.bill as any).getBillFormValue();
-				// console.log('BillFormValue ==> ', obj);
 				if (!this.tableData) this.tableData = obj.suborderList;
+				console.log('this.tableData ==> ', this.tableData);
 				(this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
+			} else {
+				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 };
+				billConfig.tableConfig[0].tool.tools = { add: true };
+				this.isAdd = true;
+				(this.$refs.bill as any).setBillConfig(billConfig);
+				(this.$refs.bill as any).setBillFormValue({}); // 设置单据表单数据
 			};
-			if (e != 'billTable_0') (this.$refs.bill as any).setBillFormValue({}); // 设置单据表单数据
 			(this.$refs.bill as any).showTab = 'bill';
 		}
 		// 打开编辑
 		openEdit(e : any) {
-			console.log('编辑 ==>', e);
-			if (e.type === 'all' || e.type === 'draftsBox') {
+			console.log('编辑this.tabType ==>', this.tabType);
+			if (this.tabType === 'all' || this.tabType === 'draftsBox') {
 				e = e.row ? e.row : e;
+				console.log('编辑 ==>', e);
 				let data = e.suborderList
 				data.map((v : any, i : any) => {
 					v.dataIndex = i
 				});
 				let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
-				billConfig.form.attr.readonly = false; // 设置只
+				billConfig.form.attr.readonly = false; // 设置只读
 				billConfig.tool.tools = { save: true, };
 				billConfig.tableConfig[0].tool.tools = { add: true };
 				this.tableData = data;
 				(this.$refs.bill as any).setBillConfig(billConfig);
+				(this.$refs.bill as any).setBillFormValue(e);// 设置单据表单数据
 				(this.$refs.bill as any).setBillTableValue(data, 0);// 设置第1张单据表格数据
+				this.isAdd = false;
 				(this.$refs.bill as any).showTab = 'bill';
-			} else this.setReadonly(e.row ? e.row : e);
+			} 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; // 设置只
+			readonly.form.attr.readonly = true; // 设置只读
 			readonly.tool.tools = {};
 			readonly.tableConfig[0].tool.tools = {};
 			let data = e.suborderList;
 			(this.$refs.bill as any).setBillConfig(readonly);
+			(this.$refs.bill as any).setBillFormValue(e);// 设置单据表单数据
 			(this.$refs.bill as any).setBillTableValue(data, 0);// 设置第1张单据表格数据
+			this.isAdd = false;
 			(this.$refs.bill as any).showTab = 'bill';
 
 		}
@@ -968,18 +1003,17 @@
 		}
 		// 搜索
 		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')  // 回收站
+			if (parames.type === 'smt') query.submitState = 1 // 已提交数据
+			console.log('搜索 ==> ', query);
 			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 === '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') // 回收站数据
@@ -1028,24 +1062,14 @@
 				api.deleteList({ ids: ids }, 'supplyTaskOrder').then((res : any) => {
 					if (res.code === 200) {
 						this.getDataList();
-						this.$message({
-							type: 'success',
-							message: '删除成功!'
-						});
+						this.$message.success('删除成功!');
 					} else this.failHandle(res)
 				})
-			}).catch(() => {
-				this.$message({
-					type: 'info',
-					message: '已取消删除'
-				});
-			});
+			}).catch(() => this.$message.info('已取消删除'));
 		}
 		// 操作删除
 		doDelete2(item : any) {
-			if (this.tabType === '') {
-
-			};
+			// if (this.tabType === '') {// };
 			this.$confirm('确定删除吗,此操作不能撤销!', '注意', {
 				confirmButtonText: '确定',
 				cancelButtonText: '取消',

+ 1 - 1
src/views/audit/productClassification/index.vue

@@ -405,7 +405,7 @@
 		// 导航切换
 		handleNodeClick(e : any) {
 			this.parentId = e.id
-			api.childrenTreeList({ id: e.id }, 'maindataMaterialCategory').then((res : any) => {
+			api.childrenTreeList({ id: e.id, pageNo: 1, pageSize: 999 }, 'maindataMaterialCategory').then((res : any) => {
 				if (res.code === 200) {
 					(this.$refs.moduleView as any).setTableValue(res.data);
 					let page = {