|
@@ -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="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>
|
|
|
<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)
|
|
|
}
|
|
@@ -502,6 +531,7 @@
|
|
|
this.formData.websitId = e.websitId
|
|
|
this.formData.websitName = e.name
|
|
|
this.getWorker()
|
|
|
+ this.getWarehouseList(e.websitId)
|
|
|
},
|
|
|
toAddProject(){
|
|
|
this.$router.push({
|
|
@@ -522,18 +552,27 @@
|
|
|
this.collectionList = res.data
|
|
|
})
|
|
|
},
|
|
|
+ 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
|
|
|
+ })
|
|
|
+ },
|
|
|
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 +678,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()
|
|
@@ -727,7 +768,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 +793,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 = []
|