|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-button :size="btnSize?btnSize:'mini'" :type="btnType?btnType:'text'" @click="onShow">编 辑</el-button>
|
|
|
- <el-drawer title="编辑档案" direction="rtl" append-to-body :visible.sync="dialogFormVisible" :show-close="false" size="600px">
|
|
|
+ <el-button size="mini" type="primary" @click="onShow">编 辑</el-button>
|
|
|
+ <el-drawer title="新建档案" direction="rtl" append-to-body :visible.sync="dialogFormVisible" :show-close="false" size="600px">
|
|
|
<div class="drawer__panel">
|
|
|
<el-row :gutter="20">
|
|
|
<el-form :model="form" :rules="rules" ref="form" label-width="90px" label-position="right" size="mini">
|
|
@@ -21,10 +21,10 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="省市县" prop="value">
|
|
|
+ <el-form-item label="省市县" prop="province">
|
|
|
<el-cascader
|
|
|
style="width:100%"
|
|
|
- v-model="form.value"
|
|
|
+ v-model="form.province"
|
|
|
:options="basicData.data().areaData"
|
|
|
@change="cascaderChange" clearable>
|
|
|
</el-cascader>
|
|
@@ -35,7 +35,25 @@
|
|
|
<el-input v-model="form.taxno" placeholder="输入税号"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12" v-if="!hideGrade">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="免运费额度" prop="freefreightamount">
|
|
|
+ <el-input v-model.number="form.freefreightamount" placeholder="请输入免运费额度"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="可退货天数" prop="limitreturnday">
|
|
|
+ <el-input v-model.number="form.limitreturnday" placeholder="请输入订单可退货天数"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="开票节点" prop="invoicingpoint">
|
|
|
+ <el-radio-group v-model="form.invoicingpoint">
|
|
|
+ <el-radio :label="1">订单审核</el-radio>
|
|
|
+ <el-radio :label="2">发货</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
<el-form-item label="企业等级">
|
|
|
<el-select style="width:100%" v-model="form.grade" placeholder="请选择">
|
|
|
<el-option
|
|
@@ -66,14 +84,27 @@
|
|
|
<script>
|
|
|
import {mapGetters} from 'vuex'
|
|
|
export default {
|
|
|
- props:['data','btnType','btnSize','hideGrade'],
|
|
|
+ props:['data'],
|
|
|
data () {
|
|
|
return {
|
|
|
dialogFormVisible:false,
|
|
|
form:{
|
|
|
- enterprisename:'',
|
|
|
- value:[],
|
|
|
- sys_enterpriseid:0
|
|
|
+ "address": "",
|
|
|
+ "city": "",
|
|
|
+ "changeby": "",
|
|
|
+ "county": "",
|
|
|
+ "phonenumber": "",
|
|
|
+ "sys_enterpriseid": 0,
|
|
|
+ "enterprisename": "",
|
|
|
+ "province": "",
|
|
|
+ "contact": "",
|
|
|
+ "taxno": "",
|
|
|
+ "limitreturnday": "", //订单可退货天数
|
|
|
+ "freefreightamount": "", //免运费额度
|
|
|
+ "latitude": "", //纬度
|
|
|
+ "longitude": "", //经度
|
|
|
+ "invoicingpoint": 1, //开票节点(1:订单审核:2:发货)
|
|
|
+ "saleclassauth": 1 //是否需要经营授权,默认1
|
|
|
},
|
|
|
agent_level:[],
|
|
|
rules:{
|
|
@@ -90,12 +121,18 @@ export default {
|
|
|
taxno: [
|
|
|
{ required: true, message: '输入税号', trigger: 'blur' },
|
|
|
],
|
|
|
- value: [
|
|
|
+ province: [
|
|
|
{ required: true, message: '选择省市县', trigger: 'change' },
|
|
|
],
|
|
|
address:[
|
|
|
{ required: true, message: '输入详细地址', trigger: 'blur' },
|
|
|
],
|
|
|
+ freefreightamount:[
|
|
|
+ {type:'number',message:'请输入数字',trigger:'blur'}
|
|
|
+ ],
|
|
|
+ limitreturnday:[
|
|
|
+ {type:'number',message:'请输入数字',trigger:'blur'}
|
|
|
+ ],
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -106,30 +143,27 @@ export default {
|
|
|
},
|
|
|
methods:{
|
|
|
onShow () {
|
|
|
- this.query_sysoptions()
|
|
|
- this.$store.dispatch('queryArealist')
|
|
|
- let arr = ['province','city','county']
|
|
|
- arr.forEach(e=>{
|
|
|
- this.data[e] !== '' ?this.form.value.push(this.data[e]):''
|
|
|
- })
|
|
|
this.form = Object.assign({},this.form,this.data)
|
|
|
- this.form.value = [this.data.province, this.data.city, this.data.county]
|
|
|
+ if (this.form.province) {
|
|
|
+ this.form.province = [this.form.province,this.form.city,this.form.county]
|
|
|
+ }
|
|
|
this.dialogFormVisible = true
|
|
|
-
|
|
|
+ this.query_sysoptions()
|
|
|
},
|
|
|
async query_sysoptions () {
|
|
|
const res = await this.$store.dispatch('optiontypeselect','agentgrade')
|
|
|
this.agent_level = res.data
|
|
|
},
|
|
|
cascaderChange (val) {
|
|
|
- if (val.length === 1)
|
|
|
- return this.form = Object.assign({},this.form,{province:val[0],city:'',county:''})
|
|
|
- this.form = Object.assign({},this.form,{province:val[0],city:val[1],county:val[2]})
|
|
|
+ this.form.province = val
|
|
|
|
|
|
},
|
|
|
onSubmit () {
|
|
|
this.$refs['form'].validate(async (valid) => {
|
|
|
if (!valid) return false
|
|
|
+ this.form.city = this.form.province[1]
|
|
|
+ this.form.county = this.form.province[2]
|
|
|
+ this.form.province = this.form.province[0]
|
|
|
const res = await this.$api.requested({
|
|
|
"id": 20220920084101,
|
|
|
"content":this.form
|