Commit 213600ae authored by dragondean@qq.com's avatar dragondean@qq.com
parents 9259c5cf 1d24e683
import request from '@/utils/request'
// 校验手机号
export function validatorMobile(params) {
return request({
url: '/param/validator/mobile',
method: 'post',
params
})
}
...@@ -107,7 +107,7 @@ service.interceptors.response.use(res => { ...@@ -107,7 +107,7 @@ service.interceptors.response.use(res => {
Notification.error({ Notification.error({
title: msg title: msg
}) })
return Promise.reject('error') return Promise.reject(msg || 'error')
} else { } else {
return res.data return res.data
} }
......
...@@ -381,7 +381,7 @@ ...@@ -381,7 +381,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="开票电话" prop="billingTell"> <el-form-item label="开票电话" prop="billingTell">
<el-input v-model="form.billingTell" placeholder="请输入开票电话" /> <el-input v-model="form.billingTell" placeholder="请输入开票电话" maxlength="50" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
...@@ -417,6 +417,7 @@ import { getZhongPaoBest, getZhongPaoPage } from '@/api/ecw/zhongPao' ...@@ -417,6 +417,7 @@ import { getZhongPaoBest, getZhongPaoPage } from '@/api/ecw/zhongPao'
import { getCustomerContactsListByCustomer } from '@/api/ecw/customerContacts' import { getCustomerContactsListByCustomer } from '@/api/ecw/customerContacts'
import { getCountryListAll } from '@/api/ecw/country' import { getCountryListAll } from '@/api/ecw/country'
import Template from "@/views/cms/template"; import Template from "@/views/cms/template";
import {validatorMobile} from "@/api/ecw/validate"
export default { export default {
name: "edit", name: "edit",
...@@ -436,6 +437,10 @@ export default { ...@@ -436,6 +437,10 @@ export default {
this.form.customerContacts = r.data this.form.customerContacts = r.data
}) })
}) })
} else {
const obj = Object.assign({}, this.$route, { title: "自定义标题" })
this.$tab.updatePage(obj);
this.$tab.updatePage({...this.$route, meta: {...this.$route.meta, name: 'abc'}})
} }
getNodeList().then(r => { getNodeList().then(r => {
...@@ -492,7 +497,11 @@ export default { ...@@ -492,7 +497,11 @@ export default {
contactRules: { contactRules: {
name: [{ required: true, message: "请输入联系人", trigger: "blur" }], name: [{ required: true, message: "请输入联系人", trigger: "blur" }],
areaCode: [{ required: true, message: "请选择区号", trigger: "change" }], areaCode: [{ required: true, message: "请选择区号", trigger: "change" }],
phoneNew: [{ required: true, message: "请输入联系方式", trigger: "blur" }], phoneNew: [{
required: true,
trigger: "blur",
validator: this.phoneValidator
}],
}, },
// 网点 // 网点
nodeList: [], nodeList: [],
...@@ -515,6 +524,24 @@ export default { ...@@ -515,6 +524,24 @@ export default {
}, },
methods: { methods: {
phoneValidator(rule, value, callback){
if (!value) {
return callback(new Error('请输入联系方式'));
}
validatorMobile({
code: this.form.customerContacts.find(e => e.phoneNew === value).areaCode,
mobile: value
}).then(r => {
if (r.data){
callback()
} else {
callback(new Error(r.msg || '手机号验证失败'))
}
}).catch(e => {
console.error(e)
callback(new Error('手机号验证失败'))
})
},
handleDefaultChange($index){ handleDefaultChange($index){
// 只有一个联系人,设置成非默认 // 只有一个联系人,设置成非默认
if (this.form.customerContacts.length === 1 && this.form.customerContacts[0].isDefault === 0){ if (this.form.customerContacts.length === 1 && this.form.customerContacts[0].isDefault === 0){
...@@ -549,6 +576,10 @@ export default { ...@@ -549,6 +576,10 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
if(this.form.customerContacts.length === 0){
this.$modal.alert('至少添加一位联系人')
return
}
this.$refs["contactForm"].validate(valid1 => { this.$refs["contactForm"].validate(valid1 => {
this.$refs["form"].validate(valid2 => { this.$refs["form"].validate(valid2 => {
if (!valid1 || !valid2) { if (!valid1 || !valid2) {
...@@ -558,13 +589,16 @@ export default { ...@@ -558,13 +589,16 @@ export default {
this.$modal.msgError("至少填写一个联系人信息"); this.$modal.msgError("至少填写一个联系人信息");
return return
} }
const form = {...this.form, type: this.form.type?.join(','), taxRate: Number(this.form.taxRate)}
// 修改的提交 // 修改的提交
if (this.form.id != null) { if (this.form.id != null) {
this.form.customerContacts.forEach(e => { this.form.customerContacts.forEach(e => {
e.customerId = this.customerId e.customerId = this.customerId
}) })
updateCustomer(this.form).then(response => { updateCustomer(form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
// this.getList(); // this.getList();
...@@ -576,7 +610,7 @@ export default { ...@@ -576,7 +610,7 @@ export default {
return; return;
} }
// 添加的提交 // 添加的提交
createCustomer(this.form).then(response => { createCustomer(form).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
// this.getList(); // this.getList();
......
...@@ -120,13 +120,8 @@ ...@@ -120,13 +120,8 @@
</div> </div>
</el-card> </el-card>
<div style="text-align: center;margin-top: 15px" v-if="order.status !== 5"> <template v-if="order.parentOrderId && isEdit">
<el-button @click="escapeBol = true;" type="primary">转异</el-button> <h2>标签箱号</h2>
<el-button type="primary" @click="finishVisible = true">完成入仓</el-button>
</div>
<template v-if="order.status === 5">
<h2>标枪箱号</h2>
<div v-for="(item, index) in label.orderLabelDtoList" :key="index" style="margin-bottom: 10px"> <div v-for="(item, index) in label.orderLabelDtoList" :key="index" style="margin-bottom: 10px">
<el-input-number v-model="item.start" controls-position="right"></el-input-number> - <el-input-number v-model="item.start" controls-position="right"></el-input-number> -
...@@ -138,6 +133,10 @@ ...@@ -138,6 +133,10 @@
<el-button type="primary" @click="handleLabelSubmit">修改箱号</el-button> <el-button type="primary" @click="handleLabelSubmit">修改箱号</el-button>
</div> </div>
</template> </template>
<div style="text-align: center;margin-top: 15px" v-if="order.status !== 5">
<el-button @click="escapeBol = true;" type="primary">转异</el-button>
<el-button type="primary" @click="finishVisible = true">完成入仓</el-button>
</div>
</el-form> </el-form>
<warehouse-area-dialog ref="area" :visible.sync="areaVisible" v-model="form.orderLocationCreateReqVOList" <warehouse-area-dialog ref="area" :visible.sync="areaVisible" v-model="form.orderLocationCreateReqVOList"
...@@ -281,7 +280,7 @@ export default { ...@@ -281,7 +280,7 @@ export default {
orderId: this.orderId orderId: this.orderId
}).then(r => { }).then(r => {
if (r.code === 0){ if (r.code === 0){
this.$message.success(r.msg || '修改标签箱号成功')
} }
}) })
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<el-form ref="form" :model="form" label-width="80px"> <el-form ref="form" :model="form" label-width="80px">
<el-card class="box-card" style="margin-bottom: 15px"> <el-card class="box-card" style="margin-bottom: 15px">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<el-button style="float: right; padding: 3px 0" type="text" @click="$emit('delete')">删除</el-button> <el-button v-show="isShowDelete" style="float: right; padding: 3px 0" type="text" @click="$emit('delete')">删除</el-button>
</div> </div>
<el-form-item :label="'商标' + (index + 1)"> <el-form-item :label="'商标' + (index + 1)">
<el-input v-model="form.brandName" placeholder="商标"></el-input> <el-input v-model="form.brandName" placeholder="商标"></el-input>
...@@ -37,6 +37,10 @@ ...@@ -37,6 +37,10 @@
export default { export default {
name: "BrandForm", name: "BrandForm",
props: { props: {
isShowDelete: {
type: Boolean,
default: true
},
productTypeList: { productTypeList: {
type: Array, type: Array,
default: [] default: []
......
...@@ -110,6 +110,7 @@ ...@@ -110,6 +110,7 @@
<h3>包含商标列表</h3> <h3>包含商标列表</h3>
<brand-form <brand-form
:is-show-delete="form.trademarkList.length > 1"
v-for="(item, index) in form.trademarkList" v-for="(item, index) in form.trademarkList"
v-model="form.trademarkList[index]" v-model="form.trademarkList[index]"
:index="index" :index="index"
...@@ -119,9 +120,9 @@ ...@@ -119,9 +120,9 @@
@delete="form.trademarkList.splice(index, 1)"></brand-form> @delete="form.trademarkList.splice(index, 1)"></brand-form>
<el-button type="primary" @click="form.trademarkList.push({ <el-button type="primary" @click="form.trademarkList.push({
brandName: '', brandName: form.titleZh,
productBrandId: form.id, productBrandId: form.id,
trademarkCategoryRelList: [] trademarkCategoryRelList: [{productCategoryId:0, productId:0}]
})">添加商标</el-button> })">添加商标</el-button>
<div slot="footer" style="text-align: center"> <div slot="footer" style="text-align: center">
...@@ -287,21 +288,26 @@ export default { ...@@ -287,21 +288,26 @@ export default {
if (!valid) { if (!valid) {
return; return;
} }
// 修改的提交 if (this.form.trademarkList?.length > 0){
if (this.form.id != null) { // 修改的提交
updateProductBrank(this.form).then(response => { if (this.form.id != null) {
this.$modal.msgSuccess("修改成功"); updateProductBrank(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
// 添加的提交
createProductBrank(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
return; } else {
this.$modal.alert('请至少添加一个商标')
} }
// 添加的提交
createProductBrank(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}); });
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment