소스 검색

销售单,退货单,新件返回调整

pengyh 1 년 전
부모
커밋
72989eb236

+ 186 - 8
src/views/auxiliaryFittings/salesManagement/components/attachmentNewReturnDetail.vue

@@ -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" :disabled="formType == 2" @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>
@@ -188,11 +268,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, getNewDetail } from "@/api/auxiliaryFittings/attachmentNewReturn";
 	export default {
-		components: { ImageUpload },
+		components: { ImageUpload, geographicalPosi },
 		props: ['id','title','formType'],
 		data() {
 			return {
@@ -220,7 +302,20 @@
 					identity: '',
 					workerMobile: '',
 					totalAmount: '',
-					remark: ''
+					remark: '',
+					salesType: '零售',
+					province: '',
+					provinceId: '',
+					city: '',
+					cityId: '',
+					area: '',
+					areaId: '',
+					street: '',
+					streetId: '',
+					address: '',
+					lat: '',
+					lng: '',
+					orderEnginBaseId: '',
 				},
 				isEdit: 0,
 				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
@@ -248,6 +343,7 @@
 				this.getNewDetail()
 			}
 			this.getWebsit()
+			this.getinitlbslist()
 		},
 		methods: {
 			// 返回
@@ -304,14 +400,14 @@
 				const that = this
 				if(type == 1){
 					return new Promise((resolve, reject) => {
-						getGoods({websitId: this.formData.websitId,type: 'P',goodsName: goodsName}).then(res => {
+						getGoods({websitId: this.formData.websitId,type: 'P',goodsName: goodsName,orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType}).then(res => {
 							resolve({
 								data: res.data[0]
 							})
 						})
 					})
 				}else{
-					getGoods({websitId: this.formData.websitId,type: 'P'}).then(res => {
+					getGoods({websitId: this.formData.websitId,type: 'P',orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType}).then(res => {
 						that.dataList[that.isEdit].goodsList = res.data
 						console.log(this.dataList)
 					})
@@ -342,6 +438,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}
@@ -359,7 +458,10 @@
 					saleAmount: '',
 					newRefundQty: 1,
 					qty: '',
-					goodsType: 'P'
+					goodsType: 'P',
+					itemSourceType: '',
+					itemSourceId: '',
+					normType: ''
 				})
 			},
 			confirm(){
@@ -473,7 +575,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>

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

@@ -260,10 +260,16 @@
 					<el-table-column prop="goods.goodsCode" align="center" label="配件编码"></el-table-column>
 					<el-table-column prop="goods.brandRelaName" align="center" label="适用品牌"></el-table-column>
 					<el-table-column prop="goods.productRelaName" align="center" label="适用产品大类"></el-table-column>
-					<el-table-column prop="goods.price" align="center" label="销售价格"></el-table-column>
+					<el-table-column prop="" align="center" label="销售价格">
+						<el-table-column prop="" align="center" label="销售价格">
+							<template slot-scope="scope">
+								<el-input type="number" v-model="scope.row.price" :disabled="isEdit != scope.$index || formType == 2" placeholder="请输入"></el-input>
+							</template>
+						</el-table-column>
+					</el-table-column>
 					<el-table-column prop="goods.saleAmount" align="center" label="销售金额" >
-						<template slot-scope="scope" v-if="scope.row.salesQty && scope.row.goods && scope.row.goods.price">
-							{{(scope.row.goods.price * 100) * scope.row.salesQty / 100}}
+						<template slot-scope="scope" v-if="scope.row.salesQty && scope.row.price">
+							{{(scope.row.price * 100) * scope.row.salesQty / 100}}
 						</template>
 					</el-table-column>
 					<el-table-column prop="goods.qty" align="center" label="库存数量"></el-table-column>
@@ -501,7 +507,7 @@
 				})
 			},
 			getProjectCollectionList(orderEnginBaseId){
-				getProjectCollectionList({orderEnginBaseId}).then(res => {
+				getProjectCollectionList({orderEnginBaseId,goodsType: 'P'}).then(res => {
 					this.collectionList = res.data
 				})
 			},
@@ -509,14 +515,14 @@
 				const that = this
 				if(type == 1){
 					return new Promise((resolve, reject) => {
-						getGoods({websitId: this.formData.websitId,type: 'P',goodsName: goodsName}).then(res => {
+						getGoods({websitId: this.formData.websitId,type: 'P',goodsName: goodsName,orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType}).then(res => {
 							resolve({
 								data: res.data[0]
 							})
 						})
 					})
 				}else{
-					getGoods({websitId: this.formData.websitId,type: 'P'}).then(res => {
+					getGoods({websitId: this.formData.websitId,type: 'P',orderEnginBaseId: this.formData.orderEnginBaseId,saleType: this.formData.salesType}).then(res => {
 						that.dataList[that.isEdit].goodsList = res.data
 						console.log(this.dataList)
 					})
@@ -547,6 +553,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}
@@ -563,7 +572,10 @@
 					saleAmount: '',
 					salesQty: 1,
 					qty: '',
-					goodsType: 'P'
+					goodsType: 'P',
+					itemSourceType: '',
+					itemSourceId: '',
+					normType: ''
 				})
 				this.getGoods()
 			},

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

@@ -285,10 +285,14 @@
 					</el-table-column>
 					<el-table-column prop="goods.goodsCode" align="center" label="商品代码"></el-table-column>
 					<el-table-column prop="goods.goodsSpecification" align="center" label="规格型号"></el-table-column>
-					<el-table-column prop="goods.price" align="center" label="销售价格"></el-table-column>
+					<el-table-column prop="" align="center" label="销售价格">
+						<template slot-scope="scope">
+							<el-input type="number" v-model="scope.row.price" :disabled="isEdit != scope.$index || formType == 2" placeholder="请输入"></el-input>
+						</template>
+					</el-table-column>
 					<el-table-column prop="" align="center" label="销售金额" >
-						<template slot-scope="scope" v-if="scope.row.salesQty && scope.row.goods && scope.row.goods.price">
-							{{((scope.row.goods.price * 100) * scope.row.salesQty / 100).toFixed(2)}}
+						<template slot-scope="scope" v-if="scope.row.salesQty && scope.row.price">
+							{{((scope.row.price * 100) * scope.row.salesQty / 100).toFixed(2)}}
 						</template>
 					</el-table-column>
 					<el-table-column prop="goods.qty" align="center" label="库存数量"></el-table-column>
@@ -538,7 +542,7 @@
 				})
 			},
 			getProjectCollectionList(orderEnginBaseId){
-				getProjectCollectionList({orderEnginBaseId}).then(res => {
+				getProjectCollectionList({orderEnginBaseId,goodsType: 'M'}).then(res => {
 					this.collectionList = res.data
 				})
 			},
@@ -546,14 +550,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
 					})
 				}
@@ -606,7 +610,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
 				})
 			},
@@ -619,6 +623,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}
@@ -640,7 +647,10 @@
 					saleAmount: '',
 					salesQty: 1,
 					qty: '',
-					goodsType: 'M'
+					goodsType: 'M',
+					itemSourceType: '',
+					itemSourceId: '',
+					normType: ''
 				})
 			},
 			del(index){

+ 192 - 9
src/views/auxiliaryFittings/salesManagement/components/auxiliarySalesReturnOrderDetail.vue

@@ -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>