Sfoglia il codice sorgente

Merge branch 'pengyouhao_dev' into moss_dev

* pengyouhao_dev:
  no message
  no message
  no message
  no message
  no message
  no message
  no message
  no message
  no message
  no message
  no message
  辅配件增加仓库
  辅材销售订单增加仓库
  no message
  no message
  no message
  no message
  no message
Moss 1 anno fa
parent
commit
578f669f93

+ 1 - 1
src/views/auxiliaryFittings/salesManagement/attachmentSalesOrder/index.vue

@@ -278,7 +278,7 @@ export default {
 					<td>${item.salesQty || ''}</td>
 					<td>${item.price || ''}</td>
 					<td>${item.saleAmount || ''}</td>
-					<td></td>
+					<td>${data.storageName}</td>
 					<td></td>
 					</tr>
 				`

+ 1 - 1
src/views/auxiliaryFittings/salesManagement/auxiliarySalesOrder/index.vue

@@ -277,7 +277,7 @@ export default {
 					<td>${item.salesQty}</td>
 					<td>${item.price}</td>
 					<td>${item.saleAmount}</td>
-					<td></td>
+					<td>${data.storageName}</td>
 					<td></td>
 					</tr>
 				`

+ 49 - 4
src/views/auxiliaryFittings/salesManagement/components/attachmentNewReturnDetail.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">
@@ -410,6 +422,7 @@
 	import { listPageV2, getWorker, getCategory, getGoods, getDetail } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
 	import { add, edit, getNewDetail } from "@/api/auxiliaryFittings/attachmentNewReturn";
 	import { getGoodsList } from "@/api/auxiliaryFittings/auxiliarySalesReturnOrder";
+	import { storageListPageV2 } from '@/api/storage.js'
 	export default {
 		components: { ImageUpload, geographicalPosi },
 		props: ['id','title','formType'],
@@ -421,6 +434,7 @@
 				orderList: [],
 				goodsList: [],
 				mainList: [],
+				warehouseList: [],
 				isPay: false,
 				payCodeUrl: '',
 				formData: {
@@ -455,6 +469,9 @@
 					lat: '',
 					lng: '',
 					orderEnginBaseId: '',
+					storage: null,
+					storageId: '',
+					storageName: '',
 				},
 				formData1: {
 					websit_id: '',
@@ -508,9 +525,13 @@
 					Object.assign(this.formData, res.data, {
 						websit: {websitId: res.data.websitId,name: res.data.websitName},
 						worker: {nickName: res.data.workerName,userId: res.data.workerId},
-						fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(",").map(item=>({url:item})) : []
+						fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(",").map(item=>({url:item})) : [],
+						storage: {
+							storageId: res.data.storageId
+						}
 					})
 					this.getWorker()
+					this.getWarehouseList(res.data.websitId)
 					for(var item of res.data.items){
 						var ress = await that.getGoods(item.goodsName, 1)
 						item.goods = {...ress.data,oldPrice:ress.data.price}
@@ -526,9 +547,13 @@
 					Object.assign(this.formData, res.data, {
 						websit: {websitId: res.data.websitId,name: res.data.websitName},
 						worker: {nickName: res.data.workerName,userId: res.data.workerId},
-						fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(",").map(item=>({url:item})) : []
+						fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(",").map(item=>({url:item})) : [],
+						storage: {
+							storageId: res.data.storageId
+						}
 					})
 					this.getWorker()
+					this.getWarehouseList(res.data.websitId)
 					for(var item of res.data.websitPartsRetItemList){
 						var ress = await that.getGoods(item.goodsName, 1)
 						item.goods = {...ress.data,oldPrice:ress.data.price}
@@ -542,6 +567,16 @@
 					this.websitList = res.data
 				})
 			},
+			getWarehouseList(websitId){
+				if(!websitId){return this.warehouseList = []}
+				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
+			    })
+			},
 			close(){
 				this.$refs.formData1.resetFields();
 			},
@@ -604,14 +639,14 @@
 				const that = this
 				if(type == 1){
 					return new Promise((resolve, reject) => {
-						getGoods({websitId: this.formData.websitId,type: 'P',goodsName: goodsName,orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType}).then(res => {
+						getGoods({websitId: this.formData.websitId,type: 'P',goodsName: goodsName,orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType,storageId: this.formData.storageId}).then(res => {
 							resolve({
 								data: res.data[0]
 							})
 						})
 					})
 				}else{
-					getGoods({websitId: this.formData.websitId,type: 'P',orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType}).then(res => {
+					getGoods({websitId: this.formData.websitId,type: 'P',orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType,storageId: this.formData.storageId}).then(res => {
 						that.dataList[that.isEdit].goodsList = res.data
 						console.log(this.dataList)
 					})
@@ -721,6 +756,8 @@
 						workerMobile: this.formData.workerMobile,
 						websitPartsRetItems: this.dataList,
 						fileUrl: this.formData.fileUrl.map(item=>item.url).join(","),
+						storageId: this.formData.storageId,
+						storageName: this.formData.storageName,
 					}).then(res => {
 						if(res.code == 200){
 							this.$message.success('提交成功!')
@@ -748,6 +785,8 @@
 								workerMobile: this.formData.workerMobile,
 								websitPartsRetItems: this.dataList,
 								fileUrl: this.formData.fileUrl.map(item=>item.url).join(","),
+								storageId: this.formData.storageId,
+								storageName: this.formData.storageName,
 							}).then(res => {
 								if(res.code == 200){
 									this.$message.success('提交成功!')
@@ -769,6 +808,8 @@
 								workerMobile: this.formData.workerMobile,
 								websitPartsRetItems: this.dataList,
 								fileUrl: this.formData.fileUrl.map(item=>item.url).join(","),
+								storageId: this.formData.storageId,
+								storageName: this.formData.storageName,
 							}).then(res => {
 								if(res.code == 200){
 									this.dataList = []
@@ -898,4 +939,8 @@
 			margin-top: 10px;
 		}
 	}
+	::v-deep .el-table__body-wrapper{
+		max-height: 300px !important;
+		overflow-y: auto !important;
+	}
 </style>

+ 49 - 4
src/views/auxiliaryFittings/salesManagement/components/attachmentOldReturnDetail.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">
@@ -480,6 +492,7 @@
 	import { listPageV2, getWorker, getCategory, getGoods, getDetail } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
 	import { add, edit, getNewDetail, getAttachmentList } from "@/api/auxiliaryFittings/attachmentNewReturn";
 	import { getGoodsList } from "@/api/auxiliaryFittings/auxiliarySalesReturnOrder";
+	import { storageListPageV2 } from '@/api/storage.js'
 	export default {
 		components: { ImageUpload },
 		props: ['id','title','formType'],
@@ -492,6 +505,7 @@
 				orderList: [],
 				goodsList: [],
 				attachmentList: [],
+				warehouseList: [],
 				mainList: [],
 				isPay: false,
 				payCodeUrl: '',
@@ -529,6 +543,9 @@
 					lat: '',
 					lng: '',
 					orderEnginBaseId: '',
+					storage: null,
+					storageId: '',
+					storageName: '',
 				},
 				formData1: {
 					websit_id: '',
@@ -581,9 +598,13 @@
 					Object.assign(this.formData, res.data, {
 						websit: {websitId: res.data.websitId,name: res.data.websitName},
 						worker: {nickName: res.data.workerName,userId: res.data.workerId},
-						fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(",").map(item=>({url:item})) : []
+						fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(",").map(item=>({url:item})) : [],
+						storage: {
+							storageId: res.data.storageId
+						}
 					})
 					this.getWorker()
+					this.getWarehouseList(res.data.websitId)
 					for(var item of res.data.items){
 						var ress = await that.getGoods(item.goodsName, 1)
 						item.goods = {...ress.data,oldPrice:ress.data.price}
@@ -600,9 +621,13 @@
 					Object.assign(this.formData, res.data, {
 						websit: {websitId: res.data.websitId,name: res.data.websitName},
 						worker: {nickName: res.data.workerName,userId: res.data.workerId},
-						fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(",").map(item=>({url:item})) : []
+						fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(",").map(item=>({url:item})) : [],
+						storage: {
+							storageId: res.data.storageId
+						}
 					})
 					this.getWorker()
+					this.getWarehouseList(res.data.websitId)
 					for(var item of res.data.websitPartsRetItemList){
 						var ress = await that.getGoods(item.goodsName, 1)
 						item.goods = {...ress.data,oldPrice:ress.data.price}
@@ -622,6 +647,16 @@
 					this.websitList = res.data
 				})
 			},
+			getWarehouseList(websitId){
+				if(!websitId){return this.warehouseList = []}
+				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
+			    })
+			},
 			close(){
 				this.$refs.formData1.resetFields();
 			},
@@ -684,14 +719,14 @@
 				const that = this
 				if(type == 1){
 					return new Promise((resolve, reject) => {
-						getGoods({websitId: this.formData.websitId,type: 'P',goodsName: goodsName,orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType}).then(res => {
+						getGoods({websitId: this.formData.websitId,type: 'P',goodsName: goodsName,orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType,storageId: this.formData.storageId}).then(res => {
 							resolve({
 								data: res.data[0]
 							})
 						})
 					})
 				}else{
-					getGoods({websitId: this.formData.websitId,type: 'P',orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType}).then(res => {
+					getGoods({websitId: this.formData.websitId,type: 'P',orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType,storageId: this.formData.storageId}).then(res => {
 						that.dataList[that.isEdit].goodsList = res.data
 						console.log(this.dataList)
 					})
@@ -823,6 +858,8 @@
 						websitPartsRetOldRecordList: this.oldList,
 						orderUseType: this.formData.orderUseType,
 						fileUrl: this.formData.fileUrl.map(item=>item.url).join(","),
+						storageId: this.formData.storageId,
+						storageName: this.formData.storageName,
 					}).then(res => {
 						if(res.code == 200){
 							this.$message.success('提交成功!')
@@ -853,6 +890,8 @@
 								websitPartsRetOldRecordList: this.oldList,
 								orderUseType: this.formData.orderUseType,
 								fileUrl: this.formData.fileUrl.map(item=>item.url).join(","),
+								storageId: this.formData.storageId,
+								storageName: this.formData.storageName,
 							}).then(res => {
 								if(res.code == 200){
 									this.$message.success('提交成功!')
@@ -876,6 +915,8 @@
 								websitPartsRetOldRecordList: this.oldList,
 								orderUseType: this.formData.orderUseType,
 								fileUrl: this.formData.fileUrl.map(item=>item.url).join(","),
+								storageId: this.formData.storageId,
+								storageName: this.formData.storageName,
 							}).then(res => {
 								if(res.code == 200){
 									this.dataList = []
@@ -929,4 +970,8 @@
 			margin-top: 10px;
 		}
 	}
+	::v-deep .el-table__body-wrapper{
+		max-height: 300px !important;
+		overflow-y: auto !important;
+	}
 </style>

+ 57 - 7
src/views/auxiliaryFittings/salesManagement/components/attachmentSalesOrderDetail.vue

@@ -122,6 +122,23 @@
 						<el-col :span="2" v-else>
 							<div style="opacity: 0;">隐藏</div>
 						</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="(['SAVE','PAY_NOT_TAKE'].indexOf(formData.flag) == -1 && formData.orderSource == 'ONLINE') || (formType!=0 && ['SAVE','PAY_NOT_TAKE'].indexOf(formData.flag) == -1)" 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="8">
 								<el-form-item label="工程名称" prop="project" :required="true">
@@ -365,6 +382,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'],
@@ -375,6 +393,7 @@
 				workerList: [],
 				projectList: [],
 				collectionList: [],
+				warehouseList: [],
 				isPay: false,
 				is_submit: true,
 				payCodeUrl: '',
@@ -413,6 +432,9 @@
 					lng: '',
 					project: {},
 					orderEnginBaseId: '',
+					storage: null,
+					storageId: '',
+					storageName: '',
 				},
 				formData1: {
 					price: '',
@@ -451,6 +473,9 @@
 					workerName: [
 						{ required: true, message: '请输入客户姓名', trigger: 'blur' }
 					],
+					storage: [
+						{ required: true, message: `请选择入库仓库`, trigger: 'change' },
+					]
 				},
 				rules1: {
 					price: [
@@ -479,9 +504,13 @@
 					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.getWarehouseList(res.data.websitId)
 					if(res.data.salesType == '工程'){
 						this.getProjectCollectionList(res.data.orderEnginBaseId)
 					}
@@ -501,7 +530,10 @@
 			changeWebsit(e){
 				this.formData.websitId = e.websitId
 				this.formData.websitName = e.name
+				this.formData.storageName = ''
+				this.formData.storageId = ''
 				this.getWorker()
+				this.getWarehouseList(e.websitId)
 			},
 			toAddProject(){
 				this.$router.push({
@@ -522,18 +554,28 @@
 					this.collectionList = res.data
 				})
 			},
+			getWarehouseList(websitId){
+				if(!websitId){return this.warehouseList = []}
+				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
+			    })
+			},
 			async getGoods(goodsName,type){
 				const that = this
 				if(type == 1){
 					return new Promise((resolve, reject) => {
-						getGoods({websitId: this.formData.websitId,type: 'P',goodsName: goodsName,orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType}).then(res => {
+						getGoods({websitId: this.formData.websitId,type: 'P',goodsName: goodsName,orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType,storageId: this.formData.storageId}).then(res => {
 							resolve({
 								data: res.data[0]
 							})
 						})
 					})
 				}else{
-					getGoods({websitId: this.formData.websitId,type: 'P',orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType}).then(res => {
+					getGoods({websitId: this.formData.websitId,type: 'P',orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType,storageId: this.formData.storageId}).then(res => {
 						that.dataList[that.isEdit].goodsList = res.data
 						console.log(this.dataList)
 					})
@@ -639,7 +681,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.confirmSubmit()
@@ -649,13 +693,15 @@
 				})
 			},
 			confirm(){
+				if(!this.formData.storageId){return this.$message.warning('请先选择出库仓库!')}
 				this.$confirm(`请确定是否确认提货, 是否继续?`, '提示', {
 					confirmButtonText: '确定',
 					cancelButtonText: '取消',
 					type: 'warning'
 				}).then(() => {
 					confirm({
-						salesId: this.formData.salesId
+						salesId: this.formData.salesId,
+						storageId: this.formData.storageId
 					}).then(res => {
 						if(res.code == 200){
 							this.$message.success('审核成功!')
@@ -727,7 +773,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('提交成功!')
@@ -750,7 +798,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 = []

+ 60 - 8
src/views/auxiliaryFittings/salesManagement/components/auxiliarySalesOrderDetail.vue

@@ -122,6 +122,23 @@
 						<el-col :span="2" v-else>
 							<div style="opacity: 0;">隐藏</div>
 						</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="(['SAVE','PAY_NOT_TAKE'].indexOf(formData.flag) == -1 && formData.orderSource == 'ONLINE') || (formType!=0 && ['SAVE','PAY_NOT_TAKE'].indexOf(formData.flag) == -1)" 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="8">
 								<el-form-item label="工程名称" prop="project" :required="true">
@@ -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)
 					}
@@ -531,8 +560,11 @@
 			changeWebsit(e){
 				this.formData.websitId = e.websitId
 				this.formData.websitName = e.name
+				this.formData.storageName = ''
+				this.formData.storageId = ''
 				this.getWorker()
 				this.getCategory(e.websitId)
+				this.getWarehouseList(e.websitId)
 			},
 			getCategory(websitId){
 				getCategory({websitId}).then(res => {
@@ -553,23 +585,34 @@
 					this.projectList = res.data.records
 				})
 			},
+			getWarehouseList(websitId){
+				if(!websitId){return this.warehouseList = []}
+				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
 				})
 			},
 			async getGoods(categoryId,goodsName,type){
+				// if(!this.formData.storageId){return this.$message.warning('请先选择出库仓库!')}
 				const that = this
 				if(type == 1){
 					return new Promise((resolve, reject) => {
-						getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M',goodsName: goodsName,orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType}).then(res => {
+						getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M',goodsName: goodsName,orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType,storageId: this.formData.storageId}).then(res => {
 							resolve({
 								data: res.data[0]
 							})
 						})
 					})
 				}else{
-					getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M',orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType}).then(res => {
+					getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M',orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType,storageId: this.formData.storageId}).then(res => {
 						that.dataList[that.isEdit].goodsList = res.data
 					})
 				}
@@ -622,7 +665,8 @@
 				this.dataList[this.isEdit].qty = '',
 				this.dataList[this.isEdit].goodsCategoryId = e.categoryId
 				this.dataList[this.isEdit].goodsCategoryName = e.categoryName
-				getGoods({websitId: this.formData.websitId,categoryId: e.categoryId,type: 'M',orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType}).then(res => {
+				// if(!this.formData.storageId){return this.$message.warning('请先选择出库仓库!')}
+				getGoods({websitId: this.formData.websitId,categoryId: e.categoryId,type: 'M',orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType,storageId: this.formData.storageId}).then(res => {
 					this.dataList[this.isEdit].goodsList = res.data
 				})
 			},
@@ -714,7 +758,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(() => {
@@ -727,13 +773,15 @@
 				})
 			},
 			confirm(){
+				if(!this.formData.storageId){return this.$message.warning('请先选择出库仓库!')}
 				this.$confirm(`请确定是否确认提货, 是否继续?`, '提示', {
 					confirmButtonText: '确定',
 					cancelButtonText: '取消',
 					type: 'warning'
 				}).then(() => {
 					confirm({
-						salesId: this.formData.salesId
+						salesId: this.formData.salesId,
+						storageId: this.formData.storageId
 					}).then(res => {
 						if(res.code == 200){
 							this.$message.success('审核成功!')
@@ -805,7 +853,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 +878,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 = []

+ 47 - 4
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">
@@ -433,6 +445,7 @@
 	import ImageUpload from '@/components/file-upload'
 	import { listPageV2, getWorker, getCategory, getGoods, getDetail } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
 	import { add, edit, getReturnDetail, getGoodsList } from "@/api/auxiliaryFittings/auxiliarySalesReturnOrder";
+	import { storageListPageV2 } from '@/api/storage.js'
 	export default {
 		components: { ImageUpload, geographicalPosi },
 		props: ['id','title','formType'],
@@ -445,6 +458,7 @@
 				goodsList: [],
 				mainList: [],
 				projectList: [],
+				warehouseList: [],
 				isPay: false,
 				payCodeUrl: '',
 				salesDetail: {},
@@ -480,6 +494,9 @@
 					lat: '',
 					lng: '',
 					orderEnginBaseId: '',
+					storage: null,
+					storageId: '',
+					storageName: '',
 				},
 				formData1: {
 					websit_id: '',
@@ -537,10 +554,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},
-						fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(",").map(item=>({url:item})) : []
+						fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(",").map(item=>({url:item})) : [],
+						storage: {
+							storageId: res.data.storageId
+						}
 					})
 					this.getWorker()
 					this.getCategory(res.data.websitId)
+					this.getWarehouseList(res.data.websitId)
 					for(var item of res.data.items){
 						item.parentCategory = {categoryId: item.parentCategoryId,categoryName: item.parentCategoryName,items: [{categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}]}
 						item.goodsCategory = {categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}
@@ -558,10 +579,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},
-						fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(",").map(item=>({url:item})) : []
+						fileUrl: res.data?.fileUrl ? res.data?.fileUrl?.split(",").map(item=>({url:item})) : [],
+						storage: {
+							storageId: res.data.storageId
+						}
 					})
 					this.getWorker()
 					this.getCategory(res.data.websitId)
+					this.getWarehouseList(res.data.websitId)
 					for(var item of res.data.websitSalesRetItems){
 						item.parentCategory = {categoryId: item.parentCategoryId,categoryName: item.parentCategoryName,items: [{categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}]}
 						item.goodsCategory = {categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}
@@ -577,6 +602,16 @@
 					this.websitList = res.data
 				})
 			},
+			getWarehouseList(websitId){
+				if(!websitId){return this.warehouseList = []}
+				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
+			    })
+			},
 			close(){
 				this.$refs.formData1.resetFields();
 			},
@@ -642,14 +677,14 @@
 				const that = this
 				if(type == 1){
 					return new Promise((resolve, reject) => {
-						getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M',goodsName: goodsName,orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType}).then(res => {
+						getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M',goodsName: goodsName,orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType,storageId: this.formData.storageId}).then(res => {
 							resolve({
 								data: res.data[0]
 							})
 						})
 					})
 				}else{
-					getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M',orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType}).then(res => {
+					getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M',orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType,storageId: this.formData.storageId}).then(res => {
 						that.dataList[that.isEdit].goodsList = res.data
 					})
 				}
@@ -780,6 +815,8 @@
 								workerMobile: this.formData.workerMobile,
 								websitSalesRetItems: this.dataList,
 								fileUrl: this.formData.fileUrl.map(item=>item.url).join(","),
+								storageId: this.formData.storageId,
+								storageName: this.formData.storageName,
 							}).then(res => {
 								if(res.code == 200){
 									this.$message.success('提交成功!')
@@ -800,6 +837,8 @@
 								workerMobile: this.formData.workerMobile,
 								websitSalesRetItems: this.dataList,
 								fileUrl: this.formData.fileUrl.map(item=>item.url).join(","),
+								storageId: this.formData.storageId,
+								storageName: this.formData.storageName,
 							}).then(res => {
 								if(res.code == 200){
 									this.dataList = []
@@ -929,4 +968,8 @@
 			margin-top: 10px;
 		}
 	}
+	::v-deep .el-table__body-wrapper{
+		max-height: 300px !important;
+		overflow-y: auto !important;
+	}
 </style>

+ 4 - 1
src/views/auxiliaryFittings/salesManagement/oldPartsReturnFactory/index.vue

@@ -122,7 +122,9 @@ export default {
         "workerMobile": "",
         "workerName": "",
         "workerWebsitId": "",
-        "workerWebsitName": ""
+        "workerWebsitName": "",
+		storageId: '',
+		storageName: ''
       },
       isShowTab: true,
       flag: this?.$route?.params?.pageCode || '',
@@ -205,6 +207,7 @@ export default {
     openForm() {
       this.getWebsitList()
       this.getProductSel()
+	  this.getWarehouseList()
     },
     // 保存
     quedingbaocun(removeTab) {

+ 51 - 2
src/views/auxiliaryFittings/salesManagement/oldPartsReturnFactory/mixins/basicInfo.js

@@ -1,10 +1,12 @@
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
 import { getWebsit } from "@/api/customerManagement.js"
 import ImageUpload from '@/components/file-upload'
+import { storageListPageV2 } from '@/api/storage.js'
 export default {
   data() {
     return {
-      websitList: []
+      websitList: [],
+			warehouseList: []
     }
   },
   computed: {
@@ -66,13 +68,16 @@ export default {
             change: (val) => {
               this.formData.websitName = this.websitList.find(item => item.value == val)?.label || ""
               this.formData.websitPartsRetItems = []
+			  this.formData.storageName = ''
+			  this.formData.storageId = ''
               this.getProductSel()
+			  this.getWarehouseList()
             }
           }
         },
         {
           name: 'el-input',
-          md: 12,
+          md: 6,
           attributes: {
             placeholder: '请输入',
             disabled: this.openType == 1 || !!~["OK", "FAIL"].indexOf(this.formData.flag)
@@ -94,6 +99,40 @@ export default {
             prop: 'factoryAddress',
           },
         },
+		{
+		  name: 'slot-component',
+		  md: 6,
+		  formItemAttributes: {
+		    label: '出库仓库',
+		    prop: 'storageId',
+		    rules: [...required],
+		  },
+		  render: (h, { props, onInput }) => {
+		    var { value } = props
+		    return (
+				<el-select
+					style="width:100%"
+					value={this.formData.storageId}
+					onInput={val => {
+						this.formData.storageId = val
+					}}
+					placeholder="请选择"
+					disabled={this.openType == 1 || !!~["OK", "FAIL"].indexOf(this.formData.flag)}
+					onChange={val => {
+						if (val) {
+							this.formData['storageName'] = this.warehouseList.find(item => item.storageId == val).storageName
+						} else {
+							this.formData['storageName'] = ''
+						}
+					}}
+				>
+					{this.warehouseList.map(item => (
+					<el-option key={item.storageId} label={item.storageName} value={item.storageId}></el-option>
+					))}
+				</el-select>
+			)
+		  }
+		},
         {
           name: 'el-input',
           md: 6,
@@ -180,5 +219,15 @@ export default {
         }))
       })
     },
+	getWarehouseList(){
+		if(!this.formData.websitId){return this.warehouseList = []}
+		storageListPageV2({
+	        pageNum: 1,
+	        pageSize: -1,
+	        params: [{param: "a.type", compare: "like", value: "配件"},{param: "a.status", compare: "=", value: "true"},{param: "a.websit_id", compare: "=", value: this.formData.websitId}]
+	      }).then(res => {
+			this.warehouseList = res.data.records
+	      })
+	}
   }
 }

+ 2 - 1
src/views/auxiliaryFittings/salesManagement/oldPartsReturnFactory/mixins/productColumns.js

@@ -96,7 +96,8 @@ export default {
                   }}
                   type="number"
                   placeholder="请输入"
-                  disabled={this.openType == 1 || !!~["OK", "FAIL"].indexOf(this.formData.flag)}
+                  // disabled={this.openType == 1 || !!~["OK", "FAIL"].indexOf(this.formData.flag)}
+				  disabled={this.openType > 0 && this.formData.flag != 'SAVE'}
                 ></el-input>
               </el-form-item>
             </div>

+ 5 - 2
src/views/mallManagement/order/order_detail/index.vue

@@ -226,9 +226,9 @@
         <el-table-column prop="refundTime" label="退款时间" align="center" min-width="160"></el-table-column>
         <el-table-column label="操作" align="center" width="160" v-if="orderDetail.orderStatus != 'CLOSE' && orderDetail.payTypeId == 'WECHAT'">
           <template slot-scope="scope">
-            <el-button v-if="!~['TIMEOUT', 'CLOSE'].indexOf(orderDetail.orderStatus)" size="mini" type="primary"
+            <!-- <el-button v-if="!~['TIMEOUT', 'CLOSE'].indexOf(orderDetail.orderStatus)" size="mini" type="primary"
               @click="handleRefund(scope.row)"
-              :disabled="!orderDetail.refundAble || scope.row.refundNum >= scope.row.num">退款</el-button>
+              :disabled="!orderDetail.refundAble || scope.row.refundNum >= scope.row.num">退款</el-button> -->
             <el-button v-if="!~['TIMEOUT'].indexOf(orderDetail.orderStatus)" size="mini"
               @click="handleCompensate(scope.row)">理赔</el-button>
           </template>
@@ -270,6 +270,9 @@
           <el-table-column prop="createTime" align="center" label="操作时间" width="160"></el-table-column>
           <el-table-column align="center" label="操作" fixed="right">
             <template slot-scope="scope">
+			  <el-button v-if="!~['TIMEOUT', 'CLOSE'].indexOf(orderDetail.orderStatus)" size="mini" type="text"
+			    @click="handleRefund(scope.row)" :disabled="!orderDetail.refundAble || scope.row.refundNum >= scope.row.num">退款
+			  </el-button>
               <el-button type="text" size="small" @click="returnOrder(scope.row.deliveryId)">发起退货</el-button>
             </template>
           </el-table-column>

+ 24 - 11
src/views/mallManagement/order/order_list/index.vue

@@ -366,7 +366,10 @@
 							<el-form-item label="仓储" prop="storageId" v-if="logisticsType != 'edit'"
 							  :rules="joinCode == 'NO' ? [] : [{ required: true, message: '请选择仓储', trigger: 'change' }]">
 							  <el-input v-if="logisticsType == 'detail'" v-model="logisticsForm.storageName" :disabled="true" placeholder="请输入提货人"></el-input>
-							  <el-select v-else v-model="logisticsForm.storageId" placeholder="请选择仓储" style="width: 100%;">
+							  <el-select v-else v-model="logisticsForm.storageId" @change="(e)=>{
+								  logisticsForm.storageName = storageList.find(item => item.storageId == e).storageName
+								  getOrderDetail()
+							  }" placeholder="请选择仓储" style="width: 100%;">
 							    <el-option :label="item.storageName" :value="item.storageId" v-for="(item, index) in storageList"
 							      :key="index"></el-option>
 							  </el-select>
@@ -391,7 +394,7 @@
 						<el-col :span="24">
 							<el-card class="box-card">
 								<el-tabs v-model="typeIndex" @tab-click="changeType">
-								    <el-tab-pane label="发货数量" name="1"></el-tab-pane>
+								    <el-tab-pane v-if="orderDetail.orderStatus != 'YFH' && orderDetail.orderStatus != 'OVER'" label="发货数量" name="1"></el-tab-pane>
 								    <el-tab-pane v-if="joinCode == 'CODE'" label="发货条码" name="2"></el-tab-pane>
 								    <el-tab-pane label="发货记录" name="3"></el-tab-pane>
 								</el-tabs>
@@ -414,11 +417,19 @@
 													{{scope.row.goodsMaterialUnit == 'C' ? '整套' : scope.row.goodsMaterialUnit == 'I' ? '单个' : ''}}
 												</template>
 											</el-table-column>
-											<el-table-column prop="num" align="center" label="数量">
-                        <template slot-scope="scope">
-                          <el-input v-model="scope.row.num" placeholder="请输入" type="number"></el-input>
-                        </template>
-                      </el-table-column>
+											<el-table-column prop="num" align="center" label="订单数量">
+												<template slot-scope="scope">
+													<el-input v-model="scope.row.num" placeholder="请输入" type="number"></el-input>
+												</template>
+											</el-table-column>
+											<el-table-column prop="sendStockNum" align="center" label="发货数量"></el-table-column>
+											<el-table-column v-if="joinCode != 'NO'" prop="" align="center" label="发货仓库">
+												<template slot-scope="scope">
+													{{logisticsForm.storageName}}
+												</template>
+											</el-table-column>
+											<el-table-column v-if="joinCode != 'NO'" prop="stockOnQty" align="center" label="发货仓库库存"></el-table-column>
+											<el-table-column v-if="joinCode != 'NO'" prop="allStockQty" align="center" label="库存总数量"></el-table-column>
 											<el-table-column prop="stockNum" align="center" label="库存数量"></el-table-column>
 											<el-table-column prop="insideNum" align="center" label="内机数量"></el-table-column>
 											<el-table-column prop="outNum" align="center" label="外机数量"></el-table-column>
@@ -818,6 +829,7 @@ export default {
       billTitle: JSON.parse(localStorage.getItem('greemall_user')).billTitle,//打印名称
 
       deliverSelection: [],
+	  orderDetail: {}
     }
   },
   computed: {
@@ -905,7 +917,7 @@ export default {
       })
     },
 	getOrderDetail(){
-		getOrderDetail({orderId: this.editOrderId}).then(res => {
+		getOrderDetail({orderId: this.editOrderId,storageId: this.logisticsForm.storageId}).then(res => {
 			// let arr = []
 			// res.data.orderDetails.forEach(item=>{
 			// 	if(item.goodsMaterialId){
@@ -1186,14 +1198,15 @@ export default {
     },
     // 显示快递信息填写
     showLogistics(item, type) {
+		this.orderDetail = item
 			this.logisticsType = type;
 			this.logisticsIdVisible = true;
 			this.editOrderId = item.orderId;
 			if(type == 'add'){
 				this.getOrderDetail()
 				this.getCodeDetail()
-        this.getDeliverList();
-        this.getStorageList();
+				this.getDeliverList();
+				this.getStorageList();
 				this.openForm('deliverGoods',item)
 			}else if(type == 'edit'){
 				this.openForm('editExpressage',item)
@@ -1209,7 +1222,7 @@ export default {
 				this.logisticsForm.pickPhone = item.pickPhone
 				this.getOrderDetail()
 				this.getCodeDetail()
-        this.getDeliverList();
+				this.getDeliverList();
 				this.openForm('deliverGoodsDetail',item)
 			}
     },

+ 10 - 1
src/views/salesPurchasing/goodsPurchasedStored/index.vue

@@ -102,6 +102,8 @@ export default {
         updateTime: '',
         venderId: '',
         venderName: '',
+		storageId: '',
+		storageName: '',
         fileUrl: [],
         items: [],
         codeInfoList: []
@@ -206,6 +208,7 @@ export default {
     openForm() {
       this.isEditIndex = -1
       this.getGysList()
+	  this.getWarehouseList()
       this.getBaseList()
     },
     // 打开详情弹窗
@@ -290,6 +293,12 @@ export default {
     save() {
       this.$refs.formRef.validateField(this.getVfyKey(this.isEditIndex), (valid, invalidFields, errLabels) => {
         if (valid && this.eidtItems()) {
+			if(!this.formData.storageId && JSON.parse(localStorage.getItem('greemall_user')).joinCode != "NO"){
+				return this.$message({
+					type: 'warning',
+					message: '仓库不能为空'
+				})
+			}
           goodsPurchaseAdd({
             ...this.formData,
             items: this.formData.items.map((item, index) => ({ ...item, index: index + 1 })),
@@ -327,7 +336,7 @@ export default {
       }).then(res => {
         this.$message({
           type: 'success',
-          message: '审核成功'
+          message: '操作成功'
         })
         this.handleClose()
         this.$refs.pageRef.refreshList()

+ 1 - 0
src/views/salesPurchasing/merchandisePurchaseReturn/index.vue

@@ -203,6 +203,7 @@ export default {
     openForm() {
       this.isEditIndex = -1
       this.getGysList()
+	  this.getWarehouseList()
       this.getCgrkOrder()
     },
     // 打开详情弹窗

+ 47 - 3
src/views/salesPurchasing/mixins/common_form.js

@@ -1,11 +1,13 @@
 import { required, diyRequired } from '@/components/template/rules_verify.js'
 import { listPageV2 } from '@/api/auxiliaryFittings/supplier'
 import { goodsPurchaseList, goodsPurchaseDetail } from '@/api/goodsPurchasedStored.js'
+import { storageListPageV2 } from '@/api/storage.js'
 import ImageUpload from '@/components/file-upload'
 export default {
   data() {
     return {
       gysList: [],
+	  warehouseList: [],
       cgrkOrder: []
     }
   },
@@ -44,10 +46,10 @@ export default {
                 <el-descriptions
                   border
                   title=""
-                  column={2}
+                  column={3}
                   colon={false}
                   labelStyle={{ width: '8%' }}
-                  contentStyle={{ width: '42%' }}
+                  contentStyle={{ width: '25%' }}
                   style="margin-top:-1px"
                 >
                   <el-descriptions-item label="*供应商名称">
@@ -88,6 +90,32 @@ export default {
                       </el-form-item>
                     </div>
                   </el-descriptions-item>
+					<el-descriptions-item label={(JSON.parse(localStorage.getItem('greemall_user')).joinCode === "NO"?'':'*') + (!!~['merchandisePurchaseReturn'].indexOf(this?.$route?.name) ?'出库仓库':'入库仓库')}>
+					<div class="redbordererr">
+						<el-form-item label="" lebel-width="0px" prop={`storageId`}>
+						<el-select
+							style="width:100%"
+							value={this.formData.storageId}
+							onInput={val => {
+							this.formData.storageId = val
+							}}
+							placeholder="请选择"
+							disabled={!!~['WAIT', 'OK', 'FAIL'].indexOf(this.formData.status) || !!~['merchandisePurchaseReturn'].indexOf(this?.$route?.name) || JSON.parse(localStorage.getItem('greemall_user')).joinCode === "NO"}
+							onChange={val => {
+								if (val) {
+									this.formData['storageName'] = this.warehouseList.find(item => item.storageId == val).storageName
+								} else {
+									this.formData['storageName'] = ''
+								}
+							}}
+						>
+							{this.warehouseList.map(item => (
+							<el-option key={item.storageId} label={item.storageName} value={item.storageId}></el-option>
+							))}
+						</el-select>
+						</el-form-item>
+					</div>
+					</el-descriptions-item>
                   {!!~['merchandisePurchaseReturn'].indexOf(this?.$route?.name) ? (
                     <el-descriptions-item label="*采购入库单">
                       <div class="redbordererr">
@@ -113,6 +141,9 @@ export default {
                               if (val) {
                                 goodsPurchaseDetail({ id: val, isQuery: true }).then(res => {
                                   this.joinCode = res.data.joinCode === "CODE"
+								  this.formData.storageId = res.data.storageId
+								  this.formData.storageName = res.data.storageName
+								  this.getWarehouseList()
                                   this.formData.items = res.data.items.map(item => ({
                                     brandId: item.brandId,
                                     brandName: item.brandName,
@@ -266,6 +297,19 @@ export default {
           }
         })
       }
-    }
+    },
+	getWarehouseList(){
+		storageListPageV2({
+          pageNum: 1,
+          pageSize: -1,
+          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){
+				this.formData.storageId = res.data.records[0].storageId
+				this.formData.storageName = res.data.records[0].storageName
+			}
+          this.warehouseList = res.data.records
+        })
+	}
   }
 }