|
|
|
@ -191,11 +191,12 @@
|
|
|
|
|
v-model="box" |
|
|
|
|
width="35%" |
|
|
|
|
:before-close="beforeClose" |
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
append-to-body> |
|
|
|
|
<el-form :disabled="view" ref="form" :model="form" :rules="rules" label-width="120px"> |
|
|
|
|
<!-- 表单字段 --> |
|
|
|
|
<el-form-item label="客户编码" prop="reserve1"> |
|
|
|
|
<el-input v-model="form.reserve1" placeholder="请输入客户编码" style="width: 100%" /> |
|
|
|
|
<el-input v-model="form.reserve1" :validate-method="validateInput" placeholder="请输入客户编码" style="width: 100%" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="客户名称" prop="clientName"> |
|
|
|
|
<el-input v-model="form.clientName" placeholder="请输入客户名称" style="width: 100%" /> |
|
|
|
@ -290,6 +291,7 @@
|
|
|
|
|
:on-success="(response, file, fileList) => {uploadSuccess(fileList)}" |
|
|
|
|
:on-remove="handleRemove" |
|
|
|
|
:before-remove="beforeRemove" |
|
|
|
|
:before-upload="beforeUploadFn" |
|
|
|
|
:limit="3" |
|
|
|
|
:on-exceed="handleExceed" |
|
|
|
|
> |
|
|
|
@ -371,7 +373,7 @@
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { getList, getDetail, add, update, updateCargoControl,remove } from '@/api/basicdata/basicClient'; |
|
|
|
|
import { getList, getDetail, add, update, updateCargoControl, remove, getListCode } from '@/api/basicdata/basicClient'; |
|
|
|
|
import option from '@/option/basicdata/basicClient'; |
|
|
|
|
import { mapGetters } from 'vuex'; |
|
|
|
|
import BasicShopSub from '@/views/basicdata/brand/basicShopSub.vue'; |
|
|
|
@ -474,13 +476,14 @@ export default {
|
|
|
|
|
reserve1: [ |
|
|
|
|
{ required: true, message: '请输入客户编码', trigger: 'blur' }, |
|
|
|
|
// { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' } |
|
|
|
|
{ validator: this.validateInput, trigger: 'blur' } |
|
|
|
|
], |
|
|
|
|
clientName: [ |
|
|
|
|
{ required: true, message: '请输入客户名称', trigger: 'blur' }, |
|
|
|
|
// { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' } |
|
|
|
|
], |
|
|
|
|
typeService: [ |
|
|
|
|
{ required: true, message: '请选择客户端类型', trigger: 'change' } |
|
|
|
|
{ required: true, message: '请选择客户端类型', trigger: 'blur' } |
|
|
|
|
], |
|
|
|
|
businessType: [ |
|
|
|
|
{ required: true, message: '请选择配送业务类型', trigger: 'change' }, |
|
|
|
@ -549,9 +552,30 @@ export default {
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
//远程校验 |
|
|
|
|
validateInput(value,a) { |
|
|
|
|
// console.log("执行了",value,a); |
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
// 发送异步请求到服务器进行校验 |
|
|
|
|
// 假设请求返回的数据为 { valid: true } 表示校验通过 |
|
|
|
|
// 模拟异步请求,假设延时1秒 |
|
|
|
|
setTimeout(async () => { |
|
|
|
|
const response = { valid: false }; // 假设校验通过 |
|
|
|
|
await getListCode({ code: a }).then(res =>{ |
|
|
|
|
// console.log("smgsmg",res.data); |
|
|
|
|
if (res.data.data.length > 0) { |
|
|
|
|
reject(new Error('编码已存在')); // 校验不通过,调用 reject() 并传递错误信息 |
|
|
|
|
} else { |
|
|
|
|
resolve(); // 校验通过,调用 resolve() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, 1000); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
coverCharge(num) { |
|
|
|
|
this.distriType = false; |
|
|
|
|
console.log(num); |
|
|
|
|
// console.log(num); |
|
|
|
|
num.forEach(i =>{ |
|
|
|
|
if(i == '3'){ |
|
|
|
|
this.distriType = true; |
|
|
|
@ -565,7 +589,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
// |
|
|
|
|
handleMall(row) { |
|
|
|
|
console.log('>>>', row); |
|
|
|
|
// console.log('>>>', row); |
|
|
|
|
this.$router.push({ |
|
|
|
|
path: '/basicdata/brand/basicdataTripartiteMall', |
|
|
|
|
query: { |
|
|
|
@ -578,7 +602,7 @@ export default {
|
|
|
|
|
//打开文件 |
|
|
|
|
downloadLink(row) { |
|
|
|
|
console.log('>>>>>', row); |
|
|
|
|
window.open('http://192.168.2.100:8012/onlinePreview?url=' + encodeURIComponent(Base64.encode(row.leaseAccessories))); |
|
|
|
|
window.open('http://192.168.10.100:8012/onlinePreview?url=' + encodeURIComponent(Base64.encode(row.leaseAccessories))); |
|
|
|
|
}, |
|
|
|
|
//控制控货 |
|
|
|
|
makeCargo(row) { |
|
|
|
@ -643,6 +667,20 @@ export default {
|
|
|
|
|
// console.log('3333333',file, fileList); |
|
|
|
|
this.showImgViewer = false; |
|
|
|
|
}, |
|
|
|
|
//文件上传前的一些业务需要的校验 |
|
|
|
|
beforeUploadFn (file, fileList) { |
|
|
|
|
// console.log("上传校验"); |
|
|
|
|
let fileNameLength = file.name.lastIndexOf('.') // 文件名开始到最后一个点的长度 |
|
|
|
|
let fileFormat = file.name.substring(fileNameLength + 1, (file.name).length) |
|
|
|
|
fileFormat = fileFormat.toLowerCase() |
|
|
|
|
let imgArr = ['txt'] |
|
|
|
|
if (imgArr.includes(fileFormat)) { |
|
|
|
|
// this.warning(this.$t('lang.fileFormat')) |
|
|
|
|
return false |
|
|
|
|
} else { |
|
|
|
|
return true |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
handlePreview(file) { |
|
|
|
|
console.log('111111', file); |
|
|
|
|
this.imgPreviewUrl[0] = file.response.data.link; |
|
|
|
@ -1013,6 +1051,10 @@ export default {
|
|
|
|
|
this.form = {}; |
|
|
|
|
this.view = false; |
|
|
|
|
}, |
|
|
|
|
onClose(done) { |
|
|
|
|
|
|
|
|
|
console.log("执行了"); |
|
|
|
|
}, |
|
|
|
|
selectionChange(list) { |
|
|
|
|
this.selectionList = list; |
|
|
|
|
}, |
|
|
|
|