|
@@ -74,20 +74,100 @@
|
|
|
</el-col>
|
|
|
</template>
|
|
|
<el-col :span="8">
|
|
|
+ <el-form-item label="销售类型" :required="true" style="padding-bottom: 1px;">
|
|
|
+ <el-radio-group v-model="formData.salesType">
|
|
|
+ <el-radio disabled label="零售">零售</el-radio>
|
|
|
+ <el-radio disabled label="工程">工程</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
<el-form-item label="销售订单号" :required="true">
|
|
|
<el-input type="text" v-model="formData.salesId" @change="getDetail" placeholder="请输入销售订单号"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
+ <el-col :span="5">
|
|
|
<el-form-item label="销售金额">
|
|
|
<el-input type="text" :value="formData.totalAmount" disabled></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="6">
|
|
|
+ <el-col :span="5">
|
|
|
<el-form-item label="时间">
|
|
|
<el-input type="text" :value="formData.payTime" disabled></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <template v-if="formData.salesType == '工程'">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="工程名称" :required="true">
|
|
|
+ <el-input type="text" :value="formData.projectName" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="工程编号" :required="true">
|
|
|
+ <el-input type="text" :disabled="true" v-model="formData.projectNo" placeholder="请输入"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="负责人" :required="true">
|
|
|
+ <el-input type="text" :disabled="true" v-model="formData.projectNo" placeholder="请输入"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="联系电话" :required="true">
|
|
|
+ <el-input type="text" :disabled="true" v-model="formData.projectNo" placeholder="请输入"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="项目时间" :required="true">
|
|
|
+ <el-date-picker
|
|
|
+ style="width:50%"
|
|
|
+ v-model="formData.startTime"
|
|
|
+ type="date"
|
|
|
+ :disabled="true"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="开始日期">
|
|
|
+ </el-date-picker>
|
|
|
+ <el-date-picker
|
|
|
+ style="width:50%"
|
|
|
+ v-model="formData.endTime"
|
|
|
+ type="date"
|
|
|
+ :disabled="true"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="结束日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="项目地址" prop="province" :required="true">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="5" style="margin-right: 12px;">
|
|
|
+ <el-input type="text" v-model="formData.province" disabled placeholder="请选择省"></el-input>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5" style="margin-right: 12px;">
|
|
|
+ <el-input type="text" v-model="formData.city" disabled placeholder="请选择市"></el-input>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5" style="margin-right: 12px;">
|
|
|
+ <el-input type="text" v-model="formData.area" disabled placeholder="请选择区"></el-input>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-input type="text" v-model="formData.street" disabled placeholder="请选择街道"></el-input>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="" prop="address">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-input type="text" v-model="formData.address" :disabled="true" placeholder="详细地址"></el-input>
|
|
|
+ </el-col>
|
|
|
+ <!-- <el-col :span="2">
|
|
|
+ <geographicalPosi :disabled="formType==2" :formData="this.formData" @selectPosi="selectAddress"/>
|
|
|
+ </el-col> -->
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </template>
|
|
|
<el-col :span="6" v-if="id">
|
|
|
<el-form-item label="制单人">
|
|
|
<el-input type="text" :value="formData.createBy" disabled></el-input>
|
|
@@ -212,11 +292,13 @@
|
|
|
|
|
|
<script>
|
|
|
import { getWebsit } from "@/api/customerManagement";
|
|
|
+ import { lbsAmapRegion } from '@/api/common.js'
|
|
|
+ import geographicalPosi from '@/components/geographicalPosi/index.vue'
|
|
|
import ImageUpload from '@/components/file-upload'
|
|
|
import { getWorker, getCategory, getGoods, getDetail } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
|
|
|
import { add, edit, getReturnDetail } from "@/api/auxiliaryFittings/auxiliarySalesReturnOrder";
|
|
|
export default {
|
|
|
- components: { ImageUpload },
|
|
|
+ components: { ImageUpload, geographicalPosi },
|
|
|
props: ['id','title','formType'],
|
|
|
data() {
|
|
|
return {
|
|
@@ -224,6 +306,7 @@
|
|
|
websitList: [],
|
|
|
workerList: [],
|
|
|
mainList: [],
|
|
|
+ projectList: [],
|
|
|
isPay: false,
|
|
|
payCodeUrl: '',
|
|
|
salesDetail: {},
|
|
@@ -245,8 +328,25 @@
|
|
|
identity: '',
|
|
|
workerMobile: '',
|
|
|
remark: '',
|
|
|
- totalAmount: ''
|
|
|
+ totalAmount: '',
|
|
|
+ salesType: '零售',
|
|
|
+ province: '',
|
|
|
+ provinceId: '',
|
|
|
+ city: '',
|
|
|
+ cityId: '',
|
|
|
+ area: '',
|
|
|
+ areaId: '',
|
|
|
+ street: '',
|
|
|
+ streetId: '',
|
|
|
+ address: '',
|
|
|
+ lat: '',
|
|
|
+ lng: '',
|
|
|
+ orderEnginBaseId: '',
|
|
|
},
|
|
|
+ provinceList: [],
|
|
|
+ cityList: [],
|
|
|
+ areaList: [],
|
|
|
+ streetList: [],
|
|
|
isEdit: 0,
|
|
|
companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
|
|
|
rules: {
|
|
@@ -273,6 +373,7 @@
|
|
|
this.getReturnDetail()
|
|
|
}
|
|
|
this.getWebsit()
|
|
|
+ this.getinitlbslist()
|
|
|
},
|
|
|
methods: {
|
|
|
// 返回
|
|
@@ -340,14 +441,14 @@
|
|
|
const that = this
|
|
|
if(type == 1){
|
|
|
return new Promise((resolve, reject) => {
|
|
|
- getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M',goodsName: goodsName}).then(res => {
|
|
|
+ getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M',goodsName: goodsName,orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType}).then(res => {
|
|
|
resolve({
|
|
|
data: res.data[0]
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
}else{
|
|
|
- getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M'}).then(res => {
|
|
|
+ getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M',orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType}).then(res => {
|
|
|
that.dataList[that.isEdit].goodsList = res.data
|
|
|
})
|
|
|
}
|
|
@@ -400,7 +501,7 @@
|
|
|
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'}).then(res => {
|
|
|
+ getGoods({websitId: this.formData.websitId,categoryId: e.categoryId,type: 'M',orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType}).then(res => {
|
|
|
this.dataList[this.isEdit].goodsList = res.data
|
|
|
})
|
|
|
},
|
|
@@ -413,6 +514,9 @@
|
|
|
this.dataList[this.isEdit].price = e.price
|
|
|
this.dataList[this.isEdit].goodsCode = e. goodsCode
|
|
|
this.dataList[this.isEdit].qty = e.qty
|
|
|
+ this.dataList[this.isEdit].itemSourceType = e.itemSourceType
|
|
|
+ this.dataList[this.isEdit].itemSourceId = e.itemSourceId
|
|
|
+ this.dataList[this.isEdit].normType = e.normType
|
|
|
},
|
|
|
add(){
|
|
|
if(this.dataList.length != 0){this.isEdit += 1}
|
|
@@ -434,7 +538,10 @@
|
|
|
saleAmount: '',
|
|
|
retQty: 1,
|
|
|
qty: '',
|
|
|
- goodsType: 'M'
|
|
|
+ goodsType: 'M',
|
|
|
+ itemSourceType: '',
|
|
|
+ itemSourceId: '',
|
|
|
+ normType: ''
|
|
|
})
|
|
|
},
|
|
|
confirm(){
|
|
@@ -502,7 +609,83 @@
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
- }
|
|
|
+ },
|
|
|
+ getinitlbslist() {
|
|
|
+ // 初始化请求省市区街道下拉选项数据
|
|
|
+ lbsAmapRegion({ pid: 0 }).then(res => {
|
|
|
+ this.provinceList = res.data
|
|
|
+ // 创建工单时获取ip地址定位赋值
|
|
|
+ if (!this.id && this.$IpAdd.province) {
|
|
|
+ var item = this.provinceList.find(item => item.name === this.$IpAdd.province)
|
|
|
+ if (item) {
|
|
|
+ this.formData.provinceId = item.id
|
|
|
+ this.formData.province = item.name
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.formData.provinceId) {
|
|
|
+ lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
|
|
|
+ this.cityList = res.data
|
|
|
+ // 创建工单时获取ip地址定位赋值
|
|
|
+ if (!this.id && this.$IpAdd.city) {
|
|
|
+ var item2 = this.cityList.find(item => item.name === this.$IpAdd.city)
|
|
|
+ if (item2) {
|
|
|
+ this.formData.cityId = item2.id
|
|
|
+ this.formData.city = item2.name
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.formData.cityId) {
|
|
|
+ lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
|
|
|
+ this.areaList = res.data
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (this.formData.areaId) {
|
|
|
+ lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
|
|
|
+ this.streetList = res.data
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ selectAddress(data){
|
|
|
+ this.formData.lng = data.center[0]
|
|
|
+ this.formData.lat = data.center[1]
|
|
|
+ // 获取定位的省市区街道
|
|
|
+ var { province, city, district, township } = data.data.addressComponent
|
|
|
+ // 获取选中省名称id
|
|
|
+ var { id, name } = this.provinceList.find(item => item.name === province)
|
|
|
+ this.formData.provinceId = id
|
|
|
+ this.formData.province = name
|
|
|
+ // 请求市选项
|
|
|
+ lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
|
|
|
+ // 赋值市选项
|
|
|
+ this.cityList = res.data
|
|
|
+ // 获取选中市名称id
|
|
|
+ var { id, name } = res.data.find(item => item.name === city)
|
|
|
+ this.formData.cityId = id
|
|
|
+ this.formData.city = name
|
|
|
+ // 请求区选项
|
|
|
+ lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
|
|
|
+ // 赋值区选项
|
|
|
+ this.areaList = res.data
|
|
|
+ // 获取选中区名称id
|
|
|
+ var { id, name } = res.data.find(item => item.name === district)
|
|
|
+ this.formData.areaId = id
|
|
|
+ this.formData.area = name
|
|
|
+ // 请求街道选项
|
|
|
+ lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
|
|
|
+ // 赋值街道选项
|
|
|
+ this.streetList = res.data
|
|
|
+ // 获取选中街道名称id
|
|
|
+ var { id, name } = res.data.find(item => item.name === township)
|
|
|
+ this.formData.streetId = id
|
|
|
+ this.formData.street = name
|
|
|
+ // 赋值GPS详细地址
|
|
|
+ this.formData.address = data.name
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|