Browse Source

辅材销售订单增加仓库

pengyh 1 year ago
parent
commit
6b5c5fff24

+ 49 - 4
src/views/auxiliaryFittings/salesManagement/components/auxiliarySalesOrderDetail.vue

@@ -116,6 +116,23 @@
 								</el-radio-group>
 							</el-form-item>
 						</el-col>
+						<el-col :span="6">
+							<el-form-item label="出库仓库" prop="storage">
+								<el-select v-model="formData.storage" value-key="storageId" @focus="()=>{
+										if(!this.formData.websitId){return this.$message.warning('请先选择网点名称!');}
+									}" @change="(e)=>{
+										formData.storageId = e.storageId
+										formData.storageName = e.storageName
+									}" :disabled="formData.flag != 'SAVE' && formType!=0" placeholder="请选择" style="width: 100%;">
+								    <el-option
+									  v-for="(item,index) in warehouseList"
+								      :key="index"
+								      :label="item.storageName"
+								      :value="item">
+								    </el-option>
+								</el-select>
+							</el-form-item>
+						</el-col>
 						<el-col :span="2" v-if="formData.flag == 'SUBMIT' && formData.payType == 'WECHAT'">
 							<div style="height: 32px;display: flex;align-items: center;cursor: pointer;" @click="wxPay()">微信支付<i class="el-icon-full-screen"></i></div>
 						</el-col>
@@ -390,6 +407,7 @@
 	import geographicalPosi from '@/components/geographicalPosi/index.vue'
 	import ImageUpload from '@/components/file-upload'
 	import { getWorker, getCategory, getGoods, getDetail, add, edit, confirm, submit, getCode, getProject, getProjectCollectionList } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
+	import { storageListPageV2 } from '@/api/storage.js'
 	export default {
 		components: {geographicalPosi,ImageUpload},
 		props: ['id','title','formType'],
@@ -401,6 +419,7 @@
 				mainList: [],
 				projectList: [],
 				collectionList: [],
+				warehouseList: [],
 				isPay: false,
 				payCodeUrl: '',
 				formData: {
@@ -438,6 +457,9 @@
 					lng: '',
 					project: {},
 					orderEnginBaseId: '',
+					storage: null,
+					storageId: '',
+					storageName: '',
 				},
 				formData1: {
 					price: '',
@@ -477,6 +499,9 @@
 					workerName: [
 						{ required: true, message: '请输入客户姓名', trigger: 'blur' }
 					],
+					storage: [
+						{ required: true, message: `请选择入库仓库`, trigger: 'change' },
+					]
 				},
 				rules1: {
 					price: [
@@ -505,10 +530,14 @@
 					Object.assign(this.formData, res.data, {
 						websit: {websitId: res.data.websitId,name: res.data.websitName},
 						worker: {nickName: res.data.workerName,userId: res.data.workerId},
-						project: {id: res.data.orderEnginBaseId,projectName: res.data.projectName,projectNo: res.data.projectNo,manger: res.data.manger,mobile: res.data.mobile,startTime: res.data.startTime,endTime: res.data.endTime,province: res.data.province,provinceId: res.data.provinceId,city: res.data.city,cityId: res.data.cityId,area: res.data.area,areaId: res.data.areaId,street: res.data.street,streetId: res.data.streetId,address: res.data.address,lat: res.data.lat,lng: res.data.lng}
+						project: {id: res.data.orderEnginBaseId,projectName: res.data.projectName,projectNo: res.data.projectNo,manger: res.data.manger,mobile: res.data.mobile,startTime: res.data.startTime,endTime: res.data.endTime,province: res.data.province,provinceId: res.data.provinceId,city: res.data.city,cityId: res.data.cityId,area: res.data.area,areaId: res.data.areaId,street: res.data.street,streetId: res.data.streetId,address: res.data.address,lat: res.data.lat,lng: res.data.lng},
+						storage: {
+							storageId: res.data.storageId
+						}
 					})
 					this.getWorker()
 					this.getCategory(res.data.websitId)
+					this.getWarehouseList(res.data.websitId)
 					if(res.data.salesType == '工程'){
 						this.getProjectCollectionList(res.data.orderEnginBaseId)
 					}
@@ -533,6 +562,7 @@
 				this.formData.websitName = e.name
 				this.getWorker()
 				this.getCategory(e.websitId)
+				this.getWarehouseList(e.websitId)
 			},
 			getCategory(websitId){
 				getCategory({websitId}).then(res => {
@@ -553,6 +583,15 @@
 					this.projectList = res.data.records
 				})
 			},
+			getWarehouseList(websitId){
+				storageListPageV2({
+			      pageNum: 1,
+			      pageSize: -1,
+			      params: [{param: "a.type", compare: "like", value: "辅材"},{param: "a.status", compare: "=", value: "true"},{param: "a.websit_id", compare: "=", value: websitId}]
+			    }).then(res => {
+					this.warehouseList = res.data.records
+			    })
+			},
 			getProjectCollectionList(orderEnginBaseId){
 				getProjectCollectionList({orderEnginBaseId,goodsType: 'M'}).then(res => {
 					this.collectionList = res.data
@@ -714,7 +753,9 @@
 							buyPeople: this.formData.buyPeople,
 							items: this.dataList,
 							orderEnginBaseId: this.formData.orderEnginBaseId,
-							salesType: this.formData.salesType
+							salesType: this.formData.salesType,
+							storageId: this.formData.storageId,
+							storageName: this.formData.storageName,
 						}).then(res => {
 							if(res.code == 200){
 								this.$nextTick(() => {
@@ -805,7 +846,9 @@
 								buyPeople: this.formData.buyPeople,
 								items: this.dataList,
 								orderEnginBaseId: this.formData.orderEnginBaseId,
-								salesType: this.formData.salesType
+								salesType: this.formData.salesType,
+								storageId: this.formData.storageId,
+								storageName: this.formData.storageName,
 							}).then(res => {
 								if(res.code == 200){
 									this.$message.success('提交成功!')
@@ -828,7 +871,9 @@
 								buyPeople: this.formData.buyPeople,
 								items: this.dataList,
 								orderEnginBaseId: this.formData.orderEnginBaseId,
-								salesType: this.formData.salesType
+								salesType: this.formData.salesType,
+								storageId: this.formData.storageId,
+								storageName: this.formData.storageName,
 							}).then(res => {
 								if(res.code == 200){
 									this.dataList = []

+ 12 - 0
src/views/auxiliaryFittings/salesManagement/components/auxiliarySalesReturnOrderDetail.vue

@@ -99,6 +99,18 @@
 								<el-input type="text" :value="formData.payTime" disabled></el-input>
 							</el-form-item>
 						</el-col>
+						<el-col :span="6">
+							<el-form-item label="退货仓库" prop="storage">
+								<el-select v-model="formData.storage" value-key="storageId":disabled="true" placeholder="请选择" style="width: 100%;">
+								    <el-option
+									  v-for="(item,index) in warehouseList"
+								      :key="index"
+								      :label="item.storageName"
+								      :value="item">
+								    </el-option>
+								</el-select>
+							</el-form-item>
+						</el-col>
 						<template v-if="formData.salesType == '工程'">
 							<el-col :span="6">
 								<el-form-item label="工程名称" :required="true">

+ 1 - 1
src/views/salesPurchasing/mixins/common_form.js

@@ -302,7 +302,7 @@ export default {
 		storageListPageV2({
           pageNum: 1,
           pageSize: -1,
-          params: [{param: "a.type", compare: "like", value: "商品"}]
+          params: [{param: "a.type", compare: "like", value: "商品"},{param: "a.status", compare: "=", value: "true"}]
         }).then(res => {
 			if(JSON.parse(localStorage.getItem('greemall_user')).joinCode != "NO"){
 				this.formData.storageId = res.data.records[0].storageId