AlanWong 1 год назад
Родитель
Сommit
20c30ceb2d

+ 3 - 3
src/api/order.ts

@@ -142,9 +142,9 @@ function addSaleOrder(data : any) {
 	})
 }
 // 同步入库单到财务系统
-function addInStock(data : any) {
+function getFinanceEntryOrder(data : any) {
 	return request({
-		url: '/supply/financeApi/addInStock',
+		url: '/supply/financeApi/getFinanceEntryOrder',
 		method: 'GET',
 		params: data
 	})
@@ -176,6 +176,6 @@ export default {
 	single,
 	getInventoryByStoridsAndSkuids,
 	addSaleOrder,
-	addInStock,
+	getFinanceEntryOrder,
 	addOutStock
 }

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

@@ -648,7 +648,7 @@
 		}
 		// 确定机构选择
 		confirmSupplier(e : any) {
-			if (e.length == 0) return this.$message.warning('请选择供应商!');
+			if (e.length == 0) return this.$message.warning('请选择机构名称');
 			let value : any = (this.$refs.addFormId2 as any).getValue();
 			value.organizationName = e[0].name;
 			value.organizationId = e[0].id;

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

@@ -221,7 +221,6 @@
 				},
 				tool: {
 					tools: {
-						// order: true,
 						search: true,
 						refresh: true
 					}
@@ -229,9 +228,7 @@
 				table: {
 					attr: {
 						size: 'mini',
-						seq: true,
 						align: 'left',
-						checkbox: true
 					},
 					columns: [
 						{

+ 1 - 1
src/views/audit/orderTask/components/focus.vue

@@ -1,6 +1,6 @@
 <template>
 	<div>
-		<el-input placeholder="请选择供应商" v-model="value" class="input-organizationName" size="small" clearable
+		<el-input placeholder="请选择机构名称" v-model="value" class="input-organizationName" size="small" clearable
 			:readonly="true">
 			<el-button slot="append" icon="el-icon-more" @click="handleSupplier"></el-button>
 		</el-input>

+ 5 - 6
src/views/audit/orderTask/index.vue

@@ -303,9 +303,7 @@
 				table: {
 					attr: {
 						size: 'mini',
-						seq: true,
 						align: 'left',
-						checkbox: true
 					},
 					columns: [
 						{
@@ -449,7 +447,8 @@
 						size: 'mini',
 						seq: true,
 						align: 'left',
-						checkbox: true
+						checkbox: true,
+						triggerRowCheck: 'row'
 					},
 					columns: [
 						{
@@ -592,7 +591,8 @@
 						size: 'mini',
 						seq: true,
 						align: 'left',
-						checkbox: true
+						checkbox: true,
+						triggerRowCheck: 'row'
 					},
 					columns: [
 						{
@@ -745,9 +745,7 @@
 				table: {
 					attr: {
 						size: 'mini',
-						seq: true,
 						align: 'left',
-						checkbox: true
 					},
 					columns: [
 						{
@@ -1151,6 +1149,7 @@
 			if (e === 'bill') {
 				let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
 				billConfig.tool.tools = {};
+				billConfig.tableConfig[0].tool.tools = {};
 				(this.$refs.bill as any).setBillConfig(billConfig);
 			}
 		}

+ 1 - 1
src/views/audit/outbound/components/focus.vue

@@ -1,6 +1,6 @@
 <template>
 	<div>
-		<el-input placeholder="请选择供应商" v-model="propValue" class="input-organizationName" clearable :readonly="true">
+		<el-input placeholder="请选择机构名称" v-model="propValue" class="input-organizationName" clearable :readonly="true">
 			<el-button slot="append" icon="el-icon-more" @click="handleSupplier"></el-button>
 		</el-input>
 		<!-- 选择机构名称 -->

+ 76 - 0
src/views/audit/outbound/components/stockLook.vue

@@ -0,0 +1,76 @@
+<template>
+	<div>
+		<div class="selectS" @click="openWindows">查看</div>
+		<vxe-modal v-model="vxeValue" width="50%" height="50%" show-zoom resize transfer>
+			<template #title>
+				<span>库存查看</span>
+			</template>
+			<template #default>
+				<by-table :propConfig="config" ref="stockTable" style="margin-top: 10px;"></by-table>
+			</template>
+		</vxe-modal>
+	</div>
+</template>
+
+<script lang="ts">
+	import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+	import request from '@/benyun/utils/request'
+	@Component
+	export default class StockLook extends Vue {
+		vxeValue : any = false
+		@Prop()
+		parentValue : any;
+		config = {
+			attr: {
+				size: 'medium',
+				align: 'left'
+			},
+			columns: [{
+				width: '150px',
+				title: '仓库名称',
+				field: 'storeName',
+			}, {
+				width: '150px',
+				title: '仓位名称',
+				field: 'storeLocationName',
+			}, {
+				width: '150px',
+				title: '第三方仓库名称',
+				field: 'threeStoreName',
+			}, {
+				width: '150px',
+				title: '库存',
+				field: 'inventory',
+			}]
+		}
+		openWindows() {
+			let loading = this.$loading({ target: '.main-container' });
+			request({
+				url: '/supply/supplyInventory/getInventorysBySkuid',
+				method: 'get',
+				params: { skuid: this.parentValue.materialId },
+			}).then((res : any) => {
+				if (res.code === 200) {
+					this.vxeValue = true;
+					loading.close();
+					setTimeout(() => {
+						(this as any).$refs.stockTable.setValue(res.data);
+					},0)
+				} else loading.close();
+			}).catch(() => loading.close())
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.selectS {
+		color: #fff;
+		background-color: #0089ff;
+		padding: 0 10px;
+		height: 22px;
+		line-height: 22px;
+		border-radius: 12px;
+		text-align: center;
+		cursor: pointer;
+	}
+</style>

+ 109 - 79
src/views/audit/outbound/index.vue

@@ -12,6 +12,7 @@
 	import api from "@/api/order";
 	import BusinessType from "./components/businessType.vue";
 	import towInOne from "../warehousing/components/towInOne.vue";
+	import stockLook from "./components/stockLook.vue";
 	@Component
 	export default class OrderTask extends Vue {
 		// 左边
@@ -239,12 +240,18 @@
 							},
 							columns:
 								[{
-									width: 278,
+									width: 200,
 									title: '物料名称',
 									field: 'materialName',
+									fixed: 'left'
 								},
 								{
-									width: 200,
+									width: 70,
+									title: '库存查看',
+									component: stockLook,
+								},
+								{
+									width: 80,
 									title: '财务编号',
 									field: 'financeSuborderId',
 								},
@@ -258,22 +265,22 @@
 									}
 								},
 								{
-									width: 100,
+									width: 70,
 									title: '单位',
 									field: 'unit',
 								},
 								{
-									width: 120,
+									width: 70,
 									title: '单位编码',
 									field: 'unitCode',
 								},
 								{
-									width: 100,
+									width: 80,
 									title: '库存',
 									field: 'inventory',
 								},
 								{
-									width: 100,
+									width: 90,
 									title: '数量',
 									field: 'number',
 									component: 'by-input',
@@ -286,17 +293,17 @@
 									}
 								},
 								{
-									width: 100,
+									width: 80,
 									title: '应出数量',
 									field: 'deliveryNumber',
 								},
 								{
-									width: 110,
+									width: 80,
 									title: '出库数量',
 									field: 'outNumber',
 								},
 								{
-									width: 100,
+									width: 90,
 									title: '单价',
 									field: 'unitPrice',
 									component: 'by-input',
@@ -308,17 +315,17 @@
 									}
 								},
 								{
-									width: 100,
+									width: 80,
 									title: '优惠金额',
 									field: 'prePrice',
 								},
 								{
-									width: 100,
+									width: 90,
 									title: '合计金额',
 									field: 'totalPrice',
 								},
 								{
-									width: 90,
+									width: 70,
 									title: '操作',
 									action: true,
 									plugins: [{
@@ -364,14 +371,24 @@
 					tools: {
 						search: true,
 						refresh: true
-					}
+					},
+					customTools: [
+						{
+							name: '同步到财务系统', icon: 'el-icon-top', audit: [''], event: {
+								click: () => {
+									(this as any).syncSystem()
+								}
+							}
+						},
+					]
 				},
 				table: {
 					attr: {
 						size: 'mini',
 						seq: true,
 						align: 'left',
-						checkbox: true
+						checkbox: true,
+						triggerRowCheck: 'row'
 					},
 					columns: [
 						{
@@ -475,7 +492,8 @@
 						size: 'mini',
 						seq: true,
 						align: 'left',
-						checkbox: true
+						checkbox: true,
+						triggerRowCheck: 'row'
 					},
 					columns: [
 						{
@@ -600,7 +618,8 @@
 						size: 'mini',
 						seq: true,
 						align: 'left',
-						checkbox: true
+						checkbox: true,
+						triggerRowCheck: 'row'
 					},
 					columns: [
 						{
@@ -699,9 +718,7 @@
 				table: {
 					attr: {
 						size: 'mini',
-						seq: true,
 						align: 'left',
-						checkbox: true
 					},
 					columns: [
 						{
@@ -777,7 +794,6 @@
 			api.single({ id: parentData[0].id }, 'supplyPurchaseOrder').then((res : any) => {
 				if (res.code === 200) {
 					parentData = res.data ? [res.data] : parentData;
-					console.log(parentData);
 					parentData = parentData.map((item : any) => {
 						item.receiveAddress = item.address
 						item.receive = item.consignee
@@ -786,15 +802,14 @@
 						return newData
 					})
 					let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
+					parentData[0].suborderList = parentData[0].suborderList.filter((v : any) => (v.number - v.outNumber) > 0);
 					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;
 					billConfig.tool.tools = { save: true, smt: true };
 					// console.log('this.tableData ==> ', this.tableData);
-					// billConfig.tool.tools = { save: true };
 					this.isAdd = true;
 					(this.$refs.bill as any).showTab = 'bill';
 					loading.close();
@@ -821,10 +836,10 @@
 		}
 		// 同步出库单到财务系统
 		syncSystem() {
-			let selectData = (this as any).$refs.bill.getTableSelectData('all');
+			let selectData = (this as any).$refs.bill.getTableSelectData(this.tabType);
 			if (selectData.length > 0) {
 				if (selectData.length > 1) return this.$message.warning('只能同步一条数据');
-				if (selectData[0].submitState != 1) return this.$message.warning('只能同步已提交数据');
+				// if (selectData[0].submitState != 1) return this.$message.warning('只能同步已提交数据');
 				this.$confirm('确定同步订单吗', '注意', {
 					confirmButtonText: '确定',
 					cancelButtonText: '取消',
@@ -836,8 +851,7 @@
 						loading.close();
 						if (res.code === 200) {
 							this.$message.success('同步订单成功');
-							this.getDataList();
-							(this.$refs.bill as any).showTab = 'all';
+							this.clickTab(this.tabType);
 						} else this.$message.error(res.msg)
 					}).catch(() => loading.close());
 				}).catch(() => this.$message.info('已取消同步订单'));
@@ -902,7 +916,7 @@
 		}
 		// 切换tab栏
 		clickTab(e : any) {
-			console.log('切换tab ==> ', e);
+			// console.log('切换tab ==> ', e);
 			this.tabType = e;
 			(this.$refs.bill as any).showTab = e;
 			// submitState: 提交状态
@@ -954,34 +968,42 @@
 								}]
 							})
 						};
-						billConfig.form.attr.readonly = false; // 设置只读
-						billConfig.tool.tools = { save: true, };
-						if (this.tabType === 'draftsBox' || parentData.submitState === 0) billConfig.tool.tools = { save: true, smt: true };
-						let data : any = parentData.suborderList;
-						let array : any = [];
-						data.map((v : any) => {
-							v.towInOne = v.storehouseName + ',' + v.storingLocationName; // 仓库仓位
-							array.push({
-								storidId: v.storingLocationId,
-								skuid: v.materialSku,
-							})
-						});
-						//  查库存
-						api.getInventoryByStoridsAndSkuids(array).then((res : any) => {
-							if (res.code === 200) {
-								let newData : any = [];
-								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(billConfig);
-								(this.$refs.bill as any).setBillFormValue(parentData);// 设置单据表单数据
-								(this.$refs.bill as any).setBillTableValue(newData, 0);// 设置第1张单据表格数据
-								this.isAdd = false;
-								this.dataId = '';
-								(this.$refs.bill as any).showTab = 'bill';
-								loading.close();
+						billConfig.tool.tools = { save: true, smt: true };
+						// 查销售订单数据
+						api.single({ id: e.purchaseOrderId }, 'supplyPurchaseOrder').then((val : any) => {
+							if (val.code === 200) {
+								parentData.suborderList.map((v : any, i : any) => {
+									v.outNumber = val.data.suborderList[i].outNumber;
+									v.prePrice = val.data.suborderList[i].prePrice;
+								});
+								let data : any = parentData.suborderList;
+								let array : any = [];
+								data.map((v : any) => {
+									v.deliveryNumber = v.number - v.outNumber;
+									if (v.deliveryNumber < v.number) v.number = v.deliveryNumber;
+									v.towInOne = v.storehouseName + ',' + v.storingLocationName; // 仓库仓位
+									array.push({
+										storidId: v.storingLocationId,
+										skuid: v.materialSku,
+									})
+								});
+								//  查库存
+								api.getInventoryByStoridsAndSkuids(array).then((res : any) => {
+									if (res.code === 200) {
+										let newData : any = [];
+										res.data.map((v : any, i : any) => {
+											newData.push(Object.assign(data[i], v))
+										})
+										this.tableData = newData;
+										(this.$refs.bill as any).setBillConfig(billConfig);
+										(this.$refs.bill as any).setBillFormValue(parentData);// 设置单据表单数据
+										(this.$refs.bill as any).setBillTableValue(newData, 0);// 设置第1张单据表格数据
+										this.isAdd = false;
+										this.dataId = '';
+										(this.$refs.bill as any).showTab = 'bill';
+										loading.close();
+									} else loading.close();
+								}).catch(() => loading.close());
 							} else loading.close();
 						}).catch(() => loading.close());
 					} else {
@@ -993,38 +1015,46 @@
 		}
 		// 设置只读
 		setReadonly(e : any) {
+			let parentData : any = e;
 			let loading = this.$loading({ target: '.main-container' });
 			let readonly = (this as any).$lodash.cloneDeep(this.config.bill);
 			readonly.form.attr.readonly = true; // 设置只读
 			readonly.tool.tools = {};
 			if (this.tabType != 'recycleBin') {
-				if (e.submitState === 1) readonly.tool.tools = { returnSmt: true };
+				if (parentData.submitState === 1) readonly.tool.tools = { returnSmt: true };
 			}
 			readonly.tableConfig[0].table.columns = readonly.tableConfig[0].table.columns.filter((v : any) => v.title != '操作');
-			let data = e.suborderList;
-			let array : any = [];
-			data.map((v : any) => {
-				v.towInOne = v.storehouseName + ',' + v.storingLocationName; // 仓库仓位
-				array.push({
-					storidId: v.storingLocationId,
-					skuid: v.materialSku,
-				})
-			});
-			//  查库存
-			api.getInventoryByStoridsAndSkuids(array).then((res : any) => {
-				loading.close();
-				if (res.code === 200) {
-					let newData : any = []
-					res.data.map((v : any, i : any) => {
-						newData.push(Object.assign(data[i], v))
-					})
-					this.tableData = newData;
-					(this.$refs.bill as any).setBillConfig(readonly);
-					(this.$refs.bill as any).setBillFormValue(e);// 设置单据表单数据
-					(this.$refs.bill as any).setBillTableValue(newData, 0);// 设置第1张单据表格数据
-					this.isAdd = false;
-					(this.$refs.bill as any).showTab = 'bill';
-				}
+			api.single({ id: e.purchaseOrderId }, 'supplyPurchaseOrder').then((val : any) => {
+				if (val.code === 200) {
+					parentData.suborderList.map((v : any, i : any) => {
+						v.prePrice = val.data.suborderList[i].prePrice;
+					});
+					let data = parentData.suborderList;
+					let array : any = [];
+					data.map((v : any) => {
+						v.towInOne = v.storehouseName + ',' + v.storingLocationName; // 仓库仓位
+						array.push({
+							storidId: v.storingLocationId,
+							skuid: v.materialSku,
+						})
+					});
+					//  查库存
+					api.getInventoryByStoridsAndSkuids(array).then((res : any) => {
+						if (res.code === 200) {
+							let newData : any = []
+							res.data.map((v : any, i : any) => {
+								newData.push(Object.assign(data[i], v))
+							})
+							this.tableData = newData;
+							(this.$refs.bill as any).setBillConfig(readonly);
+							(this.$refs.bill as any).setBillFormValue(parentData);// 设置单据表单数据
+							(this.$refs.bill as any).setBillTableValue(newData, 0);// 设置第1张单据表格数据
+							this.isAdd = false;
+							loading.close();
+							(this.$refs.bill as any).showTab = 'bill';
+						} else loading.close();
+					}).catch(() => loading.close());
+				} else loading.close();
 			}).catch(() => loading.close());
 		}
 		// 工具栏提交

+ 2 - 2
src/views/audit/productManagement/index.vue

@@ -222,7 +222,7 @@
 				{
 					width: '140px',
 					title: '财务编号',
-					field: 'accountingCode',
+					field: 'financialCode',
 					component: 'by-input',
 					compConfig: {
 						attr: {
@@ -392,7 +392,7 @@
 				{
 					width: '140px',
 					title: '财务编号',
-					field: 'accountingCode',
+					field: 'financialCode',
 					component: 'by-input',
 					compConfig: {
 						attr: {

+ 7 - 7
src/views/audit/sku/index.vue

@@ -334,13 +334,13 @@
 		doFormData() {
 			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);
-			// })
+			api.updateList(data[0], 'maindataMaterialSku').then((res : any) => {
+				if (res.code === 200) {
+					this.$message.success('编辑成功');
+					this.isShow = 'home';
+					this.getDataList();
+				} else this.$message.error(res.msg);
+			})
 		}
 		// 获取列表数据
 		getDataList() {

+ 1 - 0
src/views/audit/warehousing/components/towInOne.vue

@@ -14,6 +14,7 @@
 			</template>
 			<template #footer>
 				<div class="btn">
+					<el-button size="small" @click="vxeValue=false">取消</el-button>
 					<el-button type="primary" size="small" @click="doConfirm">确定</el-button>
 				</div>
 			</template>

+ 49 - 19
src/views/audit/warehousing/index.vue

@@ -16,18 +16,18 @@
 				<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 v-model="time" style="width: 100%;" size="mini" type="daterange" clearable
+							value-format="yyyy-MM-dd" range-separator="-" :start-placeholder="beginDate" @change="change"
+							:end-placeholder="endDate">
 						</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>
+				<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>
@@ -49,9 +49,9 @@
 		isSubmit : any = false
 		isChange : any = false
 		dataId : any = ''
-		beginDate : any = ''
-		endDate : any = ''
-		time : any = null;
+		beginDate : any = this.getNowDate(3)
+		endDate : any = this.getNowDate(0)
+		time : any = '';
 		value : any = false;
 		// 右边
 		supplierInfo : any = {} // 机构信息
@@ -120,6 +120,17 @@
 								prop: 'businessType',
 								component: BusinessType,
 							},
+							{
+								span: 8,
+								label: '财务编号',
+								prop: 'financeOrderId',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										readonly: true,
+									},
+								}
+							},
 							{
 								span: 8,
 								label: 'WMS编码',
@@ -290,9 +301,7 @@
 				table: {
 					attr: {
 						size: 'mini',
-						seq: true,
 						align: 'left',
-						checkbox: true
 					},
 					columns: [
 						{
@@ -397,7 +406,8 @@
 						size: 'mini',
 						seq: true,
 						align: 'left',
-						checkbox: true
+						checkbox: true,
+						triggerRowCheck: 'row'
 					},
 					columns: [
 						{
@@ -517,7 +527,8 @@
 						size: 'mini',
 						seq: true,
 						align: 'left',
-						checkbox: true
+						checkbox: true,
+						triggerRowCheck: 'row'
 					},
 					columns: [
 						{
@@ -619,9 +630,7 @@
 				table: {
 					attr: {
 						size: 'mini',
-						seq: true,
 						align: 'left',
-						checkbox: true
 					},
 					columns: [
 						{
@@ -679,6 +688,17 @@
 				this.getDataList()
 			}, 500)
 		}
+		// 获取当前日期
+		getNowDate(num : number) {
+			let date = new Date();
+			let year = date.getFullYear();
+			let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
+			let day : any = date.getDate();
+			if (day - num < 0) {
+				day = '01';
+			} else day = day - num < 10 ? '0' + (day - num) : day - num;
+			return year + '-' + month + '-' + day;
+		}
 		// 同步入库单
 		syncEntry() {
 			this.value = true;
@@ -694,8 +714,18 @@
 			}
 		}
 		// 确认同步入库单
-		confirm(){
-			console.log(this.beginDate,this.endDate);
+		confirm() {
+			if (this.beginDate == '' || this.endDate == '') return this.$message.warning('请选择时间段');
+			let loading = this.$loading({ target: '.main-container' });
+			api.getFinanceEntryOrder({
+				stime: this.beginDate,
+				etime: this.endDate,
+			}).then((res : any) => {
+				this.value = false;
+				this.$message.success('同步成功');
+				loading.close();
+				if (res.code === 200) this.getPageList({}, 'all'); // 综合数据
+			}).catch(() => loading.close());
 		}
 		// 获取机构数据
 		getSupplierModal(e : any) {
@@ -703,7 +733,6 @@
 		}
 		// 监听表格数据变化
 		onChangeRow(e : any) {
-			console.log('监听表格数据变化');
 			this.isChange = true;
 			this.isSubmit = false;
 			e.totalPrice = parseFloat((e.number * e.unitPrice).toFixed(2));
@@ -996,6 +1025,7 @@
 			if (e === 'bill') {
 				let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
 				billConfig.tool.tools = {};
+				billConfig.tableConfig[0].tool.tools = {};
 				(this.$refs.bill as any).setBillConfig(billConfig);
 			}
 		}