|
|
@@ -13,61 +13,18 @@
|
|
|
{{ title }}
|
|
|
<el-button size="mini" style="margin-left: 7px;display: inline-block" type="primary" @click="isEdit?editBtn('ruleForm'):addBtn('ruleForm')">保存
|
|
|
</el-button>
|
|
|
- <el-button type="primary" style="display: inline-block" size="mini" icon="el-icon-refresh" @click="isEdit?editRefreshBtn():addRefreshBtn()">刷新</el-button>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<el-form :model="ruleForm" label-width="130px" :rules="rules" ref="ruleForm" label-position="right">
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col v-if="!isEdit" :span="24">
|
|
|
- <el-form-item label="智能识别">
|
|
|
- <el-input type="textarea" size="mini" :rows="4" style="width: 600px" placeholder="粘贴客户信息" v-model="parseCustomer" clearable></el-input>
|
|
|
- <el-button size="mini" type="green" @click="parseCustomerBtn()">识别</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item prop="industryName" label="行业信息">
|
|
|
- <el-select v-model="ruleForm.industryName" placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in industryList"
|
|
|
- :key="item.id"
|
|
|
- :label="item.industryName"
|
|
|
- :value="item.industryName+','+item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item prop="levelName" label="客户等级">
|
|
|
- <el-select v-model="ruleForm.levelName" placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in levelList"
|
|
|
- :key="item.id"
|
|
|
- :label="item.levelName"
|
|
|
- :value="item.levelName+','+item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item prop="payMode" label="付款方式">
|
|
|
- <el-select v-model="ruleForm.payMode" placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in paytypeList"
|
|
|
- :key="item.id"
|
|
|
- :label="item.payMode"
|
|
|
- :value="item.payMode+','+item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-col :span="10">
|
|
|
<el-form-item prop="clientName" label="客户名称">
|
|
|
<el-input v-model.trim="ruleForm.clientName"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
+ <el-col :span="6">
|
|
|
<el-form-item prop="contactMan" label="联系人">
|
|
|
<el-input v-model.trim="ruleForm.contactMan"></el-input>
|
|
|
</el-form-item>
|
|
|
@@ -77,204 +34,25 @@
|
|
|
<el-input v-model.trim="ruleForm.contactPhone"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
-<!-- <el-col :span="8">-->
|
|
|
-<!-- <el-form-item label="省/市/区:" class="postInfo-container-item">-->
|
|
|
-<!-- <el-cascader-->
|
|
|
-<!-- style="width: 100%"-->
|
|
|
-<!-- :options="options"-->
|
|
|
-<!-- v-model="selectedOptions1"-->
|
|
|
-<!-- @change="handleChange1">-->
|
|
|
-<!-- </el-cascader>-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
-<!-- </el-col>-->
|
|
|
-<!-- <el-col :span="8">-->
|
|
|
-<!-- <el-form-item prop="address" label="详细地址">-->
|
|
|
-<!-- <el-input v-model="ruleForm.address"></el-input>-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
-<!-- </el-col>-->
|
|
|
- <!-- <el-col :span="12">-->
|
|
|
- <!-- <el-form-item label="客户来源">-->
|
|
|
- <!-- <el-input v-model="ruleForm.clientFrom"></el-input>-->
|
|
|
- <!-- </el-form-item>-->
|
|
|
- <!-- </el-col>-->
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- prop="overdraftQuota"
|
|
|
- :rules="[
|
|
|
- { type: 'number', message: '欠款额度必须为数字值'}
|
|
|
- ]"
|
|
|
- label="欠款额度(元)">
|
|
|
- <el-input v-model.number="ruleForm.overdraftQuota" autocomplete="off"></el-input>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-form-item label="省/市/区:" class="postInfo-container-item">
|
|
|
+ <el-cascader
|
|
|
+ style="width: 100%"
|
|
|
+ :options="options"
|
|
|
+ v-model="selectedOptions"
|
|
|
+ @change="handleChange">
|
|
|
+ </el-cascader>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="14">
|
|
|
+ <el-form-item label="具体地址">
|
|
|
+ <el-input v-model="ruleForm.address"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
- <el-tabs v-if="!isEdit" type="border-card">
|
|
|
- <el-tab-pane label="收货地址">
|
|
|
- <div class="filter-container">
|
|
|
- <el-button
|
|
|
- class="filter-item"
|
|
|
- type="primary"
|
|
|
- icon="el-icon-plus"
|
|
|
- size="mini"
|
|
|
- v-if="!addAddressFlag"
|
|
|
- @click="addAddressBtn()">
|
|
|
- 增加
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- <div v-show="addAddressFlag">
|
|
|
- <el-form
|
|
|
- style="padding-bottom: 10px"
|
|
|
- :label-position="labelPosition"
|
|
|
- label-width="80px"
|
|
|
- size="mini"
|
|
|
- :model="formLabelAlign">
|
|
|
- <el-row :gutter="2">
|
|
|
- <el-col :span="22">
|
|
|
- <el-form-item label="智能识别">
|
|
|
- <el-input type="textarea" size="mini" :rows="4" style="width: 500px" placeholder="粘贴地址" v-model="parseAddress" clearable></el-input>
|
|
|
- <el-button size="mini" type="green" @click="parseAddressBtn()">识别</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item prop="shipMode" label="发货方式">
|
|
|
- <el-select v-model="formLabelAlign.shipMode" filterable placeholder="请选择">
|
|
|
-<!-- <el-option-->
|
|
|
-<!-- v-for="item in shipModeList"-->
|
|
|
-<!-- :key="item.id"-->
|
|
|
-<!-- :label="item.modeName"-->
|
|
|
-<!-- :value="item.modeName+','+item.id">-->
|
|
|
-<!-- </el-option>-->
|
|
|
- <template v-if="!sendType || sendType == undefined" >
|
|
|
- <el-option
|
|
|
- v-for="item in sendKinds"
|
|
|
- :key="item.id"
|
|
|
- :label="item.modeName"
|
|
|
- :value="item.id">
|
|
|
- </el-option></template>
|
|
|
- <template v-else>
|
|
|
- <el-option
|
|
|
- v-for="item in sendKinds"
|
|
|
- :key="item.id"
|
|
|
- :label="item.logisticName"
|
|
|
- :value="item.id">
|
|
|
- </el-option>
|
|
|
- </template>
|
|
|
- </el-select>
|
|
|
- <el-checkbox style="width: 60px;display: inline-block" v-model="sendType" @change="chooseLogistics(sendType)">物流</el-checkbox>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-<!-- <el-col :span="6">-->
|
|
|
-<!-- <el-form-item prop="shipArea" label="发货区域">-->
|
|
|
-<!-- <el-select v-model="formLabelAlign.shipArea" placeholder="请选择">-->
|
|
|
-<!-- <el-option-->
|
|
|
-<!-- v-for="item in shipAreaList"-->
|
|
|
-<!-- :key="item.id"-->
|
|
|
-<!-- :label="item.areaName"-->
|
|
|
-<!-- :value="item.areaName+','+item.id">-->
|
|
|
-<!-- </el-option>-->
|
|
|
-<!-- </el-select>-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
-<!-- </el-col>-->
|
|
|
- <el-col :span="5">
|
|
|
- <el-form-item label="收货人">
|
|
|
- <el-input v-model="formLabelAlign.linkManName"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="联系电话">
|
|
|
- <el-input v-model="formLabelAlign.linkManPhone"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="省/市/区:" class="postInfo-container-item">
|
|
|
- <el-cascader
|
|
|
- style="width: 100%"
|
|
|
- :options="options"
|
|
|
- v-model="selectedOptions"
|
|
|
- @change="handleChange">
|
|
|
- </el-cascader>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="18">
|
|
|
- <el-form-item label="具体地址">
|
|
|
- <el-input v-model="formLabelAlign.address"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" @click="onSubmit">添加</el-button>
|
|
|
- <el-button @click="addAddressFlag=false">取消</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
- </div>
|
|
|
- <el-table border size="mini" :data="gridData">
|
|
|
- <el-table-column width="200" v-if="this.isEdit" label="操作">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- <el-button-->
|
|
|
- <!-- size="mini"-->
|
|
|
- <!-- @click="carAddressSelectClick(scope.$index, scope.row)">-->
|
|
|
- <!-- 选址此地址-->
|
|
|
- <!-- </el-button>-->
|
|
|
- <!-- <el-button-->
|
|
|
- <!-- size="mini"-->
|
|
|
- <!-- @click="carAddressEditClick(scope.$index, scope.row)">-->
|
|
|
- <!-- 修改-->
|
|
|
- <!-- </el-button>-->
|
|
|
- <!-- <br>-->
|
|
|
- <el-button
|
|
|
- style="margin-top: 10px"
|
|
|
- v-if="scope.row.defaultFlag==1"
|
|
|
- type="primary"
|
|
|
- :disabled=true
|
|
|
- size="mini">
|
|
|
- 已默认
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- style="margin-top: 10px"
|
|
|
- v-else
|
|
|
- size="mini"
|
|
|
- @click="defaultFlagClick(scope.$index, scope.row.id)"
|
|
|
- >
|
|
|
- 设置默认
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- style="margin-top: 10px"
|
|
|
- size="mini"
|
|
|
- type="danger"
|
|
|
- @click="carAddressDeleteClick(scope.$index, scope.row.id)">删除
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column property="shipModeName" label="发货方式" width="150"></el-table-column>
|
|
|
-<!-- <el-table-column property="shipArea" label="发货区域" width="150"></el-table-column>-->
|
|
|
- <el-table-column property="receiveMan" label="收货人" width="150"></el-table-column>
|
|
|
- <el-table-column property="receivePhone" label="联系电话" width="200"></el-table-column>
|
|
|
- <el-table-column show-overflow-tooltip property="address" label="地址">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div>
|
|
|
- {{ scope.row.province }}{{ scope.row.city }}{{ scope.row.area }}{{ scope.row.address }}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <div v-show="gridData.length>0" style="margin-top: 10px" class="page">
|
|
|
- <el-pagination
|
|
|
- background
|
|
|
- layout="prev, pager, next"
|
|
|
- :total="total"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- >
|
|
|
- </el-pagination>
|
|
|
- </div>
|
|
|
-
|
|
|
- </el-tab-pane>
|
|
|
- </el-tabs>
|
|
|
-
|
|
|
- <!-- <servicedialog @tableRefresh="tableRefresh" ref="menuDialog" :dialogStatus="dialogStatus" :menuId="menuId" :titleDialog="titleDialog" :dialogVisible="dialogVisible"/>-->
|
|
|
<cancledialog @tableRefresh="tableRefresh" ref="confirmDialog"></cancledialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -282,20 +60,12 @@
|
|
|
<script>
|
|
|
import {
|
|
|
addClientInfo,
|
|
|
- getIndustryInfo,
|
|
|
- getInfo,
|
|
|
getInfoById,
|
|
|
- getLevelInfo,
|
|
|
- getPaytypeInfo,
|
|
|
- getshipModeListInfo,
|
|
|
- updateInfo,
|
|
|
- defaultAddress, deleteAddress,
|
|
|
- getshipAreaListInfo
|
|
|
+ updateInfo
|
|
|
} from '@/api/doc/client/client.js'
|
|
|
import Cancledialog from '@/components/Dialog/Cancledialog.vue'
|
|
|
import Pagination from '@/components/Pagination'
|
|
|
-import {provinceAndCityData, regionData, CodeToText, TextToCode} from 'element-china-area-data'
|
|
|
-import {getLogisticsInfoList, parseAddress} from "@/api/order/orderDetail";
|
|
|
+import {provinceAndCityData, regionData, CodeToText, TextToCode} from 'element-china-area-data';
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
@@ -311,7 +81,6 @@ export default {
|
|
|
return {
|
|
|
parseCustomer:"",
|
|
|
parseAddress: '',
|
|
|
- sendKinds: [],
|
|
|
sendType:false,
|
|
|
shipAreaList: [],
|
|
|
tempRoute: {},
|
|
|
@@ -320,19 +89,8 @@ export default {
|
|
|
adrValue1: '',
|
|
|
adrValue: '',
|
|
|
options: regionData, // 地址地区信息
|
|
|
- shipModeList: [],
|
|
|
- total: 0,
|
|
|
- gridData: [],
|
|
|
addAddressFlag: false,
|
|
|
labelPosition: 'right',
|
|
|
- formLabelAlign: {
|
|
|
- linkManName: '',
|
|
|
- linkManPhone: '',
|
|
|
- address: '',
|
|
|
- idShipMode: '',
|
|
|
- shipModeName: '',
|
|
|
- shipMode: ''
|
|
|
- },
|
|
|
title: '',
|
|
|
cityshow: false,
|
|
|
selected1: [], // 省市区
|
|
|
@@ -345,19 +103,7 @@ export default {
|
|
|
keyWord: ''
|
|
|
},
|
|
|
ruleForm: {},
|
|
|
- paytypeList: [],
|
|
|
- industryList: [],
|
|
|
- levelList: [],
|
|
|
rules: {
|
|
|
- industryName: [
|
|
|
- {required: true, message: '请选择行业信息', trigger: 'change'}
|
|
|
- ],
|
|
|
- levelName: [
|
|
|
- {required: true, message: '请选择客户等级', trigger: 'change'}
|
|
|
- ],
|
|
|
- payMode: [
|
|
|
- {required: true, message: '请选择付款方式', trigger: 'change'}
|
|
|
- ],
|
|
|
clientName: [
|
|
|
{required: true, message: '请填写客户名称', trigger: 'blur'}
|
|
|
],
|
|
|
@@ -371,19 +117,12 @@ export default {
|
|
|
{required: true, message: '请填写详细地址', trigger: 'blur'}
|
|
|
]
|
|
|
},
|
|
|
- listData: {
|
|
|
- total: 0,
|
|
|
- page: 1,
|
|
|
- pageSize: 10
|
|
|
- },
|
|
|
confirmdialog: false,
|
|
|
listLoading: false,
|
|
|
- tableData: [],
|
|
|
menuId: ''
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- this.getInfoData()
|
|
|
// console.log(this.isEdit);
|
|
|
if (this.isEdit) {
|
|
|
this.title = '编辑客户信息(' + this.$route.query.clientName + ')'
|
|
|
@@ -396,119 +135,10 @@ export default {
|
|
|
}
|
|
|
// alert("1")
|
|
|
this.tempRoute = Object.assign({}, this.$route);
|
|
|
- this.getSendKind();
|
|
|
|
|
|
this.iscityShow()
|
|
|
},
|
|
|
methods: {
|
|
|
- parseCustomerBtn() {
|
|
|
- const _that = this
|
|
|
- if (!_that.parseCustomer) {
|
|
|
- _that.$message.warning('请粘贴客户信息')
|
|
|
- return
|
|
|
- }
|
|
|
- var newStr = _that.parseCustomer.replace(/[\r\n]/g,"");
|
|
|
- var customeyArray = newStr.split("客户名称-");
|
|
|
- if(customeyArray.length>0){
|
|
|
- // console.log(customeyArray);
|
|
|
- var str1 = customeyArray[1].split("姓名-");
|
|
|
- // console.log(str1);
|
|
|
- var str2 = str1[1].split("电话-");
|
|
|
- // console.log(str2);
|
|
|
- var str3 = str2[1].split("地址-");
|
|
|
- // console.log(str3);
|
|
|
-
|
|
|
- _that.$set(_that.ruleForm,'clientName',str1[0]);
|
|
|
- _that.$set(_that.ruleForm,'contactMan',str2[0]);
|
|
|
- _that.$set(_that.ruleForm,'contactPhone',str3[0]);
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- parseAddressBtn() {
|
|
|
- const _that = this
|
|
|
- if(!_that.parseAddress){
|
|
|
- _that.$message.warning('请粘贴地址')
|
|
|
- return
|
|
|
- }
|
|
|
- var data = {
|
|
|
- 'address': _that.parseAddress
|
|
|
- }
|
|
|
- parseAddress(data).then(response => {
|
|
|
- var data = response.data[0];
|
|
|
- _that.$set(_that.formLabelAlign,'linkManName',data.name);
|
|
|
- if (data.mobile) {
|
|
|
- _that.$set(_that.formLabelAlign,'linkManPhone',data.mobile);
|
|
|
- }
|
|
|
- if (data.phone) {
|
|
|
- _that.$set(_that.formLabelAlign,'linkManPhone',data.phone);
|
|
|
- }
|
|
|
- _that.adrValue = data.province + "/" + data.city + "/" + data.county;
|
|
|
- _that.$set(_that.formLabelAlign,'address',data.details);
|
|
|
- // console.log(_that.sendAddressList);
|
|
|
- // console.log(_that.addressOption);
|
|
|
- var addressOption = []
|
|
|
- if (data.province) {
|
|
|
- addressOption.push(TextToCode[data.province].code)
|
|
|
- if (data.city) {
|
|
|
- addressOption.push(TextToCode[data.province][data.city].code)
|
|
|
- if (data.county) {
|
|
|
- addressOption.push(TextToCode[data.province][data.city][data.county].code)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- // console.log(addressOption);
|
|
|
- _that.selectedOptions = addressOption;
|
|
|
- }).catch(err => {
|
|
|
- _that.$message.error(err)
|
|
|
- })
|
|
|
-
|
|
|
- },
|
|
|
- // 选择物流档案
|
|
|
- chooseLogistics(sendType) {
|
|
|
- // console.log(row);
|
|
|
- const _that = this
|
|
|
- if (sendType) {
|
|
|
- _that.getLogisticsInfo()
|
|
|
- } else {
|
|
|
- _that.getSendKind()
|
|
|
- }
|
|
|
- },
|
|
|
- // 获取发货方式
|
|
|
- getSendKind() {
|
|
|
- var _that = this
|
|
|
- getshipModeListInfo().then(response => {
|
|
|
- // console.log('getSendKind', response)
|
|
|
- _that.sendKinds = response.data
|
|
|
- }).catch(err => {
|
|
|
- console.log(err)
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- // 获取物流档案
|
|
|
- getLogisticsInfo() {
|
|
|
- var _that = this
|
|
|
- var data = {
|
|
|
- params: {
|
|
|
- enable: 1
|
|
|
- }
|
|
|
- }
|
|
|
- getLogisticsInfoList(data).then(response => {
|
|
|
- // console.log('getSendKind', response)
|
|
|
- _that.sendKinds = response.data
|
|
|
- }).catch(err => {
|
|
|
- // console.log(err)
|
|
|
- })
|
|
|
- },
|
|
|
- addRefreshBtn() {
|
|
|
- const _that = this
|
|
|
- _that.ruleForm = {}
|
|
|
- _that.formLabelAlign = {}
|
|
|
- _that.gridData = []
|
|
|
- },
|
|
|
- editRefreshBtn() {
|
|
|
- this.getInfoData()
|
|
|
- this.getClientData()
|
|
|
- },
|
|
|
setTagsViewTitle() {
|
|
|
const title = '编辑客户'
|
|
|
|
|
|
@@ -523,128 +153,36 @@ export default {
|
|
|
},
|
|
|
getClientData() {
|
|
|
const _that = this
|
|
|
- // console.log(_that.$route.query.id);
|
|
|
- // console.log(this.$route.query.clientName);
|
|
|
var data = {
|
|
|
idClient: _that.$route.query.id
|
|
|
}
|
|
|
getInfoById(data).then(res => {
|
|
|
// console.log("getInfoById",res);
|
|
|
+
|
|
|
var datas = res.data
|
|
|
this.setTagsViewTitle()
|
|
|
- // console.log("getInfoById",datas);
|
|
|
- // var addArray = [];
|
|
|
- // addArray.push(datas.province);
|
|
|
- // addArray.push(datas.city)
|
|
|
- // addArray.push(datas.area)
|
|
|
- // _that.selectedOptions1 = addArray;
|
|
|
-
|
|
|
var addressOption = [];
|
|
|
if(datas.province){
|
|
|
addressOption.push(TextToCode[datas.province].code)
|
|
|
addressOption.push(TextToCode[datas.province][datas.city].code)
|
|
|
addressOption.push(TextToCode[datas.province][datas.city][datas.area].code)
|
|
|
}
|
|
|
-
|
|
|
- // console.log(addressOption);
|
|
|
- // _that.addressInfo.selectedOptions = addressOption;
|
|
|
- _that.selectedOptions1 = addressOption
|
|
|
+ _that.selectedOptions = addressOption
|
|
|
|
|
|
_that.ruleForm = {
|
|
|
id: _that.$route.query.id,
|
|
|
- idIndustry: datas.idIndustry,
|
|
|
- industryName: datas.industryName,
|
|
|
clientName: datas.clientName,
|
|
|
contactMan: datas.contactMan,
|
|
|
contactPhone: datas.contactPhone,
|
|
|
province: datas.province,
|
|
|
city: datas.city,
|
|
|
area: datas.area,
|
|
|
- address: datas.address,
|
|
|
- overdraftQuota: datas.overdraftQuota,
|
|
|
- idLevel: datas.idLevel,
|
|
|
- levelName: datas.levelName,
|
|
|
- idPayMode: datas.idPayMode,
|
|
|
- payMode: datas.payMode
|
|
|
+ address: datas.address
|
|
|
}
|
|
|
- _that.gridData = datas.addressList
|
|
|
}).catch(err => {
|
|
|
_that.$message.error(err)
|
|
|
})
|
|
|
},
|
|
|
- onSubmit() {
|
|
|
- const _that = this
|
|
|
- // 在列表中添加地址
|
|
|
- if (!_that.formLabelAlign.shipMode) {
|
|
|
- _that.$message({
|
|
|
- message: '发货方式不能为空',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- // if (!_that.formLabelAlign.shipArea) {
|
|
|
- // _that.$message({
|
|
|
- // message: '发货方式区域为空',
|
|
|
- // type: 'warning'
|
|
|
- // })
|
|
|
- // return
|
|
|
- // }
|
|
|
- if (!_that.formLabelAlign.linkManName) {
|
|
|
- _that.$message({
|
|
|
- message: '收货人不能为空',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- if (!_that.formLabelAlign.linkManPhone) {
|
|
|
- _that.$message({
|
|
|
- message: '联系电话不能为空',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- if (_that.adrValue.length <= 0) {
|
|
|
- _that.$message({
|
|
|
- message: '省市区不能为空',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- if (!_that.formLabelAlign.address) {
|
|
|
- _that.$message({
|
|
|
- message: '具体地址不能为空',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- _that.parseAddress= "";
|
|
|
- var shipModeName = "";
|
|
|
- if(_that.sendType){
|
|
|
- shipModeName =_that.sendKinds.find(x=> x.id === _that.formLabelAlign.shipMode).logisticName;
|
|
|
- var shipOrLogistics = 1;
|
|
|
- }else {
|
|
|
- shipModeName =_that.sendKinds.find(x=> x.id === _that.formLabelAlign.shipMode).modeName;
|
|
|
- var shipOrLogistics = 0;
|
|
|
- }
|
|
|
- const data = {
|
|
|
- receiveMan: _that.formLabelAlign.linkManName,
|
|
|
- receivePhone: _that.formLabelAlign.linkManPhone,
|
|
|
- // idShipArea: _that.formLabelAlign.shipArea.split(',')[1],
|
|
|
- // shipArea: _that.formLabelAlign.shipArea.split(',')[0],
|
|
|
- idShipMode: _that.formLabelAlign.shipMode,
|
|
|
- shipModeName: shipModeName,
|
|
|
- province: _that.adrValue.split('/')[0],
|
|
|
- city: _that.adrValue.split('/')[1],
|
|
|
- area: _that.adrValue.split('/')[2],
|
|
|
- address: _that.formLabelAlign.address,
|
|
|
- shipOrLogistics: shipOrLogistics
|
|
|
- }
|
|
|
- // console.log('data', data)
|
|
|
- _that.gridData.push(data);
|
|
|
- _that.formLabelAlign = {};
|
|
|
- _that.adrValue = '';
|
|
|
- _that.selectedOptions = [];
|
|
|
- },
|
|
|
// 增加
|
|
|
addBtn(formName) {
|
|
|
const _that = this
|
|
|
@@ -659,21 +197,13 @@ export default {
|
|
|
// console.log("ruleForm",_that.ruleForm);
|
|
|
|
|
|
var dataForm = {
|
|
|
- idIndustry: _that.ruleForm.industryName.split(',')[1],
|
|
|
- industryName: _that.ruleForm.industryName.split(',')[0],
|
|
|
clientName: _that.ruleForm.clientName,
|
|
|
contactMan: _that.ruleForm.contactMan,
|
|
|
contactPhone: _that.ruleForm.contactPhone,
|
|
|
- province: "",
|
|
|
- city: "",
|
|
|
- area: "",
|
|
|
- address: "",
|
|
|
- overdraftQuota: _that.ruleForm.overdraftQuota * 100,
|
|
|
- idLevel: _that.ruleForm.levelName.split(',')[1],
|
|
|
- levelName: _that.ruleForm.levelName.split(',')[0],
|
|
|
- idPayMode: _that.ruleForm.payMode.split(',')[1],
|
|
|
- payMode: _that.ruleForm.payMode.split(',')[0],
|
|
|
- addressList: _that.gridData
|
|
|
+ province: _that.ruleForm.province,
|
|
|
+ city: _that.ruleForm.city,
|
|
|
+ area: _that.ruleForm.area,
|
|
|
+ address: _that.ruleForm.contactPhone
|
|
|
}
|
|
|
// console.log('dataForm', dataForm)
|
|
|
var info = JSON.stringify(dataForm)
|
|
|
@@ -681,11 +211,6 @@ export default {
|
|
|
var data = {
|
|
|
'clientInfo': info
|
|
|
}
|
|
|
-
|
|
|
- if (_that.gridData.length < 1) {
|
|
|
- _that.$message.error('请添加收货地址')
|
|
|
- return
|
|
|
- }
|
|
|
// console.log("clientLevel",data);
|
|
|
addClientInfo(data).then(res => {
|
|
|
// console.log('addClientInfo', res)
|
|
|
@@ -710,64 +235,12 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- getInfoData() {
|
|
|
- const _that = this
|
|
|
- if (_that.industryList.length <= 0) {
|
|
|
- getIndustryInfo().then(response => {
|
|
|
- // console.log("industryList", response.data)
|
|
|
- const data = response.data
|
|
|
- // // 组合表单数据
|
|
|
- _that.industryList = response.data;
|
|
|
- _that.$set(_that.ruleForm,'industryName',response.data[0].industryName);
|
|
|
- // console.log(_that.shipAreaList);
|
|
|
- }).catch(err => {
|
|
|
- console.log(err)
|
|
|
- })
|
|
|
- }
|
|
|
- if (_that.levelList.length <= 0) {
|
|
|
- getLevelInfo().then(response => {
|
|
|
- // console.log("levelList", response.data)
|
|
|
- const data = response.data
|
|
|
- // // 组合表单数据
|
|
|
- _that.levelList = response.data
|
|
|
- _that.$set(_that.ruleForm,'levelName',response.data[0].levelName);
|
|
|
- }).catch(err => {
|
|
|
- console.log(err)
|
|
|
- })
|
|
|
- }
|
|
|
- // 付款方式
|
|
|
- if (_that.paytypeList.length <= 0) {
|
|
|
- getPaytypeInfo().then(response => {
|
|
|
- // console.log("Paytype", response.data)
|
|
|
- const data = response.data
|
|
|
- // // 组合表单数据
|
|
|
- _that.paytypeList = response.data
|
|
|
- _that.$set(_that.ruleForm,'payMode',response.data[0].payMode);
|
|
|
- }).catch(err => {
|
|
|
- console.log(err)
|
|
|
- })
|
|
|
- }
|
|
|
- // 发货方式
|
|
|
- // // 发货区域
|
|
|
- // if (_that.shipAreaList.length <= 0) {
|
|
|
- // getshipAreaListInfo().then(response => {
|
|
|
- // // console.log('shipArea', response)
|
|
|
- // const data = response.data
|
|
|
- // // // 组合表单数据
|
|
|
- // _that.shipAreaList = response.data
|
|
|
- // // console.log(_that.shipAreaList);
|
|
|
- // }).catch(err => {
|
|
|
- // console.log(err)
|
|
|
- // })
|
|
|
- // }
|
|
|
- },
|
|
|
- // 选择地区以后触发
|
|
|
- handleChange1(value) {
|
|
|
- this.adrValue1 = CodeToText[value[0]] + '/' + CodeToText[value[1]] + '/' + CodeToText[value[2]]
|
|
|
- // console.log('adrValue1', this.adrValue1)
|
|
|
- },
|
|
|
handleChange(value) {
|
|
|
- this.adrValue = CodeToText[value[0]] + '/' + CodeToText[value[1]] + '/' + CodeToText[value[2]]
|
|
|
+ const _that = this
|
|
|
+ _that.adrValue = CodeToText[value[0]] + '/' + CodeToText[value[1]] + '/' + CodeToText[value[2]]
|
|
|
+ _that.ruleForm.province = CodeToText[value[0]]
|
|
|
+ _that.ruleForm.city = CodeToText[value[1]]
|
|
|
+ _that.ruleForm.area = CodeToText[value[2]]
|
|
|
// console.log('adrValue', this.adrValue)
|
|
|
},
|
|
|
handleCurrentChange(val) {
|
|
|
@@ -785,58 +258,20 @@ export default {
|
|
|
this.cityshow = true
|
|
|
}, 0)
|
|
|
},
|
|
|
- // 增加客户信息
|
|
|
- handleCreateAdd() {
|
|
|
- const _that = this
|
|
|
- _that.ruleForm = {}
|
|
|
- _that.dialogTitle = '增加客户'
|
|
|
- _that.dialogStatus = '1'
|
|
|
- _that.dialogVisible = true
|
|
|
- _that.iscityShow()
|
|
|
- },
|
|
|
// 修改档案
|
|
|
editBtn(formName) {
|
|
|
const _that = this
|
|
|
// console.log("编辑");
|
|
|
_that.$refs[formName].validate((valid) => {
|
|
|
- if (_that.ruleForm.industryName.split(',').length > 1) {
|
|
|
- var industryName = _that.ruleForm.industryName.split(',')[0]
|
|
|
- var idIndustry = _that.ruleForm.industryName.split(',')[1]
|
|
|
- } else {
|
|
|
- var industryName = _that.ruleForm.industryName
|
|
|
- var idIndustry = _that.ruleForm.idIndustry
|
|
|
- }
|
|
|
- if (_that.ruleForm.levelName.split(',').length > 1) {
|
|
|
- var levelName = _that.ruleForm.levelName.split(',')[0]
|
|
|
- var idLevel = _that.ruleForm.levelName.split(',')[1]
|
|
|
- } else {
|
|
|
- var levelName = _that.ruleForm.levelName
|
|
|
- var idLevel = _that.ruleForm.idLevel
|
|
|
- }
|
|
|
- if (_that.ruleForm.payMode.split(',').length > 1) {
|
|
|
- var payMode = _that.ruleForm.payMode.split(',')[0]
|
|
|
- var idPayMode = _that.ruleForm.payMode.split(',')[1]
|
|
|
- } else {
|
|
|
- var payMode = _that.ruleForm.payMode
|
|
|
- var idPayMode = _that.ruleForm.idPayMode
|
|
|
- }
|
|
|
var dataForm = {
|
|
|
id: _that.$route.query.id,
|
|
|
- idIndustry: idIndustry,
|
|
|
- industryName: industryName,
|
|
|
clientName: _that.ruleForm.clientName,
|
|
|
contactMan: _that.ruleForm.contactMan,
|
|
|
contactPhone: _that.ruleForm.contactPhone,
|
|
|
- // province: _that.ruleForm.province,
|
|
|
- // city: _that.ruleForm.city,
|
|
|
- // area: _that.ruleForm.area,
|
|
|
- // address: _that.ruleForm.address,
|
|
|
- overdraftQuota: _that.ruleForm.overdraftQuota,
|
|
|
- idLevel: idLevel,
|
|
|
- levelName: levelName,
|
|
|
- idPayMode: idPayMode,
|
|
|
- payMode: payMode,
|
|
|
- // addressList: _that.gridData
|
|
|
+ province: _that.ruleForm.province,
|
|
|
+ city: _that.ruleForm.city,
|
|
|
+ area: _that.ruleForm.area,
|
|
|
+ address: _that.ruleForm.address
|
|
|
}
|
|
|
// console.log("dataFormred",dataForm);
|
|
|
var info = JSON.stringify(dataForm)
|
|
|
@@ -855,6 +290,7 @@ export default {
|
|
|
})
|
|
|
_that.$store.dispatch("tagsView/delView", _that.$route);
|
|
|
_that.$router.push({path: '/doc/clientList'})
|
|
|
+
|
|
|
} else {
|
|
|
_that.$message.error(res.msg)
|
|
|
}
|
|
|
@@ -864,32 +300,6 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
- // 启用禁用
|
|
|
- editStatus(id, status) {
|
|
|
- var _that = this;
|
|
|
- var data = {
|
|
|
- id: id,
|
|
|
- enable: status
|
|
|
- }
|
|
|
- var params = {
|
|
|
- 'clientInfo': JSON.stringify(data)
|
|
|
- }
|
|
|
-
|
|
|
- var url = '/doc/enableClientInfo'
|
|
|
- _that.$refs.confirmDialog.updataClick(params, url)
|
|
|
- },
|
|
|
- // 刷新表格
|
|
|
- tableRefresh() {
|
|
|
- // 刷新变革
|
|
|
- this.getTableInfo()
|
|
|
- },
|
|
|
-
|
|
|
- // 搜索
|
|
|
- searchData() {
|
|
|
- this.listData.page = 1
|
|
|
- this.getTableInfo()
|
|
|
- },
|
|
|
carEditOrderAddr(id, name) {
|
|
|
this.$refs.address.outerVisible = true
|
|
|
this.$refs.address.idClient = id
|
|
|
@@ -897,80 +307,18 @@ export default {
|
|
|
var pageNum = 1
|
|
|
this.$refs.address.getInfo(pageNum, '')
|
|
|
this.$refs.address.searchVal = ''
|
|
|
- },
|
|
|
- getAdress(adr) {
|
|
|
- // console.log(adr);
|
|
|
- // this.defaultAddress = adr;
|
|
|
- // // console.log(this.defaultAddress);
|
|
|
- // this.$forceUpdate();//重绘
|
|
|
- },
|
|
|
- defaultFlagClick(index, id) {
|
|
|
- const _that = this
|
|
|
- _that.$confirm('设置默认?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消'
|
|
|
- }).then(() => {
|
|
|
- var data = {
|
|
|
- 'idReceiveAddress': id
|
|
|
- }
|
|
|
-
|
|
|
- defaultAddress(data).then(res => {
|
|
|
- // console.log(res);
|
|
|
- if (res.httpCode == 200) {
|
|
|
- _that.$message({
|
|
|
- message: '设置成功',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- _that.getClientData()
|
|
|
- } else {
|
|
|
- _that.$message.error(res.msg)
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- _that.$message.error(err)
|
|
|
- })
|
|
|
- }).catch(() => {
|
|
|
-
|
|
|
- })
|
|
|
- },
|
|
|
- carAddressDeleteClick(index, id) {
|
|
|
- const _that = this
|
|
|
- _that.$confirm('确认删除?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消'
|
|
|
- }).then(() => {
|
|
|
- var data = {
|
|
|
- 'idReceiveAddress': id
|
|
|
- }
|
|
|
-
|
|
|
- deleteAddress(data).then(res => {
|
|
|
- // console.log(res);
|
|
|
- if (res.httpCode == 200) {
|
|
|
- _that.$message({
|
|
|
- message: '删除成功',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- _that.getClientData()
|
|
|
- } else {
|
|
|
- _that.$message.error(res.msg)
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- _that.$message.error(err)
|
|
|
- })
|
|
|
- }).catch(() => {
|
|
|
-
|
|
|
- })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
<style>
|
|
|
-.area-select .area-selected-trigger {
|
|
|
- padding: 0px 20px 7px 12px !important;
|
|
|
-}
|
|
|
+/*.area-select .area-selected-trigger {*/
|
|
|
+/* padding: 0px 20px 7px 12px !important;*/
|
|
|
+/*}*/
|
|
|
|
|
|
-.area-select {
|
|
|
- height: 40px !important;
|
|
|
-}
|
|
|
+/*.area-select {*/
|
|
|
+/* height: 40px !important;*/
|
|
|
+/*}*/
|
|
|
</style>
|
|
|
<style lang="scss" scoped>
|
|
|
.el-page-header__content {
|