|
@@ -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 = []
|