feat: 多模块新增功能与优化体验
1. 隐藏客户录入页的客户编码字段 2. 为WmsMaterialWarningBo添加日期格式化注解 3. 合同产品选择时自动匹配默认材质 4. 物料告警页新增今日筛选、行样式区分与偏差率展示优化 5. 合同页新增快速新增客户功能
This commit is contained in:
@@ -147,6 +147,14 @@ export default {
|
||||
products: [],
|
||||
remark: '',
|
||||
productName: '',
|
||||
previousProductName: '',
|
||||
productMaterialMap: {
|
||||
'冷硬钢卷': 'SPCC',
|
||||
'镀锌钢卷': 'DX51D+Z',
|
||||
'冷轧钢卷': 'DC01',
|
||||
'冷轧卷(花纹)': 'DC01-H',
|
||||
'镀铬钢卷': 'SPCC',
|
||||
},
|
||||
productOptions: [
|
||||
{ label: '冷硬钢卷', value: '冷硬钢卷' },
|
||||
{ label: '镀锌钢卷', value: '镀锌钢卷' },
|
||||
@@ -231,7 +239,18 @@ export default {
|
||||
this.parseContent(newValue);
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
productName(newName) {
|
||||
const material = this.productMaterialMap[newName];
|
||||
if (material) {
|
||||
this.products.forEach(item => {
|
||||
if (item.material === undefined || item.material === '' || item.material === this.productMaterialMap[this.previousProductName]) {
|
||||
item.material = material;
|
||||
}
|
||||
});
|
||||
}
|
||||
this.previousProductName = newName;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 初始化产品的默认字段
|
||||
|
||||
@@ -129,8 +129,11 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="需方" prop="customer">
|
||||
<CustomerSelect v-model="form.customer" bindField="companyName" @change="handleCustomerChange"
|
||||
:style="{ width: '100%' }" />
|
||||
<!-- <el-input v-model="form.customer" placeholder="请输入需方" /> -->
|
||||
:style="{ width: 'calc(100% - 50px)' }" />
|
||||
<el-button icon="el-icon-plus" size="mini"
|
||||
style="margin-left: 4px; vertical-align: middle;"
|
||||
@click="handleQuickAddCustomer">
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="需方地址" prop="customerAddress">
|
||||
<el-input v-model="form.customerAddress" placeholder="请输入需方地址" />
|
||||
@@ -175,9 +178,50 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog>
|
||||
<div>
|
||||
<!-- 左右布局,左侧是合同标题。右侧是合同模板内容,可以新增,删除,修改合同模板 -->
|
||||
<!-- 快速新增客户对话框 -->
|
||||
<el-dialog title="录入客户" :visible.sync="customerOpen" width="800px" append-to-body>
|
||||
<el-form ref="customerForm" :model="customerForm" :rules="customerRules" label-width="80px">
|
||||
<!-- <el-form-item label="客户编码" prop="customerCode">
|
||||
<el-input v-model="customerForm.customerCode" placeholder="请输入客户编码" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="公司名称" prop="companyName">
|
||||
<el-input v-model="customerForm.companyName" placeholder="请输入公司名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人" prop="contactPerson">
|
||||
<el-input v-model="customerForm.contactPerson" placeholder="请输入联系人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系方式" prop="contactWay">
|
||||
<el-input v-model="customerForm.contactWay" placeholder="请输入联系方式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="税号" prop="taxNumber">
|
||||
<el-input v-model="customerForm.taxNumber" placeholder="请输入税号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属行业" prop="industry">
|
||||
<el-select v-model="customerForm.industry" placeholder="请选择所属行业" clearable>
|
||||
<el-option v-for="item in dict.type.customer_industry" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户等级" prop="customerLevel">
|
||||
<el-select v-model="customerForm.customerLevel" placeholder="请选择客户等级" clearable>
|
||||
<el-option v-for="item in dict.type.customer_level" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="客户地址" prop="address">
|
||||
<el-input v-model="customerForm.address" placeholder="请输入客户地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="customerForm.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="银行信息" prop="bankInfo">
|
||||
<JSONTableInput v-model="customerForm.bankInfo"
|
||||
:columns="[{ prop: 'bankName', label: '银行名称' }, { prop: 'bankAccount', label: '银行账号' }]" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="customerButtonLoading" type="primary" @click="submitCustomerForm">确 定</el-button>
|
||||
<el-button @click="customerCancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
@@ -185,6 +229,7 @@
|
||||
|
||||
<script>
|
||||
import { delOrder, listOrderPackaging, updateOrder, getOrder, addOrder } from "@/api/crm/order";
|
||||
import { addCustomer } from "@/api/crm/customer";
|
||||
import { getDicts, addData, updateData } from "@/api/system/dict/data";
|
||||
import { listDeliveryWaybill } from "@/api/wms/deliveryWaybill";
|
||||
import dayjs from "dayjs";
|
||||
@@ -195,6 +240,7 @@ import ContractExportDialog from "./components/ContractExportDialog.vue";
|
||||
import ProductContent from "./components/ProductContent.vue";
|
||||
import ContractTemplateManager from "./components/ContractTemplateManager.vue";
|
||||
import CustomerSelect from "@/components/KLPService/CustomerSelect/index.vue";
|
||||
import JSONTableInput from "@/views/crm/components/JSONTableInput.vue";
|
||||
|
||||
export default {
|
||||
name: "Contract",
|
||||
@@ -206,9 +252,10 @@ export default {
|
||||
ProductContent,
|
||||
ContractTemplateManager,
|
||||
CustomerSelect,
|
||||
JSONTableInput,
|
||||
},
|
||||
// 'crm_contract_template'
|
||||
dicts: ['wip_pack_saleman'],
|
||||
dicts: ['wip_pack_saleman', 'customer_industry', 'customer_level'],
|
||||
data() {
|
||||
return {
|
||||
financeList: [],
|
||||
@@ -243,6 +290,19 @@ export default {
|
||||
// 导出预览
|
||||
exportDialogVisible: false,
|
||||
exportRow: null,
|
||||
// 快速新增客户
|
||||
customerOpen: false,
|
||||
customerButtonLoading: false,
|
||||
customerForm: {},
|
||||
customerRules: {
|
||||
customerCode: [{ required: true, message: '请输入客户编码', trigger: 'blur' }],
|
||||
companyName: [{ required: true, message: '请输入公司名称', trigger: 'blur' }],
|
||||
// contactPerson: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
|
||||
contactWay: [{ required: true, message: '请输入联系方式', trigger: 'blur' }],
|
||||
// industry: [{ required: true, message: '请选择所属行业', trigger: 'change' }],
|
||||
// customerLevel: [{ required: true, message: '请选择客户等级', trigger: 'change' }],
|
||||
address: [{ required: true, message: '请输入客户地址', trigger: 'blur' }],
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
contractId: [
|
||||
@@ -617,6 +677,43 @@ export default {
|
||||
handleExportContract(row) {
|
||||
// 合同导出
|
||||
},
|
||||
/** 快速新增客户 */
|
||||
handleQuickAddCustomer() {
|
||||
const bankInfo = [];
|
||||
if (this.form.customerBank || this.form.customerAccount) {
|
||||
bankInfo.push({
|
||||
bankName: this.form.customerBank || '',
|
||||
bankAccount: this.form.customerAccount || ''
|
||||
});
|
||||
}
|
||||
this.customerForm = {
|
||||
companyName: this.form.customer || '',
|
||||
address: this.form.customerAddress || '',
|
||||
contactWay: this.form.customerPhone || '',
|
||||
taxNumber: this.form.customerTaxNo || '',
|
||||
bankInfo: bankInfo.length > 0 ? JSON.stringify(bankInfo) : '',
|
||||
};
|
||||
this.customerOpen = true;
|
||||
},
|
||||
/** 提交新增客户 */
|
||||
submitCustomerForm() {
|
||||
this.$refs.customerForm.validate(valid => {
|
||||
if (valid) {
|
||||
this.customerButtonLoading = true;
|
||||
addCustomer(this.customerForm).then(response => {
|
||||
this.$modal.msgSuccess("新增客户成功");
|
||||
this.customerOpen = false;
|
||||
}).finally(() => {
|
||||
this.customerButtonLoading = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 取消新增客户 */
|
||||
customerCancel() {
|
||||
this.customerOpen = false;
|
||||
this.customerForm = {};
|
||||
},
|
||||
/** 开始拖拽调整 */
|
||||
startResize(e) {
|
||||
e.preventDefault();
|
||||
|
||||
@@ -135,9 +135,9 @@
|
||||
<!-- 添加客户对话框 -->
|
||||
<el-dialog title="录入客户" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="客户编码" prop="customerCode">
|
||||
<!-- <el-form-item label="客户编码" prop="customerCode">
|
||||
<el-input v-model="form.customerCode" placeholder="请输入客户编码" />
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="公司名称" prop="companyName">
|
||||
<el-input v-model="form.companyName" placeholder="请输入公司名称" />
|
||||
</el-form-item>
|
||||
|
||||
Reference in New Issue
Block a user