pengyh 1 anno fa
parent
commit
d6456f7e6f

+ 2 - 2
src/api/auxiliaryFittings/auxiliaryAdjustPriceOrder.js

@@ -37,11 +37,11 @@ export function edit(data) {
 }
 
 // 详情
-export function getDetail(data) {
+export function getDetail(params) {
   return request({
     url: `/websit/goods/price/detail`,
     method: 'post',
-    data
+    params
   })
 }
 

+ 2 - 2
src/api/auxiliaryFittings/auxiliarySalesOrder.js

@@ -37,11 +37,11 @@ export function edit(data) {
 }
 
 // 详情
-export function getDetail(data) {
+export function getDetail(params) {
   return request({
     url: `/websit/sales/detail`,
     method: 'post',
-    data
+    params
   })
 }
 

+ 1 - 1
src/api/customerManagement.js

@@ -29,7 +29,7 @@ export function memberInner(params) {
 // 入驻网点
 export function getWebsit(params) {
   return request({
-    url: '/admin/websit/list',
+    url: '/admin/websit/list?type=C',
     method: 'get',
     params
   })

+ 392 - 0
src/components/websitAddressMap/index.vue

@@ -0,0 +1,392 @@
+<script src="https://a.amap.com/jsapi_demos/static/demo-center/js/demoutils.js"></script>
+<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.4&key=0c011c95685ea80ab9ca5601fc894139&plugin=AMap.PlaceSearch,AMap.AutoComplete,AMap.PolyEditor,AMap.Geocoder"></script>
+<template>
+	<div class="main">
+		<!-- <div class="tabs">
+			<el-radio-group v-model="apply_status" style="margin-bottom: 30px;" @change="handleClick">
+				<el-radio-button label="1">GPS定位信息</el-radio-button>
+				<el-radio-button label="2">修改记录</el-radio-button>
+			</el-radio-group>
+		</div> -->
+		<!-- GPS定位信息 -->
+		<div class="moudel" v-if="apply_status == '1'">
+			<el-form ref="screenForm" :model="screenForm" label-width="160px" size="small" label-position="left">
+				<el-row :gutter="20">
+					<el-col :span="22">
+						<div>
+							<span>售后网点: {{websit_name}}</span>
+						</div>
+						<div style="margin: 10px 0 20px 0;">
+							<span>地址: {{address}}</span>
+							<span style="margin-left: 30px">经纬度</span>
+							<span v-if="lng">{{lng + ' , ' + lat}}</span>
+						</div>
+					</el-col>
+					<el-col :span="2">
+						<el-button type="primary" @click="init1();getGps()">刷新</el-button>
+					</el-col>
+				</el-row>
+			</el-form>
+			<div class="map">
+				<el-amap-search-box
+				      class="search-box"
+				      :search-option="searchOption"
+				      :on-search-result="onSearchResult"
+				    >
+					</el-amap-search-box>
+				<el-amap vid="amapDemo" :events='events' v-bind="mapConfig" class="map-container" ref="map" :center="center" style="height: 70vh;" :zoom="zoom">
+					<el-amap-polygon v-bind="polygonConfig"></el-amap-polygon>
+					<el-amap-marker
+						v-for="(marker, index) in markers"
+						:position="marker.position"
+						:title="marker.title"
+						:key="index"
+						:events="marker.events"
+						:icon="marker.icon"
+					></el-amap-marker>
+					<template v-if="currentWindow.visible">
+						<el-amap-info-window :position="currentWindow.position" :content="currentWindow.content" :visible="currentWindow.visible"></el-amap-info-window>
+					</template>
+				</el-amap>
+			</div>
+			<div slot="footer" class="dialog-footer">
+				<el-button @click="reset()">重置</el-button>
+				<el-button type="primary" @click="save()">确认</el-button>
+			</div>
+		</div>
+		<!-- 修改记录 -->
+		<div class="moudel" v-if="apply_status == '2'">
+			<div class="table">
+				<el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
+					<el-table-column prop="" label="操作类型" align="center">修改GPS</el-table-column>
+					<el-table-column prop="operate_content" label="操作记录" align="center"></el-table-column>
+					<el-table-column prop="operate_person_name" label="修改人" align="center"></el-table-column>
+					<el-table-column prop="createtime" label="修改时间" align="center"></el-table-column>
+				</el-table>
+			</div>
+			
+			<div class="pagination clearfix">
+				<div class="fr">
+					<el-pagination
+						@size-change="handleSizeChange"
+						@current-change="handleCurrentChange"
+						:current-page="currentPage"
+						:page-sizes="[10, 20, 30, 50]"
+						:page-size="pageSize"
+						layout="total, sizes, prev, pager, next, jumper"
+						:total="listTotal"
+					></el-pagination>
+				</div>
+			</div>
+		</div>
+	</div>
+</template>
+<script>
+	window._AMapSecurityConfig = {
+		serviceHost: process.env.VUE_APP_BASE_API + '_AMapService',  
+	}
+	// Vue.use(AMap)
+	// 初始化地图
+	AMap.initAMapApiLoader({
+	   key: '0c011c95685ea80ab9ca5601fc894139',
+	   plugin: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor', 'AMap.Geocoder','AMap.Geolocation', 'AMap.DistrictSearch', 'AMap.setPointToCenter','AMap.AutoComplete'],    // 插件集合
+		uiVersion: '1.0', // ui库版本,不配置不加载,
+		v: '1.4.4'
+	})
+	// import { save, getGps, getList } from '@/api/websitRemoteExpenseSet/afterSaleGpsLocationSet.js';
+	export default {
+		data(){
+			let self = this;
+			return {
+				dataList: [],
+				websit_name: '',
+				websit_number: 'S2106590',
+				address: '',
+				selectAddress: '',
+				apply_status: '1',
+				keyword: '',
+				screenForm: {},
+				listLoading: true, // 列表加载loading
+				currentPage: 1, // 当前页码
+				pageSize: 10, // 每页数量
+				listTotal: 0, // 列表总数
+				zoom: 12,
+				searchOption: {
+					city: "全国",   //范围
+					citylimit: false, //是否限制城市内搜索
+				},
+				geoCoder: null,
+				mapConfig: {
+					//地图属性配置
+					center: [120.96, 30.9], // 地图中心点
+					zoom: 11, // 地图缩放比例
+					city: '嘉善县', // 描边传参
+					zoomEnable: true, // 缩放
+					dragEnable: true, // 拖拽
+					features: ['bg', 'road', 'point'], // 隐藏默认楼块
+					mapStyle: 'amap://styles/normal', // 设置地图的显示样式
+					events: {} // 地图加载完成时执行的方法
+				},
+				polygonConfig: {
+					// 城市边界 配置
+					strokeColor: '#5D87FB', // 城市边界颜色
+					strokeWeight: 2,
+					strokeStyle: 'dashed', // 线样式
+					fillColor: '#5D87FB', // 遮罩背景色
+					fillOpacity: 0.1
+				},
+				events: {
+					click(e) {
+						self.chaadd(e.lnglat)
+					}
+				},
+				center: [113.3568890, 23.1355340],
+				currentWindow: {},
+				markers: [],
+				lat: null,
+				lng: null,
+			}
+		},
+		created() {
+			if(this.$route.query.websit_number){
+				this.websit_number = this.$route.query.websit_number;
+				this.websit_name = this.$route.query.websit_name;
+			}
+			// this.getGps()
+			setTimeout(()=>{
+				this.init1()
+				this.geoCoder = new AMap.Geocoder({
+					radius: 1000 //范围,默认:500
+				})
+			},500);
+		},
+		methods: {
+			handleClick(event) {
+				this.apply_status = event
+				if(event == 1){
+					this.getGps()
+				}else if(event == 2){
+					this.getList()
+				}
+			},
+			getGps(){
+				getGps({websit_number: this.websit_number}).then(res => {
+					if (res.code == 1) {
+						if(res.data.lng){
+							this.address = res.data.address
+							this.websit_name = res.data.websit_name
+							this.lat = res.data.lat
+							this.lng = res.data.lng
+							this.center = [res.data.lng,res.data.lat]
+							this.addMarker(res.data.lng,res.data.lat,res.data.address)
+						}
+					} else {
+						this.$message.error(res.msg);
+					}
+				});
+			},
+			// 获取修改记录
+			getList() {
+				this.listLoading = true;
+				let params = {
+					page: this.currentPage,
+					limit: this.pageSize,
+					websit_number: this.websit_number
+				}
+				getList(params).then(res => {
+					if (res.code == 1) {
+						this.dataList = res.data.data
+						this.listTotal = res.data.total
+						this.listLoading = false
+					} else {
+						this.$message.error(res.msg);
+					}
+				});
+			},
+			onSearchResult(pois) {
+				const that = this
+				that.lat = pois[0].lat
+				that.lng = pois[0].lng
+				that.selectAddress = pois[0].name
+				that.center = [pois[0].lng, pois[0].lat]
+				that.addMarker(pois[0].lng, pois[0].lat, pois[0].name)
+			},
+			save(){
+				console.log(this.lng,this.lat,this.selectAddress)
+				if(!this.lng || !this.lat || !this.selectAddress){
+					return this.$message({
+					  message: '经纬度地址为空,请重新选择!',
+					  type: 'warning'
+					});
+				}
+				let params = {
+					websit_number: this.websit_number,
+					lng: this.lng,
+					lat: this.lat,
+					address: this.selectAddress
+				}
+				save(params).then(res => {
+					if (res.code == 1) {
+						this.$message({
+							type: 'success',
+							message: '保存成功!'
+						});
+						this.getGps();
+					} else {
+						this.$message.error(res.msg);
+					}
+				});
+			},
+			init1() {
+				const that = this
+				var map = new AMap.Map("container", {
+				    resizeEnable: true
+				});
+				var autoOptions = {
+				    input: "tipinput"
+				};
+				AMap.plugin(['AMap.PlaceSearch','AMap.AutoComplete','AMap.Geocoder'], function(){
+				    var auto = new AMap.AutoComplete(autoOptions);
+				    var placeSearch = new AMap.PlaceSearch({
+				        map: map
+				    });  //构造地点查询类
+				    auto.on("select", select);//注册监听,当选中某条记录时会触发
+				    function select(e) {
+						console.log(e)
+				        placeSearch.setCity(e.poi.adcode);
+				        placeSearch.search(e.poi.name);  //关键字查询查询
+				    }
+					// 地址逆向解析插件
+				});
+			},
+			chaadd(e){
+
+				this.lng = e.lng
+				this.lat = e.lat
+				this.setMapMarker(e.lng,e.lat)
+			},
+			addMarker(lng,lat,address){
+				const that = this
+				that.markers = []
+				
+				this.currentWindow = {
+					visible: true, //窗体显示
+					position: [lng, lat],
+					offset: 0,
+					content: `<div class="content" style="font-size:12px;">
+									<div style="font-size:14px;font-weight:bold;margin-bottom:5px;">售后网点地址</div>
+									<div>地址:${address}</div>
+									<div>经度:${lng}</div>
+									<div>纬度:${lat}</div>
+								</div>`
+				}
+				
+				that.markers.push(
+					{
+						position: [lng,lat],
+						title: '售后网点地址',
+						icon: 'http://a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
+						events: {
+							//events里面定义点标记的事件,比如点击事件
+							click: () => {
+								// that.currentWindow = {
+								// 	visible: true, //窗体显示
+								// 	position: [lng,lat],
+								// 	offset: 0,
+								// 	content: `<div class="content" style="font-size:12px;">
+								// 					<div style="font-size:14px;font-weight:bold;margin-bottom:5px;">售后网点地址</div>
+								// 					<div>地址:${address}</div>
+								// 					<div>经度:${lng}</div>
+								// 					<div>纬度:${lat}</div>
+								// 				</div>`
+								// }
+							}
+						},
+						offset: 0, //偏移量
+						clickable: true, //点标记是否可以点击
+						visible: true //点标记是否显示
+					}
+				)
+			},
+			setMapMarker(lng,lat) {
+				const that = this
+				if (lng == '' && lat == '') {
+					return
+				}
+				let lnglat = [lng, lat]
+				that.center = [lng, lat]
+				that.geoCoder.getAddress(lnglat, (status, result) => {
+					let address = result.regeocode.formattedAddress
+					if (status === 'complete' && result.regeocode) {
+						console.log(result)
+						that.selectAddress = result.regeocode.formattedAddress
+						
+						that.addMarker(lng, lat, address)
+					}
+				})
+			},
+			// 更改每页数量
+			handleSizeChange(val) {
+				this.pageSize = val;
+				this.currentPage = 1;
+				this.getList();
+			},
+			// 更改当前页
+			handleCurrentChange(val) {
+				this.currentPage = val;
+				this.getList();
+			}
+		}
+	}
+</script>
+
+<style scoped="scoped" lang="scss">
+	.main{
+		// height: 100vh;
+		padding: 10px;
+		.tabs {
+			width: 88%;
+			background-color: #ffffff;
+		}
+		.map{
+			width: 100%;
+			height: 100%;
+			border: 1px solid #cccccc;
+			margin-right: 10px;
+			position: relative;
+			overflow: hidden;
+			.text{
+				padding: 10px;
+				font-size: 14px;
+				color: #333333;
+				line-height: 26px;
+				.zhu,.fu{
+					width: 40%;
+				}
+			}
+		}
+		.search-box {
+			width: 50%;
+			// transform: translateY(-20px);
+			border: 1px solid #d9d9d9;
+			::v-deep .search-btn {
+				background: #409EFF;
+				color: #ffffff;
+				width: 15%;
+				border-radius: 5px;
+			}
+		}
+		.dialog-footer{
+			display: flex;
+			justify-content: flex-end;
+			margin-top: 20px;
+		}
+	}
+	::v-deep .search-box{
+		position: absolute !important;
+	}
+	::v-deep .amap-info div:first-child {
+		left: 170px !important;
+		bottom: -135px !important;
+	}
+</style>

+ 12 - 20
src/views/auxiliaryFittings/salesManagement/auxiliaryAdjustPriceOrder/index.vue

@@ -5,30 +5,30 @@
 		  :operation="operation" :exportList="exportList">
 		  
 		  <div slot="moreSearch">
-		    <el-radio-group v-model="goodsType" size="mini" @change="changeType">
+		    <el-radio-group v-model="flag" size="mini" @change="changeType">
 		    	<el-radio-button label="">全部</el-radio-button>
-		    	<el-radio-button label="PAY_NOT_TAKE">已保存</el-radio-button>
-		    	<el-radio-button label="SUBMIT">已审核</el-radio-button>
+		    	<el-radio-button label="SAVE">已保存</el-radio-button>
+		    	<el-radio-button label="OK">已审核</el-radio-button>
 		    </el-radio-group>
 		    <br><br>
 		  </div>
 		</template-page>
 		<div class="detail" v-if="formDialog">
-			<auxiliarySalesOrderDetail :id="id" @back="backList" :title="'辅材调价单' + formDialogTitles[formDialogType]"></auxiliarySalesOrderDetail>
+			<auxiliaryAdjustPriceOrderDetail :id="id" @back="backList" :formType="formDialogType" :title="'辅材调价单' + formDialogTitles[formDialogType]"></auxiliaryAdjustPriceOrderDetail>
 		</div>
 	</div>
 </template>
 
 <script>
 import TemplatePage from '@/components/template/template-page-1.vue'
-import auxiliarySalesOrderDetail from '../components/auxiliarySalesOrderDetail.vue'
+import auxiliaryAdjustPriceOrderDetail from '../components/auxiliaryAdjustPriceOrderDetail.vue'
 import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2,pageExport, getDetail, add, edit, confirm } from "@/api/auxiliaryFittings/auxiliaryAdjustPriceOrder";
+import { listPageV2,pageExport } from "@/api/auxiliaryFittings/auxiliaryAdjustPriceOrder";
 export default {
-  components: { TemplatePage, ImageUpload, auxiliarySalesOrderDetail },
+  components: { TemplatePage, ImageUpload, auxiliaryAdjustPriceOrderDetail },
   mixins: [import_mixin],
   data() {
     return {
@@ -59,7 +59,7 @@ export default {
       formDialogTitles: ["新增","编辑", "详情"],
       formDialog: false,
 	  id: '',
-	  goodsType: ''
+	  flag: ''
     }
   },
   computed: {
@@ -75,6 +75,7 @@ export default {
 	  this.$refs.pageRef.refreshList()
 	},
 	backList() {
+		this.id = ''
 		this.formDialog = false;
 		this.getList()
 	},
@@ -82,8 +83,8 @@ export default {
 	getList(p) {
 	  try {
 	    var pam = JSON.parse(JSON.stringify(p))
-	    if (this.examineStatus) {
-	      pam.params.push({ "param": "b.examine_status", "compare": "=", "value": this.examineStatus })
+	    if (this.flag) {
+	      pam.params.push({ "param": "a.flag", "compare": "=", "value": this.flag })
 	    }
 	    return listPageV2(pam)
 	  } catch (error) {
@@ -94,15 +95,6 @@ export default {
     exportList: pageExport,
     // 表格列解析渲染数据更改
     columnParsing(item, defaultData) {
-		if (item.jname === 'idCardImg') {
-		        defaultData.render = (h, { row, index, column }) => {
-		          return (
-		            <div style="padding:0 6px;cursor: pointer;">
-		              {row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
-		            </div>
-		          )
-		        }
-		      }
       return defaultData
     },
     // 监听勾选变化
@@ -114,7 +106,7 @@ export default {
       return (
         <div class='operation-btns'>
 		  <el-button type="text" onClick={() => {
-				this.id = row.sales_id
+			this.id = row.sheetId
 		    this.formDialogType = 1
 		    this.openForm()
 		  }}>编辑</el-button>

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

@@ -15,7 +15,7 @@
 		  </div>
 		</template-page>
 		<div class="detail" v-if="formDialog">
-			<auxiliarySalesOrderDetail :id="id" @back="backList" :title="'辅材销售订单' + formDialogTitles[formDialogType]"></auxiliarySalesOrderDetail>
+			<auxiliarySalesOrderDetail :id="id" @back="backList" :formType="formDialogType" :title="'辅材销售订单' + formDialogTitles[formDialogType]"></auxiliarySalesOrderDetail>
 		</div>
 	</div>
 </template>
@@ -115,7 +115,7 @@ export default {
       return (
         <div class='operation-btns'>
 		  <el-button type="text" onClick={() => {
-				this.id = row.sales_id
+				this.id = row.salesId
 		    this.formDialogType = 1
 		    this.openForm()
 		  }}>编辑</el-button>

+ 439 - 0
src/views/auxiliaryFittings/salesManagement/components/auxiliaryAdjustPriceOrderDetail.vue

@@ -0,0 +1,439 @@
+<template>
+	<div class="s-page">
+		<el-page-header @back="goBack" :content="title"></el-page-header>
+		<el-divider></el-divider>
+		<el-card class="box-card">
+			<div slot="header" class="clearfix">
+				<span>单据信息</span>
+			</div>
+			<div class="mymain-container">
+				<el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
+					<el-row :gutter="20" justify="start">
+						<el-col :span="12" v-if="id">
+							<el-form-item label="单据状态">
+								<el-input type="text" :value="formData.flag == 'SAVE'?'已保存':formData.flag == 'OK'?'审核通过':formData.flag == 'OK'?'FAIL':''" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="12" v-if="id">
+							<el-form-item label="单据编号">
+								<el-input type="text" :value="formData.sheetId" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6" v-if="id">
+							<el-form-item label="制单人">
+								<el-input type="text" :value="formData.createBy" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6" v-if="id">
+							<el-form-item label="制单时间">
+								<el-input type="text" :value="formData.createTime" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6" v-if="id">
+							<el-form-item label="审核人">
+								<el-input type="text" :value="formData.confirmBy" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6" v-if="id">
+							<el-form-item label="审核时间">
+								<el-input type="text" :value="formData.confirmTime" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="12">
+							<el-form-item label="所属商户" :required="true" >
+								<el-input type="text" :value="companyName" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="12">
+							<el-form-item label="网点名称" prop="websitId" :required="true">
+								<el-select v-model="formData.websit" value-key="websitId" @change="changeWebsit" placeholder="请选择" style="width: 100%;">
+								    <el-option
+								      v-for="item in websitList"
+								      :key="item.websitId"
+								      :label="item.name"
+								      :value="item">
+								    </el-option>
+								  </el-select>
+							</el-form-item>
+						</el-col>
+						<el-col :span="24">
+							<el-form-item label="附件">
+								<ImageUpload :fileList="formData.file_url" :limit="1" :isEdit="formType !== 2" />
+							</el-form-item>
+						</el-col>
+						<el-col :span="24">
+							<el-form-item label="备注">
+								<el-input type="textarea" :rows="4" v-model="formData.remark" placeholder="请输入"></el-input>
+							</el-form-item>
+						</el-col>
+					</el-row>
+				</el-form>
+			</div>
+		</el-card>
+		<el-card class="box-card">
+			<div slot="header" class="clearfix">
+				<span>辅材信息</span>
+			</div>
+			<el-button size="small" type="primary" @click="add()">添加</el-button>
+			<div class="table">
+				<el-table :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
+					<el-table-column label="大类名称" align="center">
+						<template slot-scope="scope">
+							<el-select v-model="scope.row.productCategory" value-key="categoryId" @change="changeMain" :disabled="isEdit != scope.$index" placeholder="请选择" style="width: 100%;">
+							    <el-option
+							      v-for="item in mainList"
+							      :key="item.categoryId"
+							      :label="item.categoryName"
+							      :value="item">
+							    </el-option>
+							  </el-select>
+						</template>
+					</el-table-column>
+					<el-table-column label="小类名称" align="center">
+						<template slot-scope="scope">
+							<el-select v-model="scope.row.goodsCategory" @change="changeSmall" @focus="()=>{
+									if(!scope.row.productCategory){return this.$message.warning('请先选择大类!');}
+								}" :disabled="isEdit != scope.$index" value-key="categoryId" placeholder="请选择" style="width: 100%;">
+							    <el-option
+							      v-for="item in scope.row.productCategory.items"
+							      :key="item.categoryId"
+							      :label="item.categoryName"
+							      :value="item">
+							    </el-option>
+							  </el-select>
+						</template>
+					</el-table-column>
+					<el-table-column label="辅材名称" align="center">
+						<template slot-scope="scope">
+							<el-select v-model="scope.row.goods" @change="changeGoods" value-key="goodsId" :disabled="isEdit != scope.$index" placeholder="请选择" style="width: 100%;">
+							    <el-option
+							      v-for="item in scope.row.goodsList"
+							      :key="item.goodsId"
+							      :label="item.goodsName"
+							      :value="item">
+							    </el-option>
+							  </el-select>
+						</template>
+					</el-table-column>
+					<el-table-column prop="goods.goodsSalesUnit" align="center" label="单位" ></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="" align="center" label="原售价">
+						<template slot-scope="scope">
+							{{scope.row.goods.oldPrice || scope.row.goods.price}}
+						</template>
+					</el-table-column>
+					<el-table-column prop="" align="center" label="新售价" >
+						<template slot-scope="scope">
+							<el-input type="number" v-model="scope.row.newPrice" :disabled="isEdit != scope.$index" placeholder="请输入"></el-input>
+						</template>
+					</el-table-column>
+					<el-table-column prop="goods.qty" align="center" label="库存数量"></el-table-column>
+					<el-table-column label="操作" align="right" width="140">
+						<template slot-scope="scope">
+							<el-button size="mini" type="primary" v-if="scope.$index != isEdit" @click="isEdit = scope.$index">编辑</el-button>
+							<el-button size="mini" type="danger" @click="dataList.splice(scope.$index,1)">删除</el-button>
+						</template>
+					</el-table-column>
+				</el-table>
+			</div>
+		</el-card>
+		<div class="page-footer">
+			<div class="footer">
+				<el-button size="small" type="info" @click="goBack">返回</el-button>
+				<el-button v-if="formType != 2" size="small" type="primary" @click="confirm()">提交</el-button>
+				<el-button v-if="formType == 1" size="small" type="danger">审核通过</el-button>
+			</div>
+		</div>
+	</div>
+</template>
+
+<script>
+	import { getWebsit } from "@/api/customerManagement";
+	import ImageUpload from '@/components/file-upload'
+	import { getWorker, getCategory, getGoods } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
+	import { getDetail, add, edit, confirm } from "@/api/auxiliaryFittings/auxiliaryAdjustPriceOrder";
+	export default {
+		components: { ImageUpload },
+		props: ['id','title','formType'],
+		data() {
+			return {
+				dataList: [],
+				websitList: [],
+				workerList: [],
+				mainList: [],
+				formData: {
+					websit: {},
+					websitId: '',
+					websitName: '',
+					file_url: [],
+					sheetId: '',
+					flag: '',
+					createBy: '',
+					createTime: '',
+					confirmBy: '',
+					confirmTime: '',
+				},
+				productCategory: {},
+				goodsCategory: {},
+				isEdit: 0,
+				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+				rules: {
+					websitId: [
+						{ required: true, message: '请选择网点', trigger: 'change' }
+					],
+					worker: [
+						{ required: true, message: '请选择师傅', trigger: 'change' }
+					],
+					source: [
+						{ required: true, message: '请选择订单来源', trigger: 'change' }
+					],
+					payType: [
+						{ required: true, message: '请选择订单来源', trigger: 'change' }
+					],
+					idcard: [
+						{ required: true, message: '请输入师傅身份证', trigger: 'blur' },
+					],
+					phone: [
+						{ required: true, message: '请输入师傅联系电话', trigger: 'blur' },
+					],
+				}
+			};
+		},
+		computed: {},
+		created() {
+			if(this.id){
+				this.getDetail()
+			}
+			this.getWebsit()
+		},
+		mounted() {
+			console.log(111,this.mainList)
+		},
+		methods: {
+			// 返回
+			goBack() {
+				this.$emit('back');
+			},
+			async getDetail(){
+				const that = this
+				getDetail({sheetId: this.id}).then(res => {
+					this.formData.flag = res.data.flag
+					this.formData.websit = {websitId: res.data.websitId,name: res.data.websitName}
+					this.formData.websitId = res.data.websitId
+					this.formData.websitName = res.data.websitName
+					this.formData.sheetId = res.data.sheetId
+					this.formData.createBy = res.data.createBy
+					this.formData.createTime = res.data.createTime
+					this.formData.confirmBy = res.data.confirmBy
+					this.formData.confirmTime = res.data.confirmTime
+					this.getCategory(res.data.websitId)
+					this.formData.remark = res.data.remark
+					res.data.items.forEach(item=>{
+						item.productCategory = {categoryId: item.parentCategoryId,categoryName: item.parentCategoryName,items: [{categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}]}
+						item.goodsCategory = {categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}
+						that.getGoods(item.goodsCategoryId,item.goodsName,1).then(ress => {
+							item.goods = {...ress.data,oldPrice:ress.data.price}
+							item.goodsList = [{...ress.data,oldPrice:ress.data.price}]
+						})
+					})
+					setTimeout(()=>{
+						this.dataList = res.data.items
+					},200)
+					console.log(this.dataList)
+				})
+			},
+			getWebsit(){
+				getWebsit().then(res => {
+					this.websitList = res.data
+				})
+			},
+			changeWebsit(e){
+				this.formData.websitId = e.websitId
+				this.formData.websitName = e.name
+				this.getWorker()
+				this.getCategory(e.websitId)
+			},
+			getCategory(websitId){
+				getCategory({websitId}).then(res => {
+					this.mainList = res.data
+				})
+			},
+			async getGoods(categoryId,goodsName,type){
+				const that = this
+				if(type == 1){
+					return new Promise((resolve, reject) => {
+						getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M',goodsName: goodsName}).then(res => {
+							resolve({
+								data: res.data[0]
+							})
+						})
+					})
+				}else{
+					getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M'}).then(res => {
+						that.dataList[that.isEdit].goodsList = res.data
+					})
+				}
+			},
+			getWorker(name){
+				const that = this
+				getWorker({pageNum: 1,pageSize: -1,params: [{param: 'a.nick_name',compare: '=',value: name},{param: 'b.websit_id',compare: '=',value: this.formData.websitId}]}).then(res => {
+					if(name){
+						that.formData.idcard = res.data.records[0].idCard
+						that.formData.phone = res.data.records[0].mobile
+					}else{
+						this.workerList = res.data.records
+					}
+				})
+			},
+			changeWorker(e){
+				this.getWorker(e)
+			},
+			workerBlur(e){
+				this.formData.worker = e.target.value
+				this.$forceUpdate()
+			},
+			changeMain(e){
+				this.dataList[this.isEdit].goodsList = [],
+				this.dataList[this.isEdit].productCategory = e,
+				this.dataList[this.isEdit].parentCategoryId = e.categoryId,
+				this.dataList[this.isEdit].parentCategoryName = e.categoryName,
+				this.dataList[this.isEdit].goodsCategory = {},
+				this.dataList[this.isEdit].goodsCategoryName = '',
+				this.dataList[this.isEdit].goodsCategoryId = '',
+				this.dataList[this.isEdit].goods = {},
+				this.dataList[this.isEdit].goodsId = '',
+				this.dataList[this.isEdit].goodsName = '',
+				this.dataList[this.isEdit].goodsSalesUnit = '',
+				this.dataList[this.isEdit].goodsSpecification = '',
+				this.dataList[this.isEdit].goodsCode = '',
+				this.dataList[this.isEdit].newPrice = '',
+				this.dataList[this.isEdit].oldPrice = '',
+				this.dataList[this.isEdit].qty = '',
+				this.dataList[this.isEdit].goodsType = 'M'
+			},
+			async changeSmall(e){
+				this.dataList[this.isEdit].goods = {},
+				this.dataList[this.isEdit].goodsId = '',
+				this.dataList[this.isEdit].goodsName = '',
+				this.dataList[this.isEdit].goodsSalesUnit = '',
+				this.dataList[this.isEdit].goodsSpecification = '',
+				this.dataList[this.isEdit].goodsCode = '',
+				this.dataList[this.isEdit].newPrice = '',
+				this.dataList[this.isEdit].oldPrice = '',
+				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 => {
+					this.dataList[this.isEdit].goodsList = res.data
+				})
+			},
+			changeGoods(e){
+				console.log(e)
+				this.dataList[this.isEdit].goodsId = e.goodsId
+				this.dataList[this.isEdit].goodsName = e.goodsName
+				this.dataList[this.isEdit].goodsSalesUnit = e.goodsSalesUnit
+				this.dataList[this.isEdit].goodsSpecification = e.goodsSpecification
+				this.dataList[this.isEdit].oldPrice = e.price
+				this.dataList[this.isEdit].goodsCode = e. goodsCode
+				this.dataList[this.isEdit].qty = e.qty
+			},
+			add(){
+				this.dataList.push({
+					goodsList: [],
+					productCategory: {},
+					parentCategoryId: '',
+					parentCategoryName: '',
+					goodsCategory: {},
+					goodsCategoryName: '',
+					goodsCategoryId: '',
+					goods: {},
+					goodsId: '',
+					goodsName: '',
+					goodsSalesUnit: '',
+					goodsSpecification: '',
+					goodsCode: '',
+					newPrice: '',
+					oldPrice: '',
+					qty: '',
+					goodsType: 'M'
+				})
+			},
+			confirm(){
+				this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+					if (valid) {
+						if(this.formType == 0){
+							add({
+								remark: this.formData.remark,
+								websitId: this.formData.websitId,
+								websitName: this.formData.websitName,
+								file_url: this.formData.file_url.map(item=>item.url).join(","),
+								items: this.dataList
+							}).then(res => {
+								if(res.code == 200){
+									this.$message.success('提交成功!')
+									this.goBack()
+								}
+							})
+						}else if(this.formType == 1){
+							edit({
+								sheetId: this.formData.sheetId,
+								remark: this.formData.remark,
+								websitId: this.formData.websitId,
+								websitName: this.formData.websitName,
+								file_url: this.formData.file_url.map(item=>item.url).join(","),
+								items: this.dataList
+							}).then(res => {
+								if(res.code == 200){
+									this.dataList = []
+									this.$message.success('提交成功!')
+									this.goBack()
+								}
+							})
+						}
+					}
+				})
+			}
+		}
+	};
+</script>
+
+<style scoped="scoped" lang="scss">
+	.s-page {
+		padding: 20px;
+		background-color: #ffffff;
+	}
+	.page-footer {
+		height: 70px;
+	}
+	
+	.footer {
+		position: fixed;
+		bottom: 0;
+		left: 0;
+		z-index: 1;
+		width: 100%;
+		background: #fff;
+		padding: 15px 40px;
+		box-sizing: border-box;
+		transition: all 0.28s;
+		text-align: right;
+		box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
+	
+		&.hideSidebar {
+			margin-left: 54px;
+			width: calc(100vw - 54px);
+		}
+	
+		&.openSidebar {
+			margin-left: 210px;
+			width: calc(100vw - 210px);
+		}
+	
+		.tips {
+			font-size: 12px;
+			color: red;
+			margin-top: 10px;
+		}
+	}
+</style>

+ 238 - 52
src/views/auxiliaryFittings/salesManagement/components/auxiliarySalesOrderDetail.vue

@@ -9,33 +9,43 @@
 			<div class="mymain-container">
 				<el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
 					<el-row :gutter="20" justify="start">
-						<el-col :span="12">
+						<el-col :span="8" v-if="id">
+							<el-form-item label="单据状态">
+								<el-input type="text" :value="formData.flag == 'SAVE'?'已保存':formData.flag == 'OK'?'审核通过':formData.flag == 'OK'?'FAIL':''" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="8" v-if="id">
+							<el-form-item label="单据编号">
+								<el-input type="text" :value="formData.salesId" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="8">
 							<el-form-item label="所属商户" :required="true" >
 								<el-input type="text" :value="companyName" disabled></el-input>
 							</el-form-item>
 						</el-col>
 						<el-col :span="12">
 							<el-form-item label="网点名称" prop="websitId" :required="true">
-								<el-select v-model="formData.websitId" @change="changeWebsit" placeholder="请选择" style="width: 100%;">
+								<el-select v-model="formData.websit" value-key="websitId" @change="changeWebsit" placeholder="请选择" style="width: 100%;">
 								    <el-option
 								      v-for="item in websitList"
 								      :key="item.websitId"
 								      :label="item.name"
-								      :value="item.websitId">
+								      :value="item">
 								    </el-option>
 								  </el-select>
 							</el-form-item>
 						</el-col>
 						<el-col :span="8">
 							<el-form-item label="师傅姓名" prop="worker" :required="true">
-								<el-select v-model="formData.worker" @focus="()=>{
+								<el-select v-model="formData.worker" value-key="nickName" @focus="()=>{
 									if(!this.formData.websitId){return this.$message.warning('请先选择网点名称!');}
 								}" filterable @change="changeWorker" @blur="workerBlur" placeholder="请选择" style="width: 100%;">
 								    <el-option
 								      v-for="item in workerList"
 								      :key="item.id"
 								      :label="item.nickName"
-								      :value="item.nickName">
+								      :value="item">
 								    </el-option>
 								  </el-select>
 							</el-form-item>
@@ -50,14 +60,39 @@
 								<el-input type="text" v-model="formData.phone" placeholder="请输入"></el-input>
 							</el-form-item>
 						</el-col>
+						<el-col :span="6" v-if="id">
+							<el-form-item label="单据金额">
+								<el-input type="text" :value="formData.createBy" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6" v-if="id">
+							<el-form-item label="制单人">
+								<el-input type="text" :value="formData.createBy" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6" v-if="id">
+							<el-form-item label="制单时间">
+								<el-input type="text" :value="formData.createTime" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6" v-if="id">
+							<el-form-item label="审核人">
+								<el-input type="text" :value="formData.confirmBy" disabled></el-input>
+							</el-form-item>
+						</el-col>
+						<el-col :span="6" v-if="id">
+							<el-form-item label="审核时间">
+								<el-input type="text" :value="formData.confirmTime" disabled></el-input>
+							</el-form-item>
+						</el-col>
 						<el-col :span="12">
 							<el-form-item label="订单来源" prop="source" :required="true">
 								<el-select v-model="formData.source" placeholder="请选择" style="width: 100%;">
 								    <el-option
 								      v-for="item in [{name: '在线订单',id: 'ONLINE'},{name: '自建订单',id: 'SELF'}]"
-								      :key="item.workerId"
+								      :key="item.id"
 								      :label="item.name"
-								      :value="item.workerId">
+								      :value="item.id">
 								    </el-option>
 								  </el-select>
 							</el-form-item>
@@ -95,7 +130,7 @@
 				<el-table :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
 					<el-table-column label="大类名称" align="center">
 						<template slot-scope="scope">
-							<el-select v-model="scope.row.productCategory" value-key="categoryId" @change="changeMain" :disabled="isEdit != scope.$index" placeholder="请选择" style="width: 100%;">
+							<el-select v-model="scope.row.parentCategory" value-key="categoryId" @change="changeMain" :disabled="isEdit != scope.$index" placeholder="请选择" style="width: 100%;">
 							    <el-option
 							      v-for="item in mainList"
 							      :key="item.categoryId"
@@ -108,10 +143,10 @@
 					<el-table-column label="小类名称" align="center">
 						<template slot-scope="scope">
 							<el-select v-model="scope.row.goodsCategory" @change="changeSmall" @focus="()=>{
-									if(!scope.row.productCategory){return this.$message.warning('请先选择大类!');}
+									if(!scope.row.parentCategory){return this.$message.warning('请先选择大类!');}
 								}" :disabled="isEdit != scope.$index" value-key="categoryId" placeholder="请选择" style="width: 100%;">
 							    <el-option
-							      v-for="item in smallList"
+							      v-for="item in scope.row.parentCategory.items"
 							      :key="item.categoryId"
 							      :label="item.categoryName"
 							      :value="item">
@@ -121,27 +156,27 @@
 					</el-table-column>
 					<el-table-column label="辅材名称" align="center">
 						<template slot-scope="scope">
-							<el-select v-model="scope.row.goodsId" :disabled="isEdit != scope.$index" placeholder="请选择" style="width: 100%;">
+							<el-select v-model="scope.row.goods" @change="changeGoods" value-key="goodsId" :disabled="isEdit != scope.$index" placeholder="请选择" style="width: 100%;">
 							    <el-option
-							      v-for="item in materialsList"
-							      :key="item.id"
-							      :label="item.name"
-							      :value="item.id">
+							      v-for="item in scope.row.goodsList"
+							      :key="item.goodsId"
+							      :label="item.goodsName"
+							      :value="item">
 							    </el-option>
 							  </el-select>
 						</template>
 					</el-table-column>
-					<el-table-column prop="goodsSalesUnit" align="center" label="单位" ></el-table-column>
+					<el-table-column prop="goods.goodsSalesUnit" 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.salesQty" :disabled="isEdit != scope.$index" placeholder="请输入"></el-input>
 						</template>
 					</el-table-column>
-					<el-table-column prop="" align="center" label="商品代码"></el-table-column>
-					<el-table-column prop="" align="center" label="规格型号"></el-table-column>
-					<el-table-column prop="" align="center" label="销售价格"></el-table-column>
-					<el-table-column prop="" align="center" label="销售金额"></el-table-column>
-					<el-table-column prop="" align="center" label="库存数量"></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="goods.saleAmount" align="center" label="销售金额" ></el-table-column>
+					<el-table-column prop="goods.qty" align="center" label="库存数量"></el-table-column>
 					<el-table-column label="操作" align="right" width="140">
 						<template slot-scope="scope">
 							<el-button size="mini" type="primary" v-if="scope.$index != isEdit" @click="isEdit = scope.$index">编辑</el-button>
@@ -163,26 +198,34 @@
 
 <script>
 	import { getWebsit } from "@/api/customerManagement";
-	import { getWorker, getCategory, getGoods } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
+	import { getWorker, getCategory, getGoods, getDetail, add, edit, confirm } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
 	export default {
-		props: ['id','title'],
+		props: ['id','title','formType'],
 		data() {
 			return {
 				dataList: [],
 				websitList: [],
 				workerList: [],
 				mainList: [],
-				smallList: [],
-				materialsList: [],
 				formData: {
+					websit: {},
 					websitId: '',
-					worker: '',
+					websitName: '',
+					file_url: [],
+					salesId: '',
+					flag: '',
+					createBy: '',
+					createTime: '',
+					confirmBy: '',
+					confirmTime: '',
+					worker: {},
+					workerName: '',
+					workerId: '',
 					idcard: '',
 					phone: '',
-					source: ''
+					source: '',
+					payType: ''
 				},
-				productCategory: {},
-				goodsCategory: {},
 				isEdit: 0,
 				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
 				rules: {
@@ -209,6 +252,9 @@
 		},
 		computed: {},
 		created() {
+			if(this.id){
+				this.getDetail()
+			}
 			this.getWebsit()
 		},
 		methods: {
@@ -216,63 +262,203 @@
 			goBack() {
 				this.$emit('back');
 			},
+			async getDetail(){
+				const that = this
+				getDetail({salesId: this.id}).then(res => {
+					this.formData.flag = res.data.flag
+					this.formData.websit = {websitId: res.data.websitId,name: res.data.websitName}
+					this.formData.websitId = res.data.websitId
+					this.formData.websitName = res.data.websitName
+					this.getWorker()
+					this.formData.salesId = res.data.salesId
+					this.formData.createBy = res.data.createBy
+					this.formData.createTime = res.data.createTime
+					this.formData.confirmBy = res.data.confirmBy
+					this.formData.confirmTime = res.data.confirmTime
+					this.formData.worker = {nickName: res.data.workerName,userId: res.data.workerId}
+					this.formData.workerName = res.data.workerName
+					this.formData.workerId = res.data.workerId
+					this.formData.idcard = res.data.identity
+					this.formData.phone = res.data.workerMobile
+					this.formData.source = res.data.source
+					this.formData.payType = res.data.payType
+					this.getCategory(res.data.websitId)
+					this.formData.remark = res.data.remark
+					res.data.items.forEach(item=>{
+						item.parentCategory = {categoryId: item.parentCategoryId,categoryName: item.parentCategoryName,items: [{categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}]}
+						item.goodsCategory = {categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}
+						that.getGoods(item.goodsCategoryId,item.goodsName,1).then(ress => {
+							item.goods = {...ress.data,oldPrice:ress.data.price}
+							item.goodsList = [{...ress.data,oldPrice:ress.data.price}]
+						})
+					})
+					setTimeout(()=>{
+						this.dataList = res.data.items
+					},200)
+					console.log(this.dataList)
+				})
+			},
 			getWebsit(){
 				getWebsit().then(res => {
 					this.websitList = res.data
 				})
 			},
-			changeWebsit(websitId){
+			changeWebsit(e){
+				this.formData.websitId = e.websitId
+				this.formData.websitName = e.name
 				this.getWorker()
+				this.getCategory(e.websitId)
+			},
+			getCategory(websitId){
 				getCategory({websitId}).then(res => {
 					this.mainList = res.data
 				})
 			},
-			getWorker(name){
+			async getGoods(categoryId,goodsName,type){
 				const that = this
-				getWorker({pageNum: 1,pageSize: -1,params: [{param: 'a.nick_name',compare: '=',value: name},{param: 'b.websit_id',compare: '=',value: this.formData.websitId}]}).then(res => {
-					if(name){
-						that.formData.idcard = res.data.records[0].idCard
-						that.formData.phone = res.data.records[0].mobile
-					}else{
-						this.workerList = res.data.records
-					}
+				if(type == 1){
+					return new Promise((resolve, reject) => {
+						getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M',goodsName: goodsName}).then(res => {
+							resolve({
+								data: res.data[0]
+							})
+						})
+					})
+				}else{
+					getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M'}).then(res => {
+						that.dataList[that.isEdit].goodsList = res.data
+					})
+				}
+			},
+			getWorker(){
+				getWorker({pageNum: 1,pageSize: -1,params: [{param: 'b.websit_id',compare: '=',value: this.formData.websitId}]}).then(res => {
+					this.workerList = res.data.records
 				})
 			},
 			changeWorker(e){
-				this.getWorker(e)
+				this.formData.idcard = e.idCard
+				this.formData.phone = e.mobile
+				this.formData.workerId = e.userId
+				this.formData.workerName = e.nickName
 			},
 			workerBlur(e){
 				this.formData.worker = e.target.value
 				this.$forceUpdate()
 			},
 			changeMain(e){
-				this.dataList[this.isEdit].goodsCategoryId = ''
-				this.dataList[this.isEdit].goodsCategoryName = ''
-				this.dataList[this.isEdit].goodsCategory = {}
-				this.dataList[this.isEdit].parentCategoryId = e.categoryId
-				this.dataList[this.isEdit].parentCategoryName = e.categoryName
-				this.smallList = e.items
+				this.dataList[this.isEdit].goodsList = [],
+				this.dataList[this.isEdit].parentCategory = e,
+				this.dataList[this.isEdit].parentCategoryId = e.categoryId,
+				this.dataList[this.isEdit].parentCategoryName = e.categoryName,
+				this.dataList[this.isEdit].goodsCategory = {},
+				this.dataList[this.isEdit].goodsCategoryName = '',
+				this.dataList[this.isEdit].goodsCategoryId = '',
+				this.dataList[this.isEdit].goods = {},
+				this.dataList[this.isEdit].goodsId = '',
+				this.dataList[this.isEdit].goodsName = '',
+				this.dataList[this.isEdit].goodsSalesUnit = '',
+				this.dataList[this.isEdit].goodsSpecification = '',
+				this.dataList[this.isEdit].goodsCode = '',
+				this.dataList[this.isEdit].price = '',
+				this.dataList[this.isEdit].saleAmount = '',
+				this.dataList[this.isEdit].salesQty = ''
+				this.dataList[this.isEdit].qty = '',
+				this.dataList[this.isEdit].goodsType = 'M'
 			},
-			changeSmall(e){
+			async changeSmall(e){
+				this.dataList[this.isEdit].goods = {},
+				this.dataList[this.isEdit].goodsId = '',
+				this.dataList[this.isEdit].goodsName = '',
+				this.dataList[this.isEdit].goodsSalesUnit = '',
+				this.dataList[this.isEdit].goodsSpecification = '',
+				this.dataList[this.isEdit].goodsCode = '',
+				this.dataList[this.isEdit].price = '',
+				this.dataList[this.isEdit].saleAmount = '',
+				this.dataList[this.isEdit].salesQty = ''
+				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',goodsName: e.categoryName}).then(res => {
-					
+				getGoods({websitId: this.formData.websitId,categoryId: e.categoryId,type: 'M'}).then(res => {
+					this.dataList[this.isEdit].goodsList = res.data
 				})
 			},
+			changeGoods(e){
+				console.log(e)
+				this.dataList[this.isEdit].goodsId = e.goodsId
+				this.dataList[this.isEdit].goodsName = e.goodsName
+				this.dataList[this.isEdit].goodsSalesUnit = e.goodsSalesUnit
+				this.dataList[this.isEdit].goodsSpecification = e.goodsSpecification
+				this.dataList[this.isEdit].price = e.price
+				this.dataList[this.isEdit].goodsCode = e. goodsCode
+				this.dataList[this.isEdit].qty = e.qty
+			},
 			add(){
 				this.dataList.push({
-					productCategory: {},
+					goodsList: [],
+					parentCategory: {},
 					parentCategoryId: '',
 					parentCategoryName: '',
 					goodsCategory: {},
 					goodsCategoryName: '',
 					goodsCategoryId: '',
-					goodsSalesUnit: '',
-					salesQty: '',
+					goods: {},
 					goodsId: '',
+					goodsName: '',
+					goodsSalesUnit: '',
 					goodsSpecification: '',
-					saleAmount: ''
+					goodsCode: '',
+					price: '',
+					saleAmount: '',
+					salesQty: 1,
+					qty: '',
+					goodsType: 'M'
+				})
+			},
+			confirm(){
+				this.$refs.formData.validate((valid, invalidFields, errLabels) => {
+					if (valid) {
+						if(this.formType == 0){
+							add({
+								goodsType: 'M',
+								source: this.formData.source,
+								payType: this.formData.payType,
+								remark: this.formData.remark,
+								websitId: this.formData.websitId,
+								websitName: this.formData.websitName,
+								workerName: this.formData.workerName,
+								workerId: this.formData.workerId,
+								identity: this.formData.idcard,
+								workerMobile: this.formData.phone,
+								items: this.dataList
+							}).then(res => {
+								if(res.code == 200){
+									this.$message.success('提交成功!')
+									this.goBack()
+								}
+							})
+						}else if(this.formType == 1){
+							edit({
+								salesId: this.formData.salesId,
+								goodsType: 'M',
+								source: this.formData.source,
+								payType: this.formData.payType,
+								remark: this.formData.remark,
+								websitId: this.formData.websitId,
+								websitName: this.formData.websitName,
+								workerName: this.formData.workerName,
+								workerId: this.formData.workerId,
+								identity: this.formData.idcard,
+								workerMobile: this.formData.phone,
+								items: this.dataList
+							}).then(res => {
+								if(res.code == 200){
+									this.dataList = []
+									this.$message.success('提交成功!')
+									this.goBack()
+								}
+							})
+						}
+					}
 				})
 			}
 		}

+ 178 - 15
src/views/auxiliaryFittings/settleAccountManagement/index.vue

@@ -12,6 +12,137 @@
 	    </el-radio-group>
 	    <br><br>
 	  </div>
+		<el-dialog title="详情" width="80%" :modal="true" :visible.sync="formDialog" :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" @close="formDialog = false;formData = {}">
+			<el-card class="box-card">
+				<div slot="header" class="clearfix">
+					<span>基础信息</span>
+				</div>
+				<table border="1" style="border-color: #fff;" width="100%" align="center" cellspacing="0" cellpadding="10">
+					<tr>
+						<td class="bold" align="center">所属商户</td>
+						<td>{{formData.companyWechatName}}</td>
+						<td class="bold" align="center">网点名称</td>
+						<td>{{formData.websitName}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">结算单号</td>
+						<td>{{formData.settlementOrderId}}</td>
+						<td class="bold" align="center">工单品牌</td>
+						<td>{{formData.brand}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">客户姓名</td>
+						<td>{{formData.userName}}</td>
+						<td class="bold" align="center">客户电话</td>
+						<td>{{formData.userMobile}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">师傅姓名</td>
+						<td>{{formData.workerName}}</td>
+						<td class="bold" align="center">师傅身份证号</td>
+						<td>{{formData.identity}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">师傅联系电话</td>
+						<td>{{formData.workerMobile}}</td>
+						<td class="bold" align="center">订单金额</td>
+						<td>{{formData.totalAmount}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">销售类型</td>
+						<td>{{formData.settlementType == 'OWN'?'自由':formData.settlementType == 'OUT'?'外购':''}}</td>
+						<td class="bold" align="center">创建人</td>
+						<td>{{formData.createBy}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">创建时间</td>
+						<td>{{formData.createTime}}</td>
+						<td class="bold" align="center">支付状态</td>
+						<td>{{formData.payStatus}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">支付订单号</td>
+						<td>{{formData.payStatus}}</td>
+						<td class="bold" align="center">支付时间</td>
+						<td>{{formData.payTime}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">分账单号</td>
+						<td>{{formData.settlementOrderId}}</td>
+						<td class="bold" align="center">分账状态</td>
+						<td>{{formData.status == 'ING'?'结算中':formData.status == 'OVER'?'已结算':formData.status == 'CANCEL'?'手工取消':formData.status == 'EXCEPTION'?'异常结算':formData.status == 'OFFLINE'?'线下结算':''}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">微信流水号</td>
+						<td>{{formData.wechatOrder}}</td>
+						<td class="bold" align="center">分账金额</td>
+						<td>{{formData.amount}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">手续费</td>
+						<td>{{formData.commissionAmount}}</td>
+						<td class="bold" align="center">师傅分账金额</td>
+						<td>{{formData.workerAmount}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">网点分账金额</td>
+						<td>{{formData.websitAmount}}</td>
+						<td class="bold" align="center">分账时间</td>
+						<td>{{formData.settlementTime}}</td>
+					</tr>
+					<tr>
+						<td class="bold" align="center">操作人</td>
+						<td>{{formData.updateBy}}</td>
+						<td class="bold" align="center">操作时间</td>
+						<td>{{formData.updateTime}}</td>
+					</tr>
+				</table>
+			</el-card>
+			<el-card class="box-card">
+				<div slot="header" class="clearfix">
+					<span>订单信息</span>
+				</div>
+				<table border="1" style="border-color: #fff;" width="100%" align="center" cellspacing="0" cellpadding="10">
+					<thead>
+						<tr>
+							<th class="bold" align="center">名称</th>
+							<th class="bold" align="center">收费类型</th>
+							<th class="bold" align="center">数量</th>
+							<th class="bold" align="center">单价</th>
+							<th class="bold" align="center">订单金额</th>
+							<th class="bold" align="center">销售类型</th>
+							<th class="bold" align="center">师傅分账金额</th>
+							<th class="bold" align="center">网点分账金额</th>
+						</tr>
+					</thead>
+					<tbody>
+						<tr v-for="(item,index) in formData.settlementOrderItemList" :key="index">
+							<td align="center">{{item.goodsName}}</td>
+							<td align="center">{{item.chargeType=='ACC'?'配件物料':item.chargeType=='SERV'?'服务收费':''}}</td>
+							<td align="center">{{item.num}}</td>
+							<td align="center">{{item.goodsAmount}}</td>
+							<td align="center">{{item.totalAmount}}</td>
+							<td align="center">{{item.settlementType == 'OWN'?'自由':item.settlementType == 'OUT'?'外购':''}}</td>
+							<td align="center">{{item.workerAmount}}</td>
+							<td align="center">{{item.websitAmount}}</td>
+						</tr>
+						<tr>
+							<td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td>
+						</tr>
+						<tr>
+							<td align="center">总计</td><td></td><td></td><td></td>
+							<td align="center">{{totalAmount}}</td><td></td>
+							<td align="center">{{workerAmount}}</td>
+							<td align="center">{{websitAmount}}</td>
+						</tr>
+					</tbody>
+				</table>
+			</el-card>
+		  <div slot="footer" class="dialog-footer">
+			<el-button size="mini" @click="formDialog = false;formData = {}">取 消</el-button>
+			<el-button size="mini" v-if="formDialogType !== 2" type="primary" @click="formConfirm()">确认结算</el-button>
+		  </div>
+		</el-dialog>
 	</template-page>
 </template>
 
@@ -27,20 +158,27 @@ export default {
   mixins: [import_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: true
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      // 勾选选中行
-      recordSelected: [],
-	  status: ''
+		// 事件组合
+		optionsEvensGroup: [],
+		// 表格属性
+		tableAttributes: {
+			// 启用勾选列
+			selectColumn: true
+		},
+		// 表格事件
+		tableEvents: {
+			'selection-change': this.selectionChange
+		},
+		// 勾选选中行
+		recordSelected: [],
+		formDialogType: 0,
+		formDialogTitles: ["新增","编辑", "详情"],
+		formDialog: false,
+		formData: {},
+		status: '',
+		totalAmount: 0,
+		workerAmount: 0,
+		websitAmount: 0,
     }
   },
   computed: {
@@ -76,12 +214,32 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
+		openForm() {
+		  this.formDialog = true;
+		},
+		formCancel() {
+		  this.$refs.formRef.$refs.inlineForm.clearValidate()
+		  this.$data.formData = this.$options.data().formData
+		  this.formDialog = false
+		},
     // 表格操作列
     operation(h, { row, index, column }) {
       return (
         <div class='operation-btns'>
 		  <el-button type="text" onClick={() => {
-		    
+			this.totalAmount = 0
+			this.workerAmount = 0
+			this.websitAmount = 0
+		    getDetail({ id: row.settlementOrderId }).then(res => {
+		      Object.assign(this.formData, res.data)
+			  res.data.settlementOrderItemList.forEach(item=>{
+				  this.totalAmount += item.totalAmount
+				  this.workerAmount += item.workerAmount
+				  this.websitAmount += item.websitAmount
+			  })
+		      this.formDialogType = 1
+		      this.openForm()
+		    })
 		  }}>查看</el-button>
         </div>
       )
@@ -94,4 +252,9 @@ export default {
 	.tab{
 		padding: 20px 20px 0 20px;
 	}
+	.bold{
+		width: 160px;
+		font-weight: bold;
+		background-color: #f0f0f0;
+	}
 </style>

+ 19 - 3
src/views/setting/departmentManage/index.vue

@@ -71,8 +71,14 @@
         <el-form-item label="名称" prop="name">
           <el-input placeholder="请输入网点名称" v-model="mainForm.name"></el-input>
         </el-form-item>
-        <el-form-item label="地址">
-          <el-input placeholder="请输入地址" v-model="mainForm.address"></el-input>
+		<el-form-item label="联系人" prop="linkName">
+		  <el-input placeholder="请输入联系人名称" v-model="mainForm.linkName"></el-input>
+		</el-form-item>
+        <el-form-item label="地址" prop="address" required>
+			<div style="display:flex;">
+				<el-input placeholder="请选择地址" readonly v-model="mainForm.address"></el-input>
+				<el-button type="primary" @click="addressVisible = true">设置GPS地址</el-button>
+			</div>
         </el-form-item>
         <el-form-item label="状态" prop="status">
           <el-radio-group v-model="mainForm.status">
@@ -86,12 +92,17 @@
         <el-button type="primary" @click="submitMainForm">确 定</el-button>
       </div>
     </el-dialog>
+	<el-dialog title="设置网点" :visible.sync="addressVisible" width="60%" :close-on-click-modal="false" :modal-append-to-body="false">
+		<websitAddressMap ></websitAddressMap>
+	</el-dialog>
   </div>
 </template>
 
 <script>
 import { getDepartmentList, addDepartment, editDepartment, getDepartmentDetail, deleteDepartment } from '@/api/setting'
+import websitAddressMap from '@/components/websitAddressMap/index.vue'
 export default {
+	components: {websitAddressMap},
   data() {
     return {
       dataList: [], // 列表数据
@@ -102,6 +113,7 @@ export default {
       editId: null,
       mainFormType: 'add',
       mainFormVisible: false,
+	  addressVisible: false,
       input: '',
       value1: [],
       levels: [],
@@ -109,11 +121,15 @@ export default {
       mainForm: {
         parentId: '',
         name: '',
+		linkName:'',
+		lat: '',
+		lng: '',
         address: '',
         status: true,
       },
       mainFormRules: {
-        name: [{ required: true, message: '请填写网点名称', trigger: 'blur' }]
+        name: [{ required: true, message: '请填写网点名称', trigger: 'blur' }],
+		linkName: [{ required: true, message: '请填写联系人名称', trigger: 'blur' }]
       }
     }
   },