Răsfoiți Sursa

同步财务编号

AlanWong 1 an în urmă
părinte
comite
cc5565c630

+ 2 - 1
src/views/audit/attribute/index.vue

@@ -151,11 +151,12 @@
 					checkbox: true,
 				},
 				columns: [{
-					width: 500,
+					width: 300,
 					title: '名称',
 					field: 'name',
 					isDetail: true,
 				}, {
+					width: 500,
 					title: '属性值',
 					field: 'attributeValue',
 					component: AttributeValue,

+ 45 - 38
src/views/audit/depots/index.vue

@@ -27,10 +27,10 @@
 								<el-button slot="append" icon="el-icon-more" @click="handleSupplier"></el-button>
 							</el-input>
 						</template>
-						<template v-slot:stock="{value}">
+						<!-- <template v-slot:stock="{value}">
 							<vxe-input v-if="isAdd" v-model="value.stock" style="width: 100%;" size="small" type="text"></vxe-input>
 							<span v-else>{{ value.stock }}</span>
-						</template>
+						</template> -->
 					</by-form>
 					<div slot="footer" class="dialog-footer">
 						<el-button @click="dialogFormVisible2 = false">取 消</el-button>
@@ -119,6 +119,10 @@
 					field: 'name',
 					isDetail: true,
 				}, 
+				{
+					title: '第三方仓库名称',
+					field: 'financeStorehouseName',
+				},
 				{
 					title: '第三方系统名称',
 					field: 'financeType',
@@ -127,10 +131,6 @@
 					title: '第三方仓库编码',
 					field: 'financeStorehouseNo',
 				},
-				{
-					title: '第三方仓库名称',
-					field: 'financeStorehouseName',
-				},
 				{
 					title: '地址',
 					field: 'address',
@@ -205,18 +205,18 @@
 								}
 							}
 						},
-						{
-							span: 6,
-							label: '库存',
-							prop: 'stock',
-							component: 'by-input',
-							compConfig: {
-								attr: {
-									placeholder: '请输入库存',
-									clearable: true
-								},
-							},
-						},
+						// {
+						// 	span: 6,
+						// 	label: '库存',
+						// 	prop: 'stock',
+						// 	component: 'by-input',
+						// 	compConfig: {
+						// 		attr: {
+						// 			placeholder: '请输入库存',
+						// 			clearable: true
+						// 		},
+						// 	},
+						// },
 						{
 							span: 6,
 							label: '库存体积',
@@ -304,11 +304,11 @@
 					title: '所属机构名称',
 					field: 'organizationName',
 				},
-				{
-					width: 150,
-					title: '库存',
-					field: 'stock'
-				},
+				// {
+				// 	width: 150,
+				// 	title: '库存',
+				// 	field: 'stock'
+				// },
 				{
 					width: 150,
 					title: '库存体积',
@@ -369,22 +369,22 @@
 					{
 						span: 23,
 						labelWidth: '110px',
-						label: '第三方系统名称',
-						prop: 'financeType',
+						label: '第三方仓库名称',
+						prop: 'financeStorehouseName',
 						component: 'by-input',
 					},
 					{
 						span: 23,
 						labelWidth: '110px',
-						label: '第三方仓库编码',
-						prop: 'financeStorehouseNo',
+						label: '第三方系统名称',
+						prop: 'financeType',
 						component: 'by-input',
 					},
 					{
 						span: 23,
 						labelWidth: '110px',
-						label: '第三方仓库名称',
-						prop: 'financeStorehouseName',
+						label: '第三方仓库编码',
+						prop: 'financeStorehouseNo',
 						component: 'by-input',
 					},
 					{
@@ -407,9 +407,16 @@
 					organizationName: [{
 						required: true, message: '请输入所属机构名称', trigger: 'blur'
 					}],
-					stock: [{
-						required: true, message: '请输入库存', trigger: 'blur'
+					stockVolume: [{
+						required: true, message: '请输入库存体积', trigger: 'blur'
+					}],
+					maxStockNumber: [{
+						required: true, message: '请输入库存数量上限', trigger: 'blur'
+					}],
+					maxStockVolume: [{
+						required: true, message: '请输入库存体积上限', trigger: 'blur'
 					}]
+					
 				}
 			},
 			columns: [
@@ -428,13 +435,13 @@
 						prop: 'organizationName',
 						slot: true,
 					},
-					{
-						labelWidth: '110px',
-						span: 23,
-						label: '库存',
-						prop: 'stock',
-						slot: true
-					},
+					// {
+					// 	labelWidth: '110px',
+					// 	span: 23,
+					// 	label: '库存',
+					// 	prop: 'stock',
+					// 	slot: true
+					// },
 					{
 						labelWidth: '110px',
 						span: 23,

+ 0 - 12
src/views/audit/order/index.vue

@@ -197,18 +197,6 @@
 									}
 								}
 							},
-							{
-								span: 6,
-								label: '交货时间',
-								prop: 'deliveryData',
-								component: 'by-date-picker',
-								compConfig: {
-									attr: {
-										format: 'yyyy-MM-dd hh:ss:mm',
-										type: 'datetime',
-									},
-								}
-							},
 							{
 								span: 6,
 								label: '状态',

+ 1 - 49
src/views/audit/orderTask/index.vue

@@ -272,18 +272,6 @@
 									},
 								},
 							},
-							{
-								span: 6,
-								label: '交货时间',
-								prop: 'deliveryData',
-								component: 'by-date-picker',
-								compConfig: {
-									attr: {
-										format: 'yyyy-MM-dd hh:ss:mm',
-										type: 'datetime',
-									},
-								}
-							},
 							{
 								span: 6,
 								label: '状态',
@@ -426,18 +414,6 @@
 									},
 								},
 							},
-							{
-								span: 6,
-								label: '交货时间',
-								prop: 'deliveryData',
-								component: 'by-date-picker',
-								compConfig: {
-									attr: {
-										format: 'yyyy-MM-dd hh:ss:mm',
-										type: 'datetime',
-									},
-								}
-							},
 							{
 								span: 6,
 								label: '状态',
@@ -579,18 +555,6 @@
 									},
 								},
 							},
-							{
-								span: 6,
-								label: '交货时间',
-								prop: 'deliveryData',
-								component: 'by-date-picker',
-								compConfig: {
-									attr: {
-										format: 'yyyy-MM-dd hh:ss:mm',
-										type: 'datetime',
-									},
-								}
-							},
 							{
 								span: 6,
 								label: '状态',
@@ -750,18 +714,6 @@
 									},
 								},
 							},
-							{
-								span: 6,
-								label: '交货时间',
-								prop: 'deliveryData',
-								component: 'by-date-picker',
-								compConfig: {
-									attr: {
-										format: 'yyyy-MM-dd hh:ss:mm',
-										type: 'datetime',
-									},
-								}
-							},
 							{
 								span: 6,
 								label: '状态',
@@ -1054,8 +1006,8 @@
 						type: 'warning',
 						center: true
 					}).then(() => {
-						let loading = this.$loading({ target: '.main-container' });
 						let id = this.dataId ? this.dataId : this.baseInfo.id;
+						let loading = this.$loading({ target: '.main-container' });
 						api.submitTo({ id: id }, 'supplyTaskOrder').then((res : any) => {
 							loading.close();
 							if (res.code === 200) {

+ 0 - 172
src/views/audit/outbound/components/productModal.vue

@@ -1,172 +0,0 @@
-<template>
-	<vxe-modal v-model="value" id="productDialogModal" :width="width?width+'px':'80%'" @show="show"
-		:height="height?height+'px':'80%'" min-width="500" min-height="400" show-zoom resize transfer show-footer
-		@confirm="confirm">
-		<template #title>
-			<span>选择商品</span>
-		</template>
-		<template #default>
-			<module-view :propConfig="config" ref="view" @pagination="getList" @search="getList" @resert="getList"
-				@clickHandle="clickHandle" />
-		</template>
-	</vxe-modal>
-</template>
-
-<script lang="ts">
-	import { Component, Prop, Vue, Watch } from "vue-property-decorator";
-	@Component
-	export default class ProductModal extends Vue {
-		value = false
-		time : any;
-		timeNum = 0;
-		data : Array<any> = []
-
-		@Prop()
-		width ?: number
-
-		@Prop()
-		height ?: number
-
-		@Prop()
-		mulit ?: boolean
-
-		config : any = {
-			search: {
-				attr: {
-					size: 'mini'
-				},
-				columns: [
-					[{
-						span: 6,
-						label: '标题',
-						prop: 'skuTitle',
-						component: 'by-input',
-						compConfig: {
-							attr: {
-								clearable: true,
-								placeholder: '请输入名称'
-							}
-						}
-					}]
-				]
-			},
-			tool: {
-				tools: {
-					search: true,
-					refresh: true
-				}
-			},
-			table: {
-				attr: {
-					size: 'mini',
-					seq: true,
-					align: 'center',
-					checkbox:true,
-					pageSize: 10
-				},
-				columns:
-					[
-						{
-							title: '标题',
-							field: 'skuTitle',
-							// width: 150
-						},
-						{
-							title: '副标题',
-							field: 'skuSubtitle',
-							// width: 150
-						},
-						{
-							title: '规格',
-							field: 'materialSpec'
-						},
-						{
-							title: '单位',
-							field: 'unit'
-						},
-						{
-							title: '单价',
-							field: 'price'
-						},
-					]
-			},
-			// request:{
-			//   url:'/system/maindataMaterial/page'
-			// }
-		}
-		brandData : Array<any> = []
-
-		getBrandData() {
-			return this.brandData;
-		}
-
-		clickHandle(n : string) {
-			if (n == 'onRefresh') {
-				this.getList()
-			}
-		}
-
-		setShow(v : boolean) {
-			this.value = v;
-		}
-
-		mounted() { }
-
-		//确定
-		confirm() {
-			let data : Array<any> = this.getSelectdata();
-			this.$emit('confirm', data);
-			this.value = false;
-		}
-		//获取已选中表格数据
-		getSelectdata() {
-			let data : Array<any> = [];
-			if (this.$refs.view) {
-				data = (this.$refs.view as any).getSelectData()
-			}
-			return data;
-		}
-		//显示弹窗
-		show() {
-			if (this.data.length == 0) {
-				this.time = setInterval(() => {
-					this.getList()
-				}, 500)
-			}
-			if (this.$refs.view) {
-				(this.$refs.view as any).clearCheckboxRow();
-			}
-		}
-		getList() {
-			if (!this.$refs.view) {
-				if (this.timeNum > 5) {
-					clearInterval(this.time)
-				}
-				this.timeNum++;
-				return
-			}
-			clearInterval(this.time)
-			let query : any = (this.$refs.view as any).getQuery();
-			query.isLikeSearch = '1';
-			(this as any).$request({
-				url: '/maindata/maindataMaterialSku/page',
-				method: 'get',
-				params: query
-			}).then((res : any) => {
-				if (res.data.records) {
-					(this.$refs.view as any).setTableValue(res.data.records);
-					this.data = res.data.records;
-					let page = {
-						pageNo: res.data.current, //当前页
-						pageSize: res.data.size, //每页条数
-						total: res.data.total //总条数
-					};
-					(this.$refs.view as any).setPage(page)
-				}
-			})
-		}
-	}
-</script>
-<style lang="scss" scoped>
-
-</style>

+ 58 - 64
src/views/audit/outbound/index.vue

@@ -4,18 +4,15 @@
 			@resert="resert" @detail="openEdit" @onSave="onSave" @clickTab="clickTab" @onChangeRow="onChangeRow"
 			@pagination="pagination" @onReturnSmt="onReturnSmt2" @getSupplierModal="getSupplierModal">
 		</by-bill>
-		<!-- 选择物料 -->
-		<productModal ref="product" :mulit="true" @confirm="confirmProduct" />
 	</div>
 </template>
 
 <script lang="ts">
 	import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 	import api from "@/api/order";
-	import productModal from "../orderTask/components/productModal.vue";
 	import BusinessType from "./components/businessType.vue";
 	import towInOne from "../warehousing/components/towInOne.vue";
-	@Component({ components: { productModal } })
+	@Component
 	export default class OrderTask extends Vue {
 		// 左边
 		tabType : any = 'all';
@@ -188,8 +185,8 @@
 							},
 							{
 								span: 8,
-								label: 'WMS编号',
-								prop: 'wmsId',
+								label: '财务编号',
+								prop: 'financeOrderId',
 								component: 'by-input',
 								compConfig: {
 									attr: {
@@ -203,6 +200,17 @@
 								prop: 'businessType',
 								component: BusinessType,
 							},
+							{
+								span: 8,
+								label: 'WMS编号',
+								prop: 'wmsId',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										readonly: true,
+									},
+								}
+							},
 						],
 						[
 							{
@@ -577,7 +585,14 @@
 									(this as any).onDelete('all')
 								}
 							}
-						}
+						},
+						{
+							name: '同步到财务系统', icon: 'el-icon-top', audit: [''], event: {
+								click: () => {
+									(this as any).syncSystem()
+								}
+							}
+						},
 					]
 				},
 				table: {
@@ -755,24 +770,25 @@
 			}, 500)
 		}
 		// 引单
-		citationOrder(e : any) {
+		citationOrder() {
 			let parentData : any = (this as any).$refs.bill.getSourceTableSelectData(0);
 			if (parentData.length <= 0) return this.$message.warning('请选择引单数据');
 			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) => {
+					console.log(parentData);
+					parentData = parentData.map((item : any) => {
 						item.receiveAddress = item.address
 						item.receive = item.consignee
 						item.receivePhone = item.phone
-						item.outOrderNo = item.orderNumber
-						const { ...newData } = item
+						const { financeOrderId, ...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;
+						console.log(v.deliveryNumber);
 						if (v.deliveryNumber < v.number) v.number = v.deliveryNumber;
 					});
 					this.tableData = parentData[0].suborderList;
@@ -803,13 +819,37 @@
 			e.totalPrice = e.realityPrice - e.prePrice;
 
 		}
+		// 同步出库单到财务系统
+		syncSystem() {
+			let selectData = (this as any).$refs.bill.getTableSelectData('all');
+			if (selectData.length > 0) {
+				if (selectData.length > 1) return this.$message.warning('只能同步一条数据');
+				if (selectData[0].submitState != 1) return this.$message.warning('只能同步已提交数据');
+				this.$confirm('确定同步订单吗', '注意', {
+					confirmButtonText: '确定',
+					cancelButtonText: '取消',
+					type: 'warning',
+					center: true
+				}).then(() => {
+					let loading = this.$loading({ target: '.main-container' });
+					api.addOutStock({ ids: selectData[0].id }).then((res : any) => {
+						loading.close();
+						if (res.code === 200) {
+							this.$message.success('同步订单成功');
+							this.getDataList();
+							(this.$refs.bill as any).showTab = 'all';
+						} else this.$message.error(res.msg)
+					}).catch(() => loading.close());
+				}).catch(() => this.$message.info('已取消同步订单'));
+			} else this.$message.warning('请选择同步数据');
+		}
 		// 保存
 		onSave(e : any) {
 			console.log('保存 ==>', this.tabType);
 			(this as any).$refs.bill.$refs.billForm.validate().then(() => {
 				let query = (this.$refs.bill as any).getBillFormValue(); // 获取单据数据
 				// 子表数据
-				// query.suborderList = this.tableData;
+				console.log(query);
 				query.purchaseOrderId = query.id;
 				query.suborderList = (this.$refs.bill as any).getBillTableData(0);
 				if (query.suborderList.length > 0) {
@@ -827,6 +867,7 @@
 						query.suborderList.splice(i, 1)
 					}
 				});
+				query.financeOrderId = ""
 				console.log('出库参数query ==> ', query);
 
 				let loading = this.$loading({ target: '.main-container' });
@@ -883,13 +924,12 @@
 		}
 		// 打开编辑
 		openEdit(e : any) {
-			console.log('编辑this.tabType ==>', this.tabType);
-			console.log('编辑 ==>', e);
 			e = e.row ? e.row : e;
 			let loading = this.$loading({ target: '.main-container' });
 			api.single({ id: e.id }, 'supplyOutOrder').then((res : any) => {
 				if (res.code === 200) {
 					let parentData = res.data ? res.data : e;
+					console.log('编辑 ==>', parentData);
 					this.baseInfo = parentData;
 					if (this.tabType === 'all' || this.tabType === 'draftsBox') {
 						if (parentData.submitState === 1) {
@@ -926,16 +966,14 @@
 								skuid: v.materialSku,
 							})
 						});
-						console.log('array', array);
 						//  查库存
 						api.getInventoryByStoridsAndSkuids(array).then((res : any) => {
 							if (res.code === 200) {
-								console.log(res);
 								let newData : any = [];
 								res.data.map((v : any, i : any) => {
 									newData.push(Object.assign(data[i], v))
 								})
-								console.log('newData', newData);
+								// console.log('newData', newData);
 								this.tableData = newData;
 								(this.$refs.bill as any).setBillConfig(billConfig);
 								(this.$refs.bill as any).setBillFormValue(parentData);// 设置单据表单数据
@@ -972,7 +1010,6 @@
 					skuid: v.materialSku,
 				})
 			});
-			console.log('array', array);
 			//  查库存
 			api.getInventoryByStoridsAndSkuids(array).then((res : any) => {
 				loading.close();
@@ -981,7 +1018,6 @@
 					res.data.map((v : any, i : any) => {
 						newData.push(Object.assign(data[i], v))
 					})
-					console.log('newData', newData);
 					this.tableData = newData;
 					(this.$refs.bill as any).setBillConfig(readonly);
 					(this.$refs.bill as any).setBillFormValue(e);// 设置单据表单数据
@@ -1023,8 +1059,9 @@
 						type: 'warning',
 						center: true
 					}).then(() => {
+						let id = this.dataId ? this.dataId : this.baseInfo.id;
 						let loading = this.$loading({ target: '.main-container' });
-						api.submitTo({ id: this.baseInfo.id }, 'supplyOutOrder').then((res : any) => {
+						api.submitTo({ id: id }, 'supplyOutOrder').then((res : any) => {
 							loading.close();
 							if (res.code === 200) {
 								this.$message.success('提交成功');
@@ -1059,9 +1096,8 @@
 							type: 'warning',
 							center: true
 						}).then(() => {
-							let id = this.dataId ? this.dataId : this.baseInfo.id;
 							let loading = this.$loading({ target: '.main-container' });
-							api.submitTo({ id: id }, 'supplyOutOrder').then((res : any) => {
+							api.submitTo({ id: this.baseInfo.id }, 'supplyOutOrder').then((res : any) => {
 								loading.close();
 								if (res.code === 200) {
 									this.$message.success('提交成功');
@@ -1239,48 +1275,6 @@
 				if (data === 'recycleBin') this.getSelectDeleteList({}) // 回收站数据
 			}
 		}
-		// 确定商品新增
-		confirmProduct(e : any) {
-			let nowData = (this.$refs.bill as any).getBillTableData(0);
-			let names = '';
-			if (e.length > 0) {
-				for (const item of e) {
-					let t = true;
-					for (const t_item of nowData) {
-						if (item.id == t_item.materialSku) {
-							if (!names) {
-								names = item.skuTitle
-							} else {
-								names = names + ',' + item.skuTitle
-							}
-							t = false;
-							break;
-						}
-					}
-					if (t) {
-						let obj : any = {};
-						obj.materialName = item.skuTitle
-						obj.materialId = item.materialId
-						obj.prePrice = 0
-						obj.unitPrice = item.price
-						obj.materialSku = item.id
-						obj.unit = item.unit
-						obj.unitCode = item.unitCode
-						obj.financeSuborderId = item.financialCode
-						obj.prePrice = "0"
-						obj.isDeleted = 0
-						this.tableData.push(obj);
-						nowData.push(obj);
-					}
-				}
-				(this.$refs.bill as any).setBillTableValue(nowData, 0);// 设置第1张单据表格数据
-				if (names) {
-					this.$alert('商品 “' + names + '”已存在!', '提示', {
-						confirmButtonText: '确定',
-					});
-				}
-			}
-		}
 		// 单据表格删除
 		changeTable(item : any) {
 			this.$confirm('确定删除吗!', '注意', {

+ 123 - 133
src/views/audit/sku/index.vue

@@ -21,22 +21,27 @@
 <script lang="ts">
 	import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 	import api from "@/api/currency";
-	import other from '@/api/other'
 	import ForTab from "@/components/ForTab/index.vue";
 	@Component({ components: { ForTab } })
 	export default class Attribute extends Vue {
 		// 右边
 		isShow : any = 'home'
-		norms : any = ''
-		normsValue : any = ''
 		timeNum = 0;
 		timer : any = null
-		popTitle : any = ''
 		toolConfig = {
 			tools: {
 				return: true,
 				save: true,
-			}
+			},
+			customTools: [
+				// {
+				// 	name: '同步到财务系统', icon: 'el-icon-top', audit: [''], event: {
+				// 		click: () => {
+				// 			(this as any).syncSystem()
+				// 		}
+				// 	}
+				// },
+			]
 		}
 		skuConfig : any = {
 			attr: {
@@ -48,42 +53,24 @@
 					width: '150px',
 					title: '标题',
 					field: 'skuTitle',
-					// component: 'by-input',
-					compConfig: {
-						attr: {
-							size: 'mini',
-							placeholder: ' '
-						},
-					}
+
 				},
 				{
 					width: '120px',
 					title: '副标题',
 					field: 'skuSubtitle',
-					// component: 'by-input',
-					compConfig: {
-						attr: {
-							size: 'mini',
-							placeholder: ' '
-						},
-					}
+
 				},
 				{
 					width: '140px',
 					title: '物料编码',
 					field: 'skuCode',
-					// component: 'by-input',
-					compConfig: {
-						attr: {
-							size: 'mini',
-							placeholder: ' '
-						},
-					}
+
 				},
 				{
 					width: '140px',
 					title: '财务编号',
-					field: 'accountingCode',
+					field: 'financialCode',
 					component: 'by-input',
 					compConfig: {
 						attr: {
@@ -96,7 +83,6 @@
 					width: '90px',
 					title: '价格',
 					field: 'price',
-					// component: 'by-input',
 					compConfig: {
 						attr: {
 							size: 'mini',
@@ -110,7 +96,6 @@
 					width: '90px',
 					title: '单位',
 					field: 'unit',
-					// component: 'by-input',
 					compConfig: {
 						attr: {
 							size: 'mini',
@@ -122,7 +107,6 @@
 					width: '90px',
 					title: '单位编码',
 					field: 'unitCode',
-					// component: 'by-input',
 					compConfig: {
 						attr: {
 							size: 'mini',
@@ -134,7 +118,6 @@
 					width: '110px',
 					title: '保质期(天)',
 					field: 'shelfLife',
-					// component: 'by-input',
 					compConfig: {
 						attr: {
 							size: 'mini',
@@ -147,7 +130,6 @@
 					width: '90px',
 					title: '重量/g',
 					field: 'weight',
-					// component: 'by-input',
 					compConfig: {
 						attr: {
 							size: 'mini',
@@ -160,7 +142,6 @@
 					width: '90px',
 					title: '长/cm',
 					field: 'length',
-					// component: 'by-input',
 					compConfig: {
 						attr: {
 							size: 'mini',
@@ -173,7 +154,6 @@
 					width: '90px',
 					title: '宽/cm',
 					field: 'width',
-					// component: 'by-input',
 					compConfig: {
 						attr: {
 							size: 'mini',
@@ -186,7 +166,6 @@
 					width: '90px',
 					title: '高/cm',
 					field: 'height',
-					// component: 'by-input',
 					compConfig: {
 						attr: {
 							size: 'mini',
@@ -203,6 +182,9 @@
 			]
 		}
 		config : any = {
+			attr: {
+				calculateH: true
+			},
 			search: {
 				attr: {
 					size: 'mini'
@@ -211,20 +193,8 @@
 					[
 						{
 							span: 6,
-							label: '名称',
-							prop: 'name',
-							component: 'by-input',
-							labelWidth: '70px',
-							compConfig: {
-								attr: {
-									placeholder: '请输入名称',
-									clearable: true
-								}
-							},
-						}, {
-							span: 6,
-							label: '简称',
-							prop: 'shortName',
+							label: '物料编码',
+							prop: 'skuCode',
 							component: 'by-input',
 							labelWidth: '70px',
 							compConfig: {
@@ -255,64 +225,104 @@
 					search: true,
 					refresh: true,
 				},
-				customTools: [
-					{
-						name: '同步到财务系统', icon: 'el-icon-top', audit: [''], event: {
-							click: () => {
-								(this as any).syncSystem()
-							}
-						}
-					},
-				]
+				// customTools: [
+				// 	{
+				// 		name: '同步到财务系统', icon: 'el-icon-top', audit: [''], event: {
+				// 			click: () => {
+				// 				(this as any).syncSystem()
+				// 			}
+				// 		}
+				// 	},
+				// ]
 			},
 			table: {
 				attr: {
 					size: 'mini',
 					align: 'left',
 					checkbox: true,
-					calculateH: true
 				},
-				columns: [{
-					width: 250,
-					title: '名称',
-					field: 'name',
-					isDetail: true,
-				}, {
-					width: 200,
-					title: '简称',
-					field: 'shortName'
-				}, {
-					width: 200,
-					title: '货号',
-					field: 'itemNumber'
-				}, {
-					width: 200,
-					title: '国际码',
-					field: 'nsCode'
-				}, {
-					width: 90,
-					title: '基本售价',
-					field: 'basePrice'
-				}, {
-					width: 90,
-					title: '市场价格', // (市场价格统一售价)
-					field: 'markPrice'
-				},
-				{
-					width: 120,
-					title: '操作',
-					action: true,
-					plugins: [{
-						icon: 'el-icon-edit',
-						name: '编辑',
-						audit: '',
-						event: {
-							click: (item : any) => {
-								(this as any).openEdit(item)
+				columns: [
+					{
+						width: '200px',
+						title: '标题',
+						field: 'skuTitle',
+						isDetail: true
+					},
+					{
+						width: '200px',
+						title: '副标题',
+						field: 'skuSubtitle',
+					},
+					{
+						width: '140px',
+						title: '物料编码',
+						field: 'skuCode',
+					},
+					{
+						width: '140px',
+						title: '财务编号',
+						field: 'financialCode',
+					},
+					{
+						width: '80px',
+						title: '价格',
+						field: 'price',
+					},
+					{
+						width: '80px',
+						title: '单位',
+						field: 'unit',
+					},
+					{
+						width: '80px',
+						title: '单位编码',
+						field: 'unitCode',
+					},
+					{
+						width: '100px',
+						title: '保质期(天)',
+						field: 'shelfLife',
+					},
+					{
+						width: '80px',
+						title: '重量/g',
+						field: 'weight',
+					},
+					{
+						width: '80px',
+						title: '长/cm',
+						field: 'length',
+					},
+					{
+						width: '80px',
+						title: '宽/cm',
+						field: 'width',
+					},
+					{
+						width: '80px',
+						title: '高/cm',
+						field: 'height',
+					},
+					{
+						width: '90px',
+						title: '体积/cm³',
+						field: 'volume',
+					},
+					{
+						width: 70,
+						title: '操作',
+						action: true,
+						plugins: [{
+							icon: 'el-icon-edit',
+							name: '编辑',
+							audit: '',
+							event: {
+								click: (item : any) => {
+									(this as any).openEdit(item)
+								}
 							}
-						}
+						}]
 					}]
-				}]
 			},
 		}
 		mounted() {
@@ -322,26 +332,15 @@
 		}
 		// 保存
 		doFormData() {
-			(this as any).$refs.addFormId.validate().then(() => {
-				let query = (this as any).$refs.addFormId.getValue();
-				console.log(query);
-				if (this.popTitle === '新增') {
-					api.saveList(query, 'maindataMaterial').then((res : any) => {
-						if (res.code === 200) {
-							this.$message.success('新增成功');
-							this.getDataList();
-						} else this.$message.error(res.msg);
-					})
-				} else if (this.popTitle === '编辑') {
-					api.updateList(query, 'maindataMaterial').then((res : any) => {
-						if (res.code === 200) {
-							this.$message.success('编辑成功');
-							this.getDataList();
-						} else this.$message.error(res.msg);
-					})
-				}
-
-			})
+			let data : any = (this as any).$refs.addFormId.getValue()
+			if (!data[0].financialCode) return this.$message.warning('财务编号不能为空');
+			console.log(data[0]);
+			// api.updateList(data[0], 'maindataMaterialSku').then((res : any) => {
+			// 	if (res.code === 200) {
+			// 		this.$message.success('编辑成功');
+			// 		this.getDataList();
+			// 	} else this.$message.error(res.msg);
+			// })
 		}
 		// 获取列表数据
 		getDataList() {
@@ -359,7 +358,7 @@
 		}
 		getPageList(query : any) {
 			let loading = this.$loading({ target: '.main-container' });
-			api.pageList(query, 'maindataMaterial').then((res : any) => {
+			api.pageList(query, 'maindataMaterialSku').then((res : any) => {
 				loading.close();
 				if (res.code === 200) {
 					(this.$refs.moduleView as any).setTableValue(res.data.records);
@@ -374,23 +373,17 @@
 		}
 		// 打开编辑
 		openEdit(e : any) {
-			this.popTitle = '编辑';
 			let loading = this.$loading({ target: '.main-container' });
-			api.single({ id: e.id }, 'maindataMaterial').then((res : any) => {
+			api.single({ id: e.id }, 'maindataMaterialSku').then((res : any) => {
+				loading.close();
 				if (res.code === 200) {
-					other.selectByMaterialId({ id: res.data.id }, 'maindataMaterialSku').then((info : any) => {
-						loading.close();
-						if (info.code === 200) {
-							this.isShow = 'add';
-							setTimeout(() => { (this as any).$refs.addFormId.setValue(info.data) }, 0);
-						}
-					}).catch(() => loading.close());
+					this.isShow = 'add';
+					setTimeout(() => { (this as any).$refs.addFormId.setValue([res.data]) }, 0);
 				} else loading.close();
 			}).catch(() => loading.close());
 		}
 		// 内页工具栏方法
 		insideTools(e : any) {
-			console.log(e);
 			if (e === 'onReturn') this.isShow = 'home';
 			if (e === 'onSave') this.doFormData();
 		}
@@ -407,6 +400,7 @@
 		box-sizing: border-box;
 		display: flex;
 		padding: 16px;
+		height: 100%;
 
 		.bill-left {
 			position: relative;
@@ -429,10 +423,6 @@
 			}
 		}
 
-		.item-tab {
-			margin-right: 16px;
-		}
-
 		.bill-main {
 			width: calc(100% - 16px);
 			box-sizing: border-box;

+ 84 - 11
src/views/audit/warehousing/index.vue

@@ -7,6 +7,29 @@
 		</by-bill>
 		<!-- 选择物料 -->
 		<productModal ref="product" :mulit="true" @confirm="confirmProduct" />
+		<vxe-modal v-model="value" id="synchronousOrderModal" width="500" height="200" @hide="value=false" transfer
+			show-footer>
+			<template #title>
+				<span>入库单同步</span>
+			</template>
+			<template>
+				<div class="cont">
+					<div class="t-title"><span>* </span>时间:</div>
+					<div class="right-cont">
+						<el-date-picker v-model="time" style="width: 100%;" size="mini" type="datetimerange" clearable
+							value-format="yyyy-MM-dd HH:mm:ss" range-separator="-" start-placeholder="开始日期" @change="change"
+							end-placeholder="结束日期">
+						</el-date-picker>
+					</div>
+				</div>
+			</template>
+			<template #footer>
+			  <div class="btn">
+			    <el-button type="primary" size="small" plain @click="value=false">取消</el-button>
+			    <el-button type="primary" size="small" @click="confirm">确定</el-button>
+			  </div>
+			</template>
+		</vxe-modal>
 	</div>
 </template>
 
@@ -26,6 +49,10 @@
 		isSubmit : any = false
 		isChange : any = false
 		dataId : any = ''
+		beginDate : any = ''
+		endDate : any = ''
+		time : any = null;
+		value : any = false;
 		// 右边
 		supplierInfo : any = {} // 机构信息
 		businessType : any = '' // 业务类型
@@ -475,15 +502,15 @@
 						search: true,
 						refresh: true
 					},
-					// customTools: [
-					// 	{
-					// 		name: '同步入库单', icon: 'el-icon-top', audit: [''], event: {
-					// 			click: () => {
-					// 				(this as any).syncEntry()
-					// 			}
-					// 		}
-					// 	},
-					// ]
+					customTools: [
+						{
+							name: '同步入库单', icon: 'el-icon-top', audit: [''], event: {
+								click: () => {
+									(this as any).syncEntry()
+								}
+							}
+						},
+					]
 				},
 				table: {
 					attr: {
@@ -654,7 +681,21 @@
 		}
 		// 同步入库单
 		syncEntry() {
-		
+			this.value = true;
+		}
+		// 获取时间段
+		change(v : any) {
+			if (v) {
+				this.beginDate = v[0];
+				this.endDate = v[1];
+			} else {
+				this.beginDate = '';
+				this.endDate = '';
+			}
+		}
+		// 确认同步入库单
+		confirm(){
+			console.log(this.beginDate,this.endDate);
 		}
 		// 获取机构数据
 		getSupplierModal(e : any) {
@@ -1168,4 +1209,36 @@
 			}).catch(() => this.$message.info('已取消删除'));
 		}
 	}
-</script>
+</script>
+<style scoped lang="scss">
+	.btn {
+		width: 100%;
+		display: flex;
+		justify-content: flex-end;
+	}
+
+	.type {
+		width: 100%;
+		padding: 8px 0;
+	}
+
+	.cont {
+		width: 100%;
+		display: flex;
+		align-items: center;
+		padding: 8px 0;
+
+		.t-title {
+			width: 60px;
+			text-align: right;
+
+			>span {
+				color: #F00;
+			}
+		}
+
+		.right-cont {
+			width: calc(100% - 60px);
+		}
+	}
+</style>