chenrui %!s(int64=4) %!d(string=hai) anos
pai
achega
ccf6dd2c4c

+ 41 - 42
public/adapter.js

@@ -1,48 +1,47 @@
 //  非谷歌浏览器或非IE11时,则提示下载谷歌浏览器进行访问
+function BrowserType () {
+  var userAgent = navigator.userAgent // 取得浏览器的userAgent字符串
+  var isOpera = userAgent.indexOf('Opera') > -1 // 判断是否Opera浏览器
+  // var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera; //判断是否IE浏览器
+  var isIE = window.ActiveXObject || 'ActiveXObject' in window
+  // var isEdge = userAgent.indexOf("Windows NT 6.1; Trident/7.0;") > -1 && !isIE; //判断是否IE的Edge浏览器
+  var isEdge = userAgent.indexOf('Edge') > -1 // 判断是否IE的Edge浏览器
+  var isFF = userAgent.indexOf('Firefox') > -1 // 判断是否Firefox浏览器
+  var isSafari = userAgent.indexOf('Safari') > -1 && userAgent.indexOf('Chrome') == -1 // 判断是否Safari浏览器
+  var isChrome = userAgent.indexOf('Chrome') > -1 && userAgent.indexOf('Safari') > -1 && !isEdge // 判断Chrome浏览器
 
-function BrowserType() { 
-  var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
-  var isOpera = userAgent.indexOf("Opera") > -1; //判断是否Opera浏览器 
-  // var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera; //判断是否IE浏览器 
-  var isIE=window.ActiveXObject || "ActiveXObject" in window
-  // var isEdge = userAgent.indexOf("Windows NT 6.1; Trident/7.0;") > -1 && !isIE; //判断是否IE的Edge浏览器 
-  var isEdge = userAgent.indexOf("Edge") > -1; //判断是否IE的Edge浏览器
-  var isFF = userAgent.indexOf("Firefox") > -1; //判断是否Firefox浏览器 
-  var isSafari = userAgent.indexOf("Safari") > -1 && userAgent.indexOf("Chrome") == -1; //判断是否Safari浏览器 
-  var isChrome = userAgent.indexOf("Chrome") > -1 && userAgent.indexOf("Safari") > -1&&!isEdge; //判断Chrome浏览器 
-       
   if (isIE) {
-    var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
-    reIE.test(userAgent);
-    var fIEVersion = parseFloat(RegExp["$1"]);
-    if(userAgent.indexOf('MSIE 6.0')!=-1){
-      return "IE6";
-    }else if(fIEVersion == 7){ 
-      return "IE7";
-    }else if(fIEVersion == 8){
-      return "IE8";
-    }else if(fIEVersion == 9){
-      return "IE9";
-    }else if(fIEVersion == 10){
-      return "IE10";
-    }else if(userAgent.toLowerCase().match(/rv:([\d.]+)\) like gecko/)){ 
-      return "IE11";
-    }else{ //IE版本过低
-      return "0"
+    var reIE = new RegExp('MSIE (\\d+\\.\\d+);')
+    reIE.test(userAgent)
+    var fIEVersion = parseFloat(RegExp['$1'])
+    if (userAgent.indexOf('MSIE 6.0') != -1) {
+      return 'IE6'
+    } else if (fIEVersion == 7) {
+      return 'IE7'
+    } else if (fIEVersion == 8) {
+      return 'IE8'
+    } else if (fIEVersion == 9) {
+      return 'IE9'
+    } else if (fIEVersion == 10) {
+      return 'IE10'
+    } else if (userAgent.toLowerCase().match(/rv:([\d.]+)\) like gecko/)) {
+      return 'IE11'
+    } else { // IE版本过低
+      return '0'
     }
-  } //isIE end 
-          
-  if (isFF) { return "FF";} 
-  if (isOpera) { return "Opera";} 
-  if (isSafari) { return "Safari";} 
-  if (isChrome) { return "Chrome";} 
-  if (isEdge) { return "Edge";} 
-} //myBrowser() end 
-    
-if(BrowserType() != 'Chrome' && BrowserType() != 'IE11'){
-  var con = alert('当前浏览器版本过低,为保证更好体验请下载谷歌浏览器进行操作, 点击【确定】升级,如不升级您将不能正常浏览网页!'+'\n'+'下载地址:“https://www.google.cn/chrome”'); //在页面上弹出对话框
-  if(con==true){}else{
-    window.location = "https://www.google.cn/chrome"
+  } // isIE end
+
+  if (isFF) { return 'FF' }
+  if (isOpera) { return 'Opera' }
+  if (isSafari) { return 'Safari' }
+  if (isChrome) { return 'Chrome' }
+  if (isEdge) { return 'Edge' }
+} // myBrowser() end
+
+if (BrowserType() != 'Chrome' && BrowserType() != 'IE11') {
+  var con = alert('当前浏览器版本过低,为保证更好体验请下载谷歌浏览器进行操作, 点击【确定】升级,如不升级您将不能正常浏览网页!' + '\n' + '下载地址:“https://www.google.cn/chrome”') // 在页面上弹出对话框
+  if (con == true) {} else {
+    window.location = 'https://www.google.cn/chrome'
   }
 }
-//  升级ie  https://support.microsoft.com/zh-cn/help/17621/internet-explorer-downloads
+//  升级ie  https://support.microsoft.com/zh-cn/help/17621/internet-explorer-downloads

+ 7 - 7
src/api/custType.js

@@ -2,7 +2,7 @@ import { axios } from '@/utils/request'
 
 //  客户类型列表  分页
 export const custTypeList = (params) => {
-  let url = `/custType/findPage/${params.pageNo}/${params.pageSize}`
+  const url = `/custType/findPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -14,10 +14,9 @@ export const custTypeList = (params) => {
 
 //  客户类型列表  不分页
 export const custTypeFindAll = (params) => {
-  let url = `/custType/findAll`
   return axios({
-    url: url,
-    data: params,
+    url: `/custType/findAll`,
+    data: {},
     method: 'post'
   })
 }
@@ -34,7 +33,8 @@ export const custTypeSave = params => {
 // 删除客户类型
 export const custTypeDel = params => {
   return axios({
-    url: `/custType/del/${params.id}`,
-    method: 'post'
+    url: `/custType/delete/${params.id}`,
+    data: {},
+    method: 'get'
   })
-}
+}

+ 3 - 12
src/api/customer.js

@@ -12,16 +12,6 @@ export const custList = (params) => {
   })
 }
 
-//  客户列表  无分页
-export const custFindAll = (params) => {
-  const url = `/cust/findAll`
-  return axios({
-    url: url,
-    data: params,
-    method: 'post'
-  })
-}
-
 // 新增/编辑客户
 export const custSave = params => {
   return axios({
@@ -42,7 +32,8 @@ export const custFindById = params => {
 // 删除客户
 export const custDel = params => {
   return axios({
-    url: `/cust/del/${params.id}`,
-    method: 'post'
+    url: `/cust/delete/${params.id}`,
+    data: {},
+    method: 'get'
   })
 }

+ 2 - 2
src/api/data.js

@@ -9,7 +9,7 @@ export function login (parameter) {
 }
 
 export const listLookUp = params => {
-  let url = `/lookup/queryLike`
+  const url = `/lookup/queryLike`
   return axios({
     url: url,
     data: params,
@@ -18,7 +18,7 @@ export const listLookUp = params => {
 }
 
 export const getLookUpData = (params) => {
-  let url = `/lookupItem/query/${params.pageNo}/${params.pageSize}`
+  const url = `/lookupItem/query/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({

+ 4 - 6
src/views/allocationManagement/storeTransferOut/list.vue

@@ -158,14 +158,14 @@ export default {
       this.$router.push({ path: `/allocationManagement/storeTransferOut/add` })
     },
     //  删除
-    handleDel(row){
+    handleDel (row) {
       const _this = this
       this.$confirm({
         title: '提示',
         content: '删除后不可恢复,确定要进行删除吗?',
         okText: '确定',
         cancelText: '取消',
-		centered: true,
+        centered: true,
         onOk () {
           // delectRolePower({
           //   id: row.id
@@ -180,9 +180,7 @@ export default {
       })
     },
     //  出库
-    handleOut(row){
-      
-    },
+    handleOut(row){},
     //  审核
     handleExamine(){
       const _this = this
@@ -191,7 +189,7 @@ export default {
         content: '确认要审核通过吗?',
         okText: '确定',
         cancelText: '取消',
-		centered: true,
+        centered: true,
         onOk () {
           // delectRolePower({
           //   id: row.id

+ 295 - 297
src/views/customerManagement/customerInfo/edit.vue

@@ -1,134 +1,133 @@
 <template>
-	<div class="customerManagementEdit-wrap">
-		<a-page-header :ghost="false" @back="handleBack" class="customerManagementEdit-back">
-			<!-- 自定义的二级文字标题 -->
-			<template slot="subTitle">
-				<a id="customerManagementEdit-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
-			</template>
-		</a-page-header>
-		<a-card :bordered="false" class="customerManagementEdit-table-page-wrapper">
-			<a-form-model
-				id="customerManagementEdit-form"
-				ref="ruleForm"
-				:model="form"
-				:rules="rules"
-				:label-col="formItemLayout.labelCol"
-				:wrapper-col="formItemLayout.wrapperCol"
-			>
-				<a-row :gutter="15">
-					<a-col :span="8">
-						<a-form-model-item label="客户名称" prop="name">
-							<a-input id="customerManagementEdit-name" :maxLength="30" v-model="form.name" placeholder="请输入客户名称(最多30个字符)" allowClear />
-						</a-form-model-item>
-					</a-col>
-					<a-col :span="8">
-						<a-form-model-item label="联系手机" prop="mobile">
-							<a-input id="customerManagementEdit-mobile" :maxLength="11" v-model="form.mobile" placeholder="请输入联系手机(最多11个字符)" allowClear />
-						</a-form-model-item>
-					</a-col>
-					<a-col :span="8">
-						<a-form-model-item label="联系人" prop="contact">
-							<a-input id="customerManagementEdit-contact" :maxLength="30" v-model="form.contact" placeholder="请输入联系人(最多30个字符)" allowClear />
-						</a-form-model-item>
-					</a-col>
-				</a-row>
-				<a-row :gutter="15">
-					<a-col :span="16">
-						<a-form-model-item label="客户地址" required style="margin: 0;" :labelCol="{ span: 4 }" :wrapperCol="{ span: 20 }">
-							<a-row :gutter="15">
-								<!-- 客户地址 -->
-								<a-col span="8">
-									<a-form-model-item prop="provinceId">
-										<a-select id="customerManagementEdit-provinceId" @change="getCityList" v-model="form.provinceId" placeholder="请选择省">
-											<a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
-										</a-select>
-									</a-form-model-item>
-								</a-col>
-								<a-col span="8">
-									<a-form-model-item prop="cityId">
-										<a-select id="customerManagementEdit-cityId" @change="getAreaList" v-model="form.cityId" placeholder="请选择市">
-											<a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
-										</a-select>
-									</a-form-model-item>
-								</a-col>
-								<a-col span="8">
-									<a-form-model-item prop="areaId">
-										<a-select id="customerManagementEdit-areaId" @change="areaCharged" v-model="form.areaId" placeholder="请选择区/县">
-											<a-select-option v-for="item in addrAreaList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
-										</a-select>
-									</a-form-model-item>
-								</a-col>
-							</a-row>
-						</a-form-model-item>
-					</a-col>
-					<a-col :span="8">
-						<a-form-model-item label="详细地址" prop="address">
-							<a-input id="customerManagementEdit-address" :maxLength="60" v-model="form.address" placeholder="请输入详细地址(最多60个字符)" allowClear />
-						</a-form-model-item>
-					</a-col>
-				</a-row>
-				<a-row :gutter="15">
-					<a-col :span="8">
-						<a-form-model-item label="客户传真" prop="fax">
-							<a-input id="customerManagementEdit-fax" :maxLength="30" v-model="form.fax" placeholder="请输入客户传真(最多30个字符)" allowClear />
-						</a-form-model-item>
-					</a-col>
-					<a-col :span="8">
-						<a-form-model-item label="配送方式" prop="distributionType">
-							<v-select
-								code="DISPATCH_FASHION"
-								id="customerManagementEdit-distributionType"
-								v-model="form.distributionType"
-								allowClear
-								placeholder="请选择配送方式"
-							></v-select>
-						</a-form-model-item>
-					</a-col>
-					<a-col :span="8">
-						<a-form-model-item label="是否卫星仓客户" prop="contactPhone">
-							<a-select id="customerManagementEdit-areaCode" v-model="form.areaCode" placeholder="请选择">
-								<a-select-option v-for="item in addrAreaList" :value="item.id" :key="item.id">{{ item.name }}</a-select-option>
-							</a-select>
-						</a-form-model-item>
-					</a-col>
-				</a-row>
-				<a-row :gutter="15">
-					<a-col :span="8">
-						<a-form-model-item label="客户类型" prop="custType">
-							<a-select id="customerManagementEdit-custType" v-model="form.custType" allowClear placeholder="请选择客户类型">
-								<a-select-option v-for="item in custTypeList" :value="item.id" :key="item.id">{{ item.name }}</a-select-option>
-							</a-select>
-						</a-form-model-item>
-					</a-col>
-					<a-col :span="8">
-						<a-form-model-item label="价格类型" ref="priceType" prop="priceType">
-							<v-select code="PRICE_TYPE" id="customerManagementEdit-priceType" v-model="form.priceType" allowClear placeholder="请选择价格类型" ></v-select>
-						</a-form-model-item>
-					</a-col>
-					<a-col :span="8">
-						<a-form-model-item label="支付方式" prop="payType">
-							<v-select code="PAY_FASHION" id="customerManagementEdit-payType" v-model="form.payType" allowClear placeholder="请选择支付方式" />
-						</a-form-model-item>
-					</a-col>
-				</a-row>
-				<a-row :gutter="15">
-					<a-col :span="8">
-						<a-form-model-item label="收款方式" prop="paymentType">
-							<v-select code="RECEIPT_PAYMENT" id="customerManagementEdit-paymentType" v-model="form.paymentType" allowClear placeholder="请选择收款方式"></v-select>
-						</a-form-model-item>
-					</a-col>
-					<a-col :span="8">
-						<a-form-model-item label="联系电话" prop="contactTel">
-							<a-input id="customerManagementEdit-contactTel" :maxLength="20" v-model="form.contactTel" placeholder="请输入联系电话(最多20个字符)" allowClear />
-						</a-form-model-item>
-					</a-col>
-				</a-row>
-				<a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
-					<a-button type="primary" @click="handleSubmit" id="customerManagementEdit-btn-submit" style="padding: 0 60px;">保存</a-button>
-				</a-form-model-item>
-			</a-form-model>
-		</a-card>
-	</div>
+  <div class="customerManagementEdit-wrap">
+    <a-page-header :ghost="false" @back="handleBack" class="customerManagementEdit-back">
+      <!-- 自定义的二级文字标题 -->
+      <template slot="subTitle">
+        <a id="customerManagementEdit-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
+      </template>
+    </a-page-header>
+    <a-card :bordered="false" class="customerManagementEdit-table-page-wrapper">
+      <a-form-model
+        id="customerManagementEdit-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-row :gutter="15">
+          <a-col :span="8">
+            <a-form-model-item label="客户名称" prop="customerName">
+              <a-input id="customerManagementEdit-customerName" :maxLength="30" v-model="form.customerName" placeholder="请输入客户名称(最多30个字符)" allowClear />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="8">
+            <a-form-model-item label="联系电话" prop="contactTel">
+              <a-input id="customerManagementEdit-contactTel" :maxLength="20" v-model="form.contactTel" placeholder="请输入联系电话(最多20个字符)" allowClear />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="8">
+            <a-form-model-item label="联系人" prop="contactName">
+              <a-input id="customerManagementEdit-contactName" :maxLength="30" v-model="form.contactName" placeholder="请输入联系人(最多30个字符)" allowClear />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="15">
+          <a-col :span="16">
+            <a-form-model-item label="客户地址" required style="margin: 0;" :labelCol="{ span: 4 }" :wrapperCol="{ span: 20 }">
+              <a-row :gutter="15">
+                <!-- 客户地址 -->
+                <a-col span="8">
+                  <a-form-model-item prop="provinceSn">
+                    <a-select id="customerManagementEdit-provinceSn" @change="getCityList" v-model="form.provinceSn" placeholder="请选择省">
+                      <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
+                    </a-select>
+                  </a-form-model-item>
+                </a-col>
+                <a-col span="8">
+                  <a-form-model-item prop="citySn">
+                    <a-select id="customerManagementEdit-citySn" @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
+                      <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
+                    </a-select>
+                  </a-form-model-item>
+                </a-col>
+                <a-col span="8">
+                  <a-form-model-item prop="countySn">
+                    <a-select id="customerManagementEdit-countySn" @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
+                      <a-select-option v-for="item in addrAreaList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+                    </a-select>
+                  </a-form-model-item>
+                </a-col>
+              </a-row>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="8">
+            <a-form-model-item label="详细地址" prop="customerAddr">
+              <a-input id="customerManagementEdit-customerAddr" :maxLength="60" v-model="form.customerAddr" placeholder="请输入详细地址(最多60个字符)" allowClear />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="15">
+          <a-col :span="8">
+            <a-form-model-item label="客户传真" prop="fax">
+              <a-input id="customerManagementEdit-fax" :maxLength="30" v-model="form.fax" placeholder="请输入客户传真(最多30个字符)" allowClear />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="8">
+            <a-form-model-item label="配送方式" prop="dispatchType">
+              <v-select
+                code="DISPATCH_FASHION"
+                id="customerManagementEdit-dispatchType"
+                v-model="form.dispatchType"
+                allowClear
+                placeholder="请选择配送方式"
+              ></v-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="8">
+            <a-form-model-item label="是否卫星仓客户" prop="satelliteFlag">
+              <v-select
+                code="DISPATCH_FASHION"
+                id="customerManagementEdit-satelliteFlag"
+                v-model="form.satelliteFlag"
+                allowClear
+                placeholder="请选择"
+              ></v-select>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="15">
+          <a-col :span="8">
+            <a-form-model-item label="价格类型" ref="priceType" prop="priceType">
+              <v-select code="PRICE_TYPE" id="customerManagementEdit-priceType" v-model="form.priceType" allowClear placeholder="请选择价格类型" ></v-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="8">
+            <a-form-model-item label="支付方式" prop="payType">
+              <v-select code="PAY_FASHION" id="customerManagementEdit-payType" v-model="form.payType" allowClear placeholder="请选择支付方式" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="8">
+            <a-form-model-item label="收款方式" prop="settleStyleSn">
+              <v-select code="RECEIPT_PAYMENT" id="customerManagementEdit-settleStyleSn" v-model="form.settleStyleSn" allowClear placeholder="请选择收款方式"></v-select>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="15">
+          <a-col :span="8">
+            <a-form-model-item label="客户类型" prop="custType">
+              <a-select id="customerManagementEdit-custType" v-model="form.customerTypeSn" allowClear placeholder="请选择客户类型">
+                <a-select-option v-for="item in custTypeList" :value="item.id" :key="item.id">{{ item.name }}</a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
+          <a-button type="primary" @click="handleSubmit" id="customerManagementEdit-btn-submit" style="padding: 0 60px;">保存</a-button>
+        </a-form-model-item>
+      </a-form-model>
+    </a-card>
+  </div>
 </template>
 
 <script>
@@ -137,83 +136,82 @@ import { getProvince, getCityByPro, getDistrictByCity } from '@/api/data'
 import { custSave, custFindById } from '@/api/customer'
 import { custTypeFindAll } from '@/api/custType'
 export default {
-	name: 'customerManagementEdit',
-	components: { STable, VSelect },
-	data() {
-		return {
-			formItemLayout: {
-				labelCol: { span: 8 },
-				wrapperCol: { span: 16 }
-			},
-			form: {
-				name: '', // 客户名称
-				mobile: '', //  联系手机
-				contact: '', //  联系人
-				provinceId: undefined, //  省
-				province: '',
-				cityId: undefined, // 市
-				city: '',
-				areaId: undefined, // 区
-				area: '',
-				address: '', //  详细地址
-				fax: '', //  客户传真
-				distributionType: '', //  配送方式
-				remarks: '', //  是否卫星仓客户
-				custType: undefined, //  客户类型
-				priceType: '', //  价格类型
-				payType: '', //  支付方式
-				paymentType: '', //  收款方式
-				contactTel: '' //  联系电话
-			},
-			rules: {
-				name: [{ required: true, message: '请输入客户名称', trigger: 'blur' }],
-				mobile: [{ required: true, message: '请输入联系手机', trigger: 'blur' }],
-				provinceId: [{ required: true, message: '请选择省', trigger: 'change' }],
-				cityId: [{ required: true, message: '请选择市', trigger: 'change' }],
-				areaId: [{ required: true, message: '请选择区/县', trigger: 'change' }],
-				custType: [{ required: true, message: '请选择客户类型', trigger: 'change' }],
-				priceType: [{ required: true, message: '请选择价格类型', trigger: 'change' }],
-				payType: [{ required: true, message: '请选择支付方式', trigger: 'change' }],
-				paymentType: [{ required: true, message: '请选择收款方式', trigger: 'change' }]
-			},
-			addrProvinceList: [], //  省下拉
-			addrCityList: [], //  市下拉
-			addrAreaList: [], //  区下拉
-			custTypeList: [] //  客户类型  下拉数据
-		}
-	},
-	methods: {
-		//  获取客户信息
-		getDetail() {
-			custFindById({ id: this.$route.params.id }).then(res => {
-				if (res.status == 200) {
-					// this.detailsData = res.data
-				} else {
-					this.$refs.ruleForm.resetFields()
-				}
-			});
-		},
-		//  客户类型
-		getCustTypeList() {
-			custTypeFindAll({}).then(res => {
-			  if(res.status == 200){
-			    this.custTypeList = res.data
-			  }
-			})
-		},
-		//  保存
-		handleSubmit(e) {
-			e.preventDefault()
-			const _this = this
-			this.$refs.ruleForm.validate(valid => {
-				if (valid) {
+  name: 'CustomerManagementEdit',
+  components: { STable, VSelect },
+  data () {
+    return {
+      formItemLayout: {
+        labelCol: { span: 8 },
+        wrapperCol: { span: 16 }
+      },
+      form: {
+        customerName: '', // 客户名称
+        contactTel: '', //  联系电话
+        contactName: '', //  联系人
+        provinceSn: undefined, //  省
+        province: '',
+        citySn: undefined, // 市
+        city: '',
+        countySn: undefined, // 区
+        area: '',
+        customerAddr: '', //  详细地址
+        fax: '', //  客户传真
+        dispatchType: '', //  配送方式
+        satelliteFlag: undefined, //  是否卫星仓客户
+        customerTypeSn: undefined, //  客户类型
+        priceType: '', //  价格类型
+        payType: '', //  支付方式
+        settleStyleSn: '' //  收款方式
+      },
+      rules: {
+        customerName: [{ required: true, message: '请输入客户名称', trigger: 'blur' }],
+        contactTel: [{ required: true, message: '请输入联系电话', trigger: 'blur' }],
+        provinceSn: [{ required: true, message: '请选择省', trigger: 'change' }],
+        citySn: [{ required: true, message: '请选择市', trigger: 'change' }],
+        countySn: [{ required: true, message: '请选择区/县', trigger: 'change' }],
+        customerTypeSn: [{ required: true, message: '请选择客户类型', trigger: 'change' }],
+        priceType: [{ required: true, message: '请选择价格类型', trigger: 'change' }],
+        payType: [{ required: true, message: '请选择支付方式', trigger: 'change' }],
+        settleStyleSn: [{ required: true, message: '请选择收款方式', trigger: 'change' }]
+      },
+      addrProvinceList: [], //  省下拉
+      addrCityList: [], //  市下拉
+      addrAreaList: [], //  区下拉
+      custTypeList: [] //  客户类型  下拉数据
+    }
+  },
+  methods: {
+    //  获取客户信息
+    getDetail () {
+      custFindById({ id: this.$route.params.id }).then(res => {
+        if (res.status == 200) {
+          // this.detailsData = res.data
+        } else {
+          this.$refs.ruleForm.resetFields()
+        }
+      })
+    },
+    //  客户类型
+    getCustTypeList () {
+      custTypeFindAll({}).then(res => {
+        if (res.status == 200) {
+          this.custTypeList = res.data
+        }
+      })
+    },
+    //  保存
+    handleSubmit (e) {
+      e.preventDefault()
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
           const form = _this.form
           form.id = this.$route.params.id ? this.$route.params.id : null
-          let areas = [ form.provinceId, form.cityId, form.areaId ]
+          const areas = [ form.provinceSn, form.citySn, form.countySn ]
           form.areas = areas.join(',')
-          delete form.provinceId
-          delete form.cityId
-          console.log(form,'-----提交信息')
+          delete form.provinceSn
+          delete form.citySn
+          console.log(form, '-----提交信息')
           custSave(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
@@ -222,99 +220,99 @@ export default {
               }, 1000)
             }
           })
-				} else {
-					console.log('error submit!!')
-					return false
-				}
-			})
-		},
-		//  返回列表
-		handleBack() {
-			this.$router.push({ path: '/customerManagement/customerInfo/list' })
-		},
-		// 获取省列表
-		getProvinceList() {
-			getProvince().then(res => {
-				if (res.status == 200) {
-					this.addrProvinceList = res.data || []
-				} else {
-					this.addrProvinceList = []
-				}
-			})
-		},
-		// 获取城市列表
-		getCityList(val) {
-			const _this = this
-			this.addrProvinceList.map(item => {
-				if (item.id == val) {
-					_this.form.province = item.name
-				}
-			})
-			this.addrCityList = []
-			this.addrAreaList = []
-			this.form.cityId = undefined
-			this.form.areaId = undefined
-			this.form.address = ''
-			this.getCityListRequest(val)
-		},
-		getCityListRequest(val) {
-			getCityByPro({
-				id: val
-			}).then(res => {
-				if (res.status == 200) {
-					this.addrCityList = res.data || []
-				} else {
-					this.addrCityList = []
-				}
-			});
-		},
-		// 获取区县列表
-		getAreaList(val) {
-			const _this = this
-			this.addrCityList.map(item => {
-				if (item.id == val) {
-					_this.form.city = item.name
-				}
-			});
-			this.addrAreaList = []
-			this.form.areaId = undefined
-			this.form.address = ''
-			this.getAreaListRequest(val)
-		},
-		getAreaListRequest(val) {
-			getDistrictByCity({
-				id: val
-			}).then(res => {
-				if (res.status == 200) {
-					this.addrAreaList = res.data || []
-				} else {
-					this.addrAreaList = []
-				}
-			});
-		},
-		// 区县变更
-		areaCharged(val) {
-			const _this = this
-			this.addrAreaList.map(item => {
-				if (item.id == val) {
-					_this.form.area = item.name
-				}
-			});
-			this.form.address = ''
-		}
-	},
-	beforeRouteEnter(to, from, next) {
-		next(vm => {
-			vm.getProvinceList()  //  省市区
-			vm.getCustTypeList() //  客户类型
-			vm.$refs.ruleForm.resetFields()
-			if (vm.$route.params.id) {
-				//  编辑页
-				vm.getDetail()
-			}
-		});
-	}
-};
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    //  返回列表
+    handleBack () {
+      this.$router.push({ path: '/customerManagement/customerInfo/list' })
+    },
+    // 获取省列表
+    getProvinceList () {
+      getProvince().then(res => {
+        if (res.status == 200) {
+          this.addrProvinceList = res.data || []
+        } else {
+          this.addrProvinceList = []
+        }
+      })
+    },
+    // 获取城市列表
+    getCityList (val) {
+      const _this = this
+      this.addrProvinceList.map(item => {
+        if (item.id == val) {
+          _this.form.province = item.name
+        }
+      })
+      this.addrCityList = []
+      this.addrAreaList = []
+      this.form.citySn = undefined
+      this.form.countySn = undefined
+      this.form.customerAddr = ''
+      this.getCityListRequest(val)
+    },
+    getCityListRequest (val) {
+      getCityByPro({
+        id: val
+      }).then(res => {
+        if (res.status == 200) {
+          this.addrCityList = res.data || []
+        } else {
+          this.addrCityList = []
+        }
+      })
+    },
+    // 获取区县列表
+    getAreaList (val) {
+      const _this = this
+      this.addrCityList.map(item => {
+        if (item.id == val) {
+          _this.form.city = item.name
+        }
+      })
+      this.addrAreaList = []
+      this.form.countySn = undefined
+      this.form.customerAddr = ''
+      this.getAreaListRequest(val)
+    },
+    getAreaListRequest (val) {
+      getDistrictByCity({
+        id: val
+      }).then(res => {
+        if (res.status == 200) {
+          this.addrAreaList = res.data || []
+        } else {
+          this.addrAreaList = []
+        }
+      })
+    },
+    // 区县变更
+    areaCharged (val) {
+      const _this = this
+      this.addrAreaList.map(item => {
+        if (item.id == val) {
+          _this.form.area = item.name
+        }
+      })
+      this.form.customerAddr = ''
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.getProvinceList() //  省市区
+      // vm.getCustTypeList() //  客户类型
+      vm.$refs.ruleForm.resetFields()
+      if (vm.$route.params.id) {
+        //  编辑页
+        vm.getDetail()
+      }
+    })
+  }
+}
 </script>
 
 <style lang="less">

+ 101 - 75
src/views/customerManagement/customerInfo/list.vue

@@ -7,38 +7,45 @@
           <a-col :md="6" :sm="24">
             <a-form-item label="创建时间">
               <a-range-picker
-                  style="width:100%"
-                  id="customerManagementList-creatTime"
-                  :disabledDate="disabledDate"
-                  v-model="creatTime"
-                  :format="dateFormat"
-                  :placeholder="['开始时间', '结束时间']" />
-              </a-form-item>
+                style="width:100%"
+                id="customerManagementList-creatTime"
+                :disabledDate="disabledDate"
+                v-model="creatTime"
+                :format="dateFormat"
+                :placeholder="['开始时间', '结束时间']" />
+            </a-form-item>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="客户名称">
-            	<a-select placeholder="请选择" allowClear v-model="queryParam.name" :showSearch="true" option-filter-prop="children" :filter-option="filterOption">
-            		<a-select-option v-for="item in custData" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
-            	</a-select>
+              <a-select
+                id="customerManagementList-customerName"
+                placeholder="请选择"
+                allowClear
+                v-model="queryParam.customerName"
+                :showSearch="true"
+                option-filter-prop="children"
+                :filter-option="filterOption">
+                <a-select-option v-for="item in custData" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
+              </a-select>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="联系人">
-              <a-input id="customerManagementList-contact" v-model.trim="queryParam.contact" allowClear placeholder="请输入联系人"/>
+              <a-input id="customerManagementList-contactName" v-model.trim="queryParam.contactName" allowClear placeholder="请输入联系人"/>
             </a-form-item>
           </a-col>
           <template v-if="advanced">
             <a-col :md="6" :sm="24">
               <a-form-item label="最后销售时间">
                 <a-range-picker
-                    style="width:100%"
-                    id="customerManagementList-salesTime"
-                    :disabledDate="disabledDate"
-                    v-model="salesTime"
-                    :format="dateFormat"
-                    :placeholder="['开始时间', '结束时间']" />
-                </a-form-item>
+                  style="width:100%"
+                  id="customerManagementList-lastSaleTime"
+                  :disabledDate="disabledDate"
+                  v-model="lastSaleTime"
+                  :format="dateFormat"
+                  :placeholder="['开始时间', '结束时间']" />
+              </a-form-item>
               </a-form-item>
             </a-col>
             <a-col :md="12" :sm="24">
@@ -46,22 +53,22 @@
                 <!-- 客户地址 -->
                 <a-form-item label="客户地址">
                   <a-col span="7">
-                    <a-form-item prop="provinceId" style="margin: 0;">
-                      <a-select v-model="queryParam.provinceId" @change="getCityList" placeholder="请选择省">
+                    <a-form-item prop="provinceSn" style="margin: 0;">
+                      <a-select v-model="queryParam.provinceSn" @change="getCityList" placeholder="请选择省">
                         <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
                       </a-select>
                     </a-form-item>
                   </a-col>
                   <a-col span="7" offset="1">
-                    <a-form-item prop="cityId" style="margin: 0;">
-                      <a-select v-model="queryParam.cityId" @change="getAreaList" placeholder="请选择市">
+                    <a-form-item prop="citySn" style="margin: 0;">
+                      <a-select v-model="queryParam.citySn" @change="getAreaList" placeholder="请选择市">
                         <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
                       </a-select>
                     </a-form-item>
                   </a-col>
                   <a-col span="7" offset="1">
-                    <a-form-item prop="areaId" style="margin: 0;">
-                      <a-select v-model="queryParam.areaId" placeholder="请选择区/县">
+                    <a-form-item prop="countySn" style="margin: 0;">
+                      <a-select v-model="queryParam.countySn" placeholder="请选择区/县">
                         <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
                       </a-select>
                     </a-form-item>
@@ -71,7 +78,14 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="是否卫星仓客户">
-                <v-select code="CHECK_ENABLE_STATE" id="customerManagementList-state" v-model="queryParam.state" allowClear placeholder="请选择"></v-select>
+                <v-select code="CHECK_ENABLE_STATE" id="customerManagementList-satelliteFlag" v-model="queryParam.satelliteFlag" allowClear placeholder="请选择"></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="客户类型">
+                <a-select v-model="queryParam.customerTypeSn" placeholder="请选择客户类型">
+                  <a-select-option v-for="item in custTypeList" :value="item.id" :key="item.id">{{ item.name }}</a-select-option>
+                </a-select>
               </a-form-item>
             </a-col>
           </template>
@@ -100,15 +114,11 @@
       :columns="columns"
       :data="loadData"
       bordered>
-      <!-- 状态 -->
-      <template slot="state" slot-scope="text, record">
-        <span>{{record.state == 1 ? '已启用' : '已禁用'}}</span>
-      </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="primary" @click="handleEdit(record)" id="customerManagementList-edit-btn">编辑</a-button>
-        <a-button size="small" @click="handleDetail(record)" id="customerManagementList-detail-btn" style="margin: 0 15px;">详情</a-button>
-        <a-button size="small" type="danger" @click="handleDel(record)" id="customerManagementList-del-btn">删除</a-button>
+        <a-button size="small" type="primary" @click="handleEdit(record)" id="customerManagementList-edit-btn" style="margin: 0 0 10px 0;">编辑</a-button>
+        <a-button size="small" @click="handleDetail(record)" id="customerManagementList-detail-btn" style="margin: 0 0 10px 8px;">详情</a-button>
+        <a-button size="small" type="danger" @click="handleDel(record)" id="customerManagementList-del-btn" style="margin: 0 0 0 8px;">删除</a-button>
       </template>
     </s-table>
     <!-- 客户详情 -->
@@ -118,43 +128,44 @@
 
 <script>
 import { getProvince, getCityByPro, getDistrictByCity } from '@/api/data'
-import { custList, custDel, custTypeFindAll } from '@/api/customer'
+import { custList, custDel } from '@/api/customer'
+import { custTypeFindAll } from '@/api/custType'
 import { STable, VSelect } from '@/components'
 import customerManagementDetailModal from './detailModal.vue'
 export default {
   components: { STable, VSelect, customerManagementDetailModal },
   data () {
     return {
-      advanced: false,  // 高级搜索 展开/关闭
+      advanced: false, // 高级搜索 展开/关闭
       queryParam: { //  查询条件
-        name: undefined, //  客户名称
-        contact: '', //  联系人
-        provinceId: undefined,  //  省
-        cityId: undefined,  //  市
-        areaId: undefined,  //  区
-        // itemName: '', //  是否卫星仓客户
+        customerName: undefined, //  客户名称
+        contactName: '', //  联系人
+        provinceSn: undefined, //  省
+        citySn: undefined, //  市
+        countySn: undefined, //  区
+        satelliteFlag: undefined, //  是否卫星仓客户
+        customerTypeSn: undefined //  客户类型
       },
-      exportLoading: false, // 导出loading
       disabled: false, //  查询、重置按钮是否可操作
-      custData: [],  //  客户 下拉数据
+      custData: [], //  客户 下拉数据
       dateFormat: 'YYYY-MM-DD',
-      creatTime: [],  //  创建时间
-      salesTime: [],  //  最后销售时间
+      creatTime: [], //  创建时间
+      lastSaleTime: [], //  最后销售时间
       columns: [
         { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: 180, align: 'center' },
-        { title: '客户名称', dataIndex: 'name', width: 200, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '联系人', dataIndex: 'contact', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '联系手机', dataIndex: 'mobile', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: 140, align: 'center' },
+        { title: '客户名称', dataIndex: 'customerName', width: 70, align: 'center', ellipsis: true },
+        { title: '联系人', dataIndex: 'contactName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '联系电话', dataIndex: 'contactTel', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '最后销售时间', dataIndex: 'inventoryNumss', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '是否卫星仓', dataIndex: 'inventoryNum', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '最后销售时间', dataIndex: 'lastSaleTime', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '是否卫星仓', dataIndex: 'satelliteFlag', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 270, align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        return custList( Object.assign(parameter, this.queryParam) ).then(res => {
+        //  最后销售时间
+        return custList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
@@ -167,8 +178,9 @@ export default {
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉
-      openModal: false,  //  查看客户详情  弹框
-      itemId: ''  //  当前客户id
+      custTypeList: [], //  客户类型下拉数据
+      openModal: false, //  查看客户详情  弹框
+      itemId: '' //  当前客户id
     }
   },
   methods: {
@@ -178,32 +190,34 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.name = ''
-      this.queryParam.contact = ''
-      this.queryParam.provinceId = undefined
-      this.queryParam.cityId = undefined
-      this.queryParam.areaId = undefined
+      this.queryParam.customerName = ''
+      this.queryParam.contactName = ''
+      this.queryParam.provinceSn = undefined
+      this.queryParam.citySn = undefined
+      this.queryParam.countySn = undefined
+      this.queryParam.satelliteFlag = undefined
+      this.queryParam.customerTypeSn = undefined
       this.creatTime = []
-      this.salesTime = []
+      this.lastSaleTime = []
       this.$refs.table.refresh(true)
     },
     //  新增/编辑
-    handleEdit(row){
-      if(row){  //  编辑
+    handleEdit (row) {
+      if (row) { //  编辑
         this.$router.push({ path: `/customerManagement/customerInfo/edit/${row.id}` })
-      }else{  //  新增
+      } else { //  新增
         this.$router.push({ path: '/customerManagement/customerInfo/add' })
       }
     },
     //  删除
-    handleDel(row){
+    handleDel (row) {
       const _this = this
       this.$confirm({
         title: '提示',
         content: '删除后不可恢复,确定要进行删除吗?',
         okText: '确定',
         cancelText: '取消',
-		centered: true,
+        centered: true,
         onOk () {
           custDel({
             id: row.id
@@ -217,21 +231,32 @@ export default {
       })
     },
     //  客户合并
-    handleMerge(){},
+    handleMerge () {},
     //  客户信息详情
-    handleDetail(row){
+    handleDetail (row) {
       this.itemId = row.id
       this.openModal = true
     },
     //  关闭弹框
-    closeModal(){
+    closeModal () {
       this.itemId = ''
       this.openModal = false
     },
-    filterOption(input, option) {
-    	return (
-    		option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-    	)
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    //  获取客户类型列表
+    getCustTypeList () {
+      const _this = this
+      custTypeFindAll().then(res => {
+        if (res.status == 200) {
+          _this.custTypeList = res.data || []
+        } else {
+          _this.custTypeList = []
+        }
+      })
     },
     // 获取省列表
     getProvinceList () {
@@ -247,8 +272,8 @@ export default {
     getCityList (val) {
       this.addrCityList = []
       this.addrDistrictList = []
-      this.queryParam.cityId = undefined
-      this.queryParam.areaId = undefined
+      this.queryParam.citySn = undefined
+      this.queryParam.countySn = undefined
       this.getCityListRequest(val)
     },
     getCityListRequest (val) {
@@ -265,7 +290,7 @@ export default {
     // 获取区县列表
     getAreaList (val) {
       this.addrDistrictList = []
-      this.queryParam.areaId = undefined
+      this.queryParam.countySn = undefined
       this.getAreaListRequest(val)
     },
     getAreaListRequest (val) {
@@ -283,6 +308,7 @@ export default {
   beforeRouteEnter (to, from, next) {
     next(vm => {
       vm.getProvinceList()
+      // vm.getCustTypeList()
     })
   }
 }
@@ -296,4 +322,4 @@ export default {
       }
     }
   }
-</style>
+</style>

+ 1 - 1
vue.config.js

@@ -108,7 +108,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://192.168.0.12:8503/qpls-md',
+        target: 'http://192.168.16.104:8503/qpls-md',
         // target: 'http://it.test.zyucgj.com/zyit',
         // target: 'https://it.test.qiubcar.com/zyit',
         ws: false,