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>
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="告警类型" prop="warningType">
|
||||
<el-radio-group v-model="queryParams.warningType" @change="handleQuery">
|
||||
<el-radio-button label="">全部</el-radio-button>
|
||||
<el-radio-button label="LENGTH">长度告警</el-radio-button>
|
||||
<el-radio-button label="THICKNESS">厚度告警</el-radio-button>
|
||||
</el-radio-group>
|
||||
@@ -32,6 +31,9 @@
|
||||
<el-form-item label="处理人" prop="handleBy">
|
||||
<el-input v-model="queryParams.handleBy" placeholder="请输入处理人" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="只看今天" prop="onlyToday">
|
||||
<el-switch v-model="queryParams.onlyToday" @change="handleQuery" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
@@ -40,7 +42,7 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="materialWarningList" @selection-change="handleSelectionChange">
|
||||
<el-table v-loading="loading" :data="materialWarningList" @selection-change="handleSelectionChange" :row-class-name="getRowClassName">
|
||||
<!-- <el-table-column label="钢卷ID" align="center" prop="coilId" /> -->
|
||||
<el-table-column label="告警类型" align="center" prop="warningType">
|
||||
<template slot-scope="scope">
|
||||
@@ -64,9 +66,14 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="理论值" align="center" prop="theoreticalVal" />
|
||||
<el-table-column label="实测值" align="center" prop="actualVal" />
|
||||
<el-table-column label="允许偏差" align="center" prop="allowDeviation" />
|
||||
<el-table-column label="允许偏差" align="center" prop="allowDeviation">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.warningType === 'LENGTH'">{{ parseFloat((scope.row.allowDeviation * 100).toFixed(2)) }}%</span>
|
||||
<span v-else>{{ scope.row.allowDeviation }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="实际偏差值" align="center" prop="deviationValue" />
|
||||
<el-table-column label="偏差率(%)" align="center" prop="deviationRate" />
|
||||
|
||||
<el-table-column label="告警说明" align="center" prop="warningMsg" show-overflow-tooltip />
|
||||
<el-table-column label="告警状态" align="center" prop="warningStatus">
|
||||
<template slot-scope="scope">
|
||||
@@ -178,7 +185,7 @@ export default {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
coilId: undefined,
|
||||
warningType: '',
|
||||
warningType: 'LENGTH',
|
||||
theoreticalVal: undefined,
|
||||
actualVal: undefined,
|
||||
allowDeviation: undefined,
|
||||
@@ -190,6 +197,9 @@ export default {
|
||||
handleBy: undefined,
|
||||
handleTime: undefined,
|
||||
handleRemark: undefined,
|
||||
onlyToday: true,
|
||||
createStartTime: undefined,
|
||||
createEndTime: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
@@ -260,6 +270,17 @@ export default {
|
||||
/** 查询钢卷告警列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
if (this.queryParams.onlyToday) {
|
||||
const today = new Date();
|
||||
const y = today.getFullYear();
|
||||
const m = String(today.getMonth() + 1).padStart(2, '0');
|
||||
const d = String(today.getDate()).padStart(2, '0');
|
||||
this.queryParams.createStartTime = `${y}-${m}-${d} 00:00:00`;
|
||||
this.queryParams.createEndTime = `${y}-${m}-${d} 23:59:59`;
|
||||
} else {
|
||||
this.queryParams.createStartTime = undefined;
|
||||
this.queryParams.createEndTime = undefined;
|
||||
}
|
||||
listMaterialWarning(this.queryParams).then(response => {
|
||||
this.materialWarningList = response.rows;
|
||||
this.total = response.total;
|
||||
@@ -278,6 +299,12 @@ export default {
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
/** 行样式区分长度告警和厚度告警 */
|
||||
getRowClassName({ row }) {
|
||||
if (row.warningType === 'LENGTH') return 'warning-row-length';
|
||||
if (row.warningType === 'THICKNESS') return 'warning-row-thickness';
|
||||
return '';
|
||||
},
|
||||
/** 判断是否是今天的 */
|
||||
isToday(date) {
|
||||
const today = new Date();
|
||||
@@ -417,3 +444,11 @@ export default {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.el-table .warning-row-length {
|
||||
background-color: #fdf6ec;
|
||||
}
|
||||
.el-table .warning-row-thickness {
|
||||
background-color: #ecf5ff;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -8,6 +8,7 @@ import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 钢卷通用维度告警(长度/厚度/宽度)业务对象 wms_material_warning
|
||||
@@ -108,12 +109,14 @@ public class WmsMaterialWarningBo extends BaseEntity {
|
||||
/**
|
||||
* 创建开始时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createStartTime;
|
||||
|
||||
/**
|
||||
* 创建结束时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createEndTime;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user