feat(inventory): 添加订单执行跟踪功能
- 新增库存管理路由模块- 实现订单执行列表页面 - 支持订单执行编辑功能 - 配置相应权限控制 - 优化订单详情组件结构 - 提取基础信息为独立组件 - 简化表单处理逻辑- 移除冗余字典数据请求dev_1.0.0
parent
0e764c997b
commit
bb35f25900
|
|
@ -0,0 +1,359 @@
|
||||||
|
<template>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="16">
|
||||||
|
<el-form-item label="项目名称" prop="projectName">
|
||||||
|
<el-input v-model="localOrderData.projectName" placeholder="选择项目后带入" readonly :disabled="isReadonly">
|
||||||
|
<el-button slot="append" icon="el-icon-search" @click="$emit('select-project')" :disabled="isReadonly"></el-button>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="版本号" prop="versionCode">
|
||||||
|
<el-input-number v-model="localOrderData.versionCode" :min="1" readonly :disabled="isReadonly" label="版本号" style="width:100%"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="项目编号" prop="projectCode">
|
||||||
|
<el-input v-model="localOrderData.projectCode" placeholder="选择项目后带入" readonly :disabled="isReadonly"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="16">
|
||||||
|
<el-form-item label="最终客户" prop="customerName">
|
||||||
|
<el-input v-model="localOrderData.customerName" placeholder="选择项目后带入" readonly :disabled="isReadonly"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="BG" prop="bgProperty">
|
||||||
|
<el-select v-model="localOrderData.bgProperty" placeholder="请选择BG" @change="handleBgChange" :disabled="isReadonly">
|
||||||
|
<el-option v-for="dict in bgOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="行业" prop="industryType">
|
||||||
|
<el-select v-model="localOrderData.industryType" placeholder="请先选择BG" :disabled="isReadonly">
|
||||||
|
<el-option v-for="dict in industryOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="代表处" prop="agentName">
|
||||||
|
<el-input v-model="localOrderData.agentName" placeholder="选择项目后带入" readonly :disabled="isReadonly"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="进货商接口人" prop="businessPerson">
|
||||||
|
<el-input v-model="localOrderData.businessPerson" placeholder="请输入进货商接口人" :disabled="isReadonly"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="Email" prop="businessEmail">
|
||||||
|
<el-input v-model="localOrderData.businessEmail" placeholder="请输入Email" :disabled="isReadonly"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="联系方式" prop="businessPhone">
|
||||||
|
<el-input v-model="localOrderData.businessPhone" placeholder="请输入联系方式" :disabled="isReadonly"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="合同编号" prop="orderCode">
|
||||||
|
<el-input v-model="localOrderData.orderCode" placeholder="自动生成" readonly :disabled="isReadonly"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="16">
|
||||||
|
<el-form-item label="执行单截止时间" prop="orderEndTime">
|
||||||
|
<el-date-picker v-model="localOrderData.orderEndTime" type="date" value-format="yyyy-MM-dd" placeholder="审批完成后自动计算" disabled></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="币种" prop="currencyType">
|
||||||
|
<el-select v-model="localOrderData.currencyType" placeholder="请选择币种" :disabled="isReadonly">
|
||||||
|
<el-option v-for="dict in currencyOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col
|
||||||
|
v-if="(localOrderData.processTemplate=='1' ||(localOrderData.processTemplate!='1' &&( localOrderData.orderStatus=='1'||localOrderData.orderStatus=='2')))"
|
||||||
|
:span="8">
|
||||||
|
<el-form-item label="总代进货金额" prop="actualPurchaseAmount">
|
||||||
|
<el-input v-model="localOrderData.actualPurchaseAmount" readonly :disabled="isReadonly"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="(localOrderData.processTemplate=='1' ||(localOrderData.processTemplate!='1' &&( localOrderData.orderStatus=='1'||localOrderData.orderStatus=='2')))?8:16">
|
||||||
|
<el-form-item label="总代出货金额" prop="shipmentAmount">
|
||||||
|
<el-input v-model="localOrderData.shipmentAmount" placeholder="请输入金额" :disabled="isReadonly"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="要求到货时间" prop="deliveryTime">
|
||||||
|
<el-date-picker clearable v-model="localOrderData.deliveryTime" type="date" value-format="yyyy-MM-dd"
|
||||||
|
placeholder="选择要求到货时间" :disabled="isReadonly">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="16">
|
||||||
|
<el-form-item label="公司直发" prop="companyDelivery">
|
||||||
|
<el-select v-model="localOrderData.companyDelivery" placeholder="请选择" :disabled="isReadonly">
|
||||||
|
<el-option v-for="dict in companyDeliveryOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="下单通路" prop="orderChannel">
|
||||||
|
<el-select v-model="localOrderData.orderChannel" placeholder="请选择" @change="handleChannelChange" :disabled="isReadonly">
|
||||||
|
<el-option label="总代" value="1"></el-option>
|
||||||
|
<el-option label="直签" value="2"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" v-if="localOrderData.orderChannel == '1'">
|
||||||
|
<el-form-item label="总代" prop="zd">
|
||||||
|
<el-input value="广州佳都技术有限公司" readonly :disabled="isReadonly"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="localOrderData.orderChannel == '2' ? 16 : 8">
|
||||||
|
<el-form-item label="供货商" prop="supplier">
|
||||||
|
<el-input v-model="localOrderData.supplier" :disabled="isReadonly"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="汇智责任人" prop="dutyName">
|
||||||
|
<el-input v-model="localOrderData.dutyName" placeholder="请选择责任人" :disabled="isReadonly" @click.native="!isReadonly && $emit('select-user')">
|
||||||
|
<el-button slot="append" icon="el-icon-search" @click.native="!isReadonly && $emit('select-user')" :disabled="isReadonly"></el-button>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="Email" prop="dutyEmail">
|
||||||
|
<el-input v-model="localOrderData.dutyEmail" placeholder="请输入Email" :disabled="isReadonly"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="联系方式" prop="dutyPhone">
|
||||||
|
<el-input v-model="localOrderData.dutyPhone" placeholder="请输入联系方式" :disabled="isReadonly"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="16">
|
||||||
|
<el-form-item label="进货商" prop="partnerName">
|
||||||
|
<el-input v-model="localOrderData.partnerName" placeholder="请选择进货商" :disabled="isReadonly" @click.native="!isReadonly && $emit('select-partner')">
|
||||||
|
<el-button slot="append" icon="el-icon-search" @click.native="!isReadonly && $emit('select-partner')" :disabled="isReadonly"></el-button>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="进货商类型" prop="level">
|
||||||
|
<el-select v-model="localOrderData.level" placeholder="选择后带入" disabled>
|
||||||
|
<el-option v-for="dict in partnerLevelOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="进货商联系人" prop="partnerUserName">
|
||||||
|
<el-input v-model="localOrderData.partnerUserName" placeholder="请输入进货商联系人" :disabled="isReadonly"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="Email" prop="partnerEmail">
|
||||||
|
<el-input v-model="localOrderData.partnerEmail" placeholder="请输入Email" :disabled="isReadonly"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="联系方式" prop="partnerPhone">
|
||||||
|
<el-input v-model="localOrderData.partnerPhone" placeholder="请输入联系方式" :disabled="isReadonly"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="收货地址" prop="notifierAddress">
|
||||||
|
<el-input v-model="localOrderData.notifierAddress" placeholder="请输入收货地址" :disabled="isReadonly"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="收货人" prop="notifier">
|
||||||
|
<el-input v-model="localOrderData.notifier" placeholder="请输入收货人" :disabled="isReadonly"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="Email" prop="notifierEmail">
|
||||||
|
<el-input v-model="localOrderData.notifierEmail" placeholder="请输入Email" :disabled="isReadonly"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="联系方式" prop="notifierPhone">
|
||||||
|
<el-input v-model="localOrderData.notifierPhone" placeholder="请输入联系方式" :disabled="isReadonly"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="付款方式" prop="paymentMethod">
|
||||||
|
<el-select v-model="localOrderData.paymentMethod" placeholder="请选择付款方式" @change="handlePaymentMethodChange" :disabled="isReadonly">
|
||||||
|
<el-option v-for="item in paymentMethodOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="付款比例" prop="paymentRatio">
|
||||||
|
<el-input-number v-model="localOrderData.paymentRatio" :min="0" :max="100" placeholder="请输入付款比例" @change="updatePaymentDescription" :disabled="isReadonly"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="付款条件" prop="paymentDescription">
|
||||||
|
<el-input v-model="localOrderData.paymentDescription" type="textarea" :rows="3" readonly :disabled="isReadonly"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="其他特别说明" prop="remark">
|
||||||
|
<el-input v-model="localOrderData.remark" placeholder="请输入其他特别说明" :disabled="isReadonly"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getDicts } from "@/api/system/dict/data";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "OrderInfo",
|
||||||
|
props: {
|
||||||
|
orderData: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
layout: {
|
||||||
|
type: String,
|
||||||
|
default: 'page', // 'drawer', 'dialog', 'page'
|
||||||
|
},
|
||||||
|
isReadonly: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
localOrderData: {},
|
||||||
|
bgOptions: [],
|
||||||
|
industryOptions: [],
|
||||||
|
currencyOptions: [],
|
||||||
|
companyDeliveryOptions: [],
|
||||||
|
partnerLevelOptions: [],
|
||||||
|
paymentMethodOptions: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
orderData: {
|
||||||
|
handler(newValue) {
|
||||||
|
this.localOrderData = newValue;
|
||||||
|
// 当 orderData 变化时,可能需要重新获取和设置一些依赖数据
|
||||||
|
if (newValue.bgProperty) {
|
||||||
|
this.handleBgChange(newValue.bgProperty, true);
|
||||||
|
}
|
||||||
|
if (newValue.orderChannel) {
|
||||||
|
this.handleChannelChange(newValue.orderChannel, true);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
immediate: true,
|
||||||
|
deep: true
|
||||||
|
},
|
||||||
|
localOrderData: {
|
||||||
|
handler(newValue) {
|
||||||
|
this.$emit('update:orderData', newValue);
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDicts("bg_type").then(response => { this.bgOptions = response.data; });
|
||||||
|
this.getDicts("currency_type").then(response => { this.currencyOptions = response.data; });
|
||||||
|
this.getDicts("company_delivery").then(response => { this.companyDeliveryOptions = response.data; });
|
||||||
|
this.getDicts("identify_level").then(response => { this.partnerLevelOptions = response.data; });
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getDicts,
|
||||||
|
handleBgChange(value, isInitialLoad = false) {
|
||||||
|
if (!isInitialLoad) {
|
||||||
|
this.localOrderData.industryType = null;
|
||||||
|
}
|
||||||
|
const dictType = value === 'YYS' ? 'bg_yys' : 'bg_hysy';
|
||||||
|
return this.getDicts(dictType).then(response => {
|
||||||
|
this.industryOptions = response.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleChannelChange(value, isInitialLoad = false) {
|
||||||
|
if (!isInitialLoad) {
|
||||||
|
this.localOrderData.supplier = value === '1' ? '广州佳都技术有限公司' : '紫光汇智信息技术有限公司';
|
||||||
|
this.localOrderData.paymentMethod = null;
|
||||||
|
this.localOrderData.paymentRatio = 0;
|
||||||
|
this.localOrderData.paymentDescription = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value === '1') { // 总代
|
||||||
|
this.paymentMethodOptions = [
|
||||||
|
{ label: '全款支付,无需预付款', value: '1-1' },
|
||||||
|
{ label: '全款支付,需单独备货生产,预付订单总货款百分比', value: '1-2' }
|
||||||
|
];
|
||||||
|
} else if (value === '2') { // 直签
|
||||||
|
this.paymentMethodOptions = [
|
||||||
|
{ label: '全款支付', value: '2-1' },
|
||||||
|
{ label: '全款支付,需单独备货生产,预付订单总货款百分比', value: '2-2' },
|
||||||
|
{ label: '商业汇票支付,预付订单总货款百分比', value: '2-3' }
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
this.paymentMethodOptions = [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handlePaymentMethodChange(value) {
|
||||||
|
const descriptionTemplates = {
|
||||||
|
'1-2': '总代预付{ratio}%订单金额作为备货押金后开始备货生产,备货完成供货商发起付款通知后,总代需1个月内支付尾款完成提货,否则备货押金不予退还。',
|
||||||
|
'2-2': '进货商预付{ratio}%订单金额作为备货押金后开始备货生产,备货完成供货商发起付款通知后,进货商需3个工作日内付全部剩余款项,即可享受订单约定的现金折扣。',
|
||||||
|
'2-3': '进货商预付{ratio}%订单金额作为备货押金后开始备货生产,备货完成供货商发起付款通知后,供货商需在1个月内提交剩余款项额度的商业汇票完成提货,否则备货押金不予退还。'
|
||||||
|
};
|
||||||
|
|
||||||
|
let description = '';
|
||||||
|
let paymentRatio = 0;
|
||||||
|
|
||||||
|
switch (value) {
|
||||||
|
case '1-1':
|
||||||
|
description = '备货完成供货商发起付款通知后,总代按照订单金额支付全款。';
|
||||||
|
paymentRatio = 100;
|
||||||
|
break;
|
||||||
|
case '1-2':
|
||||||
|
paymentRatio = 30;
|
||||||
|
description = descriptionTemplates['1-2'].replace('{ratio}', paymentRatio);
|
||||||
|
break;
|
||||||
|
case '2-1':
|
||||||
|
description = '备货完成供货商发起付款通知后,进货商需3个工作日内付订单全部款项,即可享受订单约定的现金折扣。';
|
||||||
|
paymentRatio = 100;
|
||||||
|
break;
|
||||||
|
case '2-2':
|
||||||
|
paymentRatio = 30;
|
||||||
|
description = descriptionTemplates['2-2'].replace('{ratio}', paymentRatio);
|
||||||
|
break;
|
||||||
|
case '2-3':
|
||||||
|
paymentRatio = 30;
|
||||||
|
description = descriptionTemplates['2-3'].replace('{ratio}', paymentRatio);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.localOrderData.paymentDescription = description;
|
||||||
|
this.localOrderData.paymentRatio = paymentRatio;
|
||||||
|
},
|
||||||
|
updatePaymentDescription() {
|
||||||
|
const paymentMethod = this.localOrderData.paymentMethod;
|
||||||
|
const ratio = this.localOrderData.paymentRatio;
|
||||||
|
const descriptionTemplates = {
|
||||||
|
'1-2': '总代预付{ratio}%订单金额作为备货押金后开始备货生产,备货完成供货商发起付款通知后,总代需1个月内支付尾款完成提货,否则备货押金不予退还。',
|
||||||
|
'2-2': '进货商预付{ratio}%订单金额作为备货押金后开始备货生产,备货完成供货商发起付款通知后,进货商需3个工作日内付全部剩余款项,即可享受订单约定的现金折扣。',
|
||||||
|
'2-3': '进货商预付{ratio}%订单金额作为备货押金后开始备货生产,备货完成供货商发起付款通知后,供货商需在1个月内提交剩余款项额度的商业汇票完成提货,否则备货押金不予退还。'
|
||||||
|
};
|
||||||
|
if (descriptionTemplates[paymentMethod]) {
|
||||||
|
this.localOrderData.paymentDescription = descriptionTemplates[paymentMethod].replace('{ratio}', ratio);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.el-select, .el-date-picker, .el-input-number {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -105,6 +105,39 @@ export const constantRoutes = [
|
||||||
|
|
||||||
// 动态路由,基于用户权限动态去加载
|
// 动态路由,基于用户权限动态去加载
|
||||||
export const dynamicRoutes = [
|
export const dynamicRoutes = [
|
||||||
|
{
|
||||||
|
path: '/inventory',
|
||||||
|
component: Layout,
|
||||||
|
redirect: 'noRedirect',
|
||||||
|
name: 'Inventory',
|
||||||
|
meta: {
|
||||||
|
title: '库存管理',
|
||||||
|
icon: 'inventory'
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'execution',
|
||||||
|
component: () => import('@/views/inventory/execution/index'),
|
||||||
|
name: 'Execution',
|
||||||
|
meta: { title: '订单执行跟踪', icon: 'execution' },
|
||||||
|
permissions: ['inventory:execution:list']
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/inventory/execution',
|
||||||
|
component: Layout,
|
||||||
|
hidden: true,
|
||||||
|
permissions: ['inventory:execution:edit'],
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'edit/:id(\\d+)',
|
||||||
|
component: () => import('@/views/inventory/execution/edit'),
|
||||||
|
name: 'ExecutionEdit',
|
||||||
|
meta: { title: '订单执行编辑', activeMenu: '/inventory/execution' }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/system/user-auth',
|
path: '/system/user-auth',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
|
|
|
||||||
|
|
@ -6,214 +6,14 @@
|
||||||
<el-tabs v-model="activeTab">
|
<el-tabs v-model="activeTab">
|
||||||
<el-tab-pane label="基础信息" name="basic">
|
<el-tab-pane label="基础信息" name="basic">
|
||||||
<div style="max-height: 60vh; overflow-y: auto; padding: 15px;">
|
<div style="max-height: 60vh; overflow-y: auto; padding: 15px;">
|
||||||
<el-row>
|
<order-info
|
||||||
<el-col :span="16">
|
:order-data.sync="form"
|
||||||
<el-form-item label="项目名称" prop="projectName">
|
layout="dialog"
|
||||||
<el-input v-model="form.projectName" placeholder="选择项目后带入" @click.native="handleSelectProject" >
|
:is-readonly="isOrderApprovedOrInReview"
|
||||||
<el-button slot="append" icon="el-icon-search" @click="handleSelectProject"></el-button>
|
@select-project="handleSelectProject"
|
||||||
</el-input>
|
@select-user="openSelectPeople"
|
||||||
</el-form-item>
|
@select-partner="openSelectPartner"
|
||||||
</el-col>
|
/>
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="版本号" prop="versionCode">
|
|
||||||
<el-input v-model="form.versionCode" :min="1" readonly label="版本号"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="项目编号" prop="projectCode">
|
|
||||||
<el-input v-model="form.projectCode" placeholder="选择项目后带入" readonly/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="16">
|
|
||||||
<el-form-item label="最终客户" prop="customerName">
|
|
||||||
<el-input v-model="form.customerName" placeholder="选择项目后带入" readonly/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="BG" prop="bgProperty">
|
|
||||||
<el-select v-model="form.bgProperty" placeholder="请选择BG" @change="handleBgChange">
|
|
||||||
<el-option v-for="dict in bgOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="行业" prop="industryType">
|
|
||||||
<el-select v-model="form.industryType" placeholder="请先选择BG">
|
|
||||||
<el-option v-for="dict in industryOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="代表处" prop="agentName">
|
|
||||||
<el-input v-model="form.agentName" placeholder="选择项目后带入" readonly/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="进货商接口人" prop="businessPerson">
|
|
||||||
<el-input v-model="form.businessPerson" placeholder="请输入进货商接口人"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="Email" prop="businessEmail">
|
|
||||||
<el-input v-model="form.businessEmail" placeholder="请输入Email"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="联系方式" prop="businessPhone">
|
|
||||||
<el-input v-model="form.businessPhone" placeholder="请输入联系方式"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="合同编号" prop="orderCode">
|
|
||||||
<el-input v-model="form.orderCode" placeholder="自动生成" readonly/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="16">
|
|
||||||
<el-form-item label="执行单截止时间" prop="orderEndTime">
|
|
||||||
<el-date-picker v-model="form.orderEndTime" type="date" value-format="yyyy-MM-dd" placeholder="审批完成后自动计算" disabled></el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="币种" prop="currencyType">
|
|
||||||
<el-select v-model="form.currencyType" placeholder="请选择币种">
|
|
||||||
<el-option v-for="dict in currencyOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col
|
|
||||||
v-if="(form.processTemplate=='1' ||(form.processTemplate!='1' &&( form.orderStatus=='1'||form.orderStatus=='2')))"
|
|
||||||
:span="8">
|
|
||||||
<el-form-item label="总代进货金额" prop="actualPurchaseAmount">
|
|
||||||
<el-input v-model="form.actualPurchaseAmount" readonly/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="(form.processTemplate=='1' ||(form.processTemplate!='1' &&( form.orderStatus=='1'||form.orderStatus=='2')))?8:16"
|
|
||||||
>
|
|
||||||
<el-form-item label="总代出货金额" prop="shipmentAmount">
|
|
||||||
<el-input v-model="form.shipmentAmount" placeholder="自动计算" readonly/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="要求到货时间" prop="deliveryTime">
|
|
||||||
<el-date-picker clearable v-model="form.deliveryTime" type="date" value-format="yyyy-MM-dd"
|
|
||||||
placeholder="选择要求到货时间">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="16">
|
|
||||||
<el-form-item label="公司直发" prop="companyDelivery">
|
|
||||||
<el-select v-model="form.companyDelivery" placeholder="请选择">
|
|
||||||
<el-option v-for="dict in companyDeliveryOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="下单通路" prop="orderChannel">
|
|
||||||
<el-select v-model="form.orderChannel" placeholder="请选择" @change="handleChannelChange">
|
|
||||||
<el-option label="总代" value="1"></el-option>
|
|
||||||
<el-option label="直签" value="2"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8" v-if="form.orderChannel == '1'">
|
|
||||||
<el-form-item label="总代" prop="zd">
|
|
||||||
<el-input value="广州佳都技术有限公司" readonly/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="form.orderChannel == '2' ? 16 : 8">
|
|
||||||
<el-form-item label="供货商" prop="supplier">
|
|
||||||
<el-input v-model="form.supplier"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="汇智责任人" prop="dutyName">
|
|
||||||
<el-input v-model="form.dutyName" placeholder="请选择责任人" @click.native=" openSelectPeople()">
|
|
||||||
<el-button slot="append" icon="el-icon-search" @click.native=" openSelectPeople()"></el-button>
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="Email" prop="dutyEmail">
|
|
||||||
<el-input v-model="form.dutyEmail" placeholder="请输入Email"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="联系方式" prop="dutyPhone">
|
|
||||||
<el-input v-model="form.dutyPhone" placeholder="请输入联系方式"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="16">
|
|
||||||
<el-form-item label="进货商" prop="partnerName">
|
|
||||||
<el-input v-model="form.partnerName" placeholder="请选择进货商" @click.native="openSelectPartner">
|
|
||||||
<el-button slot="append" icon="el-icon-search" @click.native="openSelectPartner"></el-button>
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="进货商类型" prop="level">
|
|
||||||
<el-select v-model="form.level" placeholder="选择后带入" disabled>
|
|
||||||
<el-option v-for="dict in partnerLevelOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="进货商联系人" prop="partnerUserName">
|
|
||||||
<el-input v-model="form.partnerUserName" placeholder="请输入进货商联系人"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="Email" prop="partnerEmail">
|
|
||||||
<el-input v-model="form.partnerEmail" placeholder="请输入Email"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="联系方式" prop="partnerPhone">
|
|
||||||
<el-input v-model="form.partnerPhone" placeholder="请输入联系方式"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="收货地址" prop="notifierAddress">
|
|
||||||
<el-input v-model="form.notifierAddress" placeholder="请输入收货地址"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="收货人" prop="notifier">
|
|
||||||
<el-input v-model="form.notifier" placeholder="请输入收货人"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="Email" prop="notifierEmail">
|
|
||||||
<el-input v-model="form.notifierEmail" placeholder="请输入Email"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="联系方式" prop="notifierPhone">
|
|
||||||
<el-input v-model="form.notifierPhone" placeholder="请输入联系方式"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="付款方式" prop="paymentMethod">
|
|
||||||
<el-select v-model="form.paymentMethod" placeholder="请选择付款方式" @change="handlePaymentMethodChange">
|
|
||||||
<el-option v-for="item in paymentMethodOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="付款比例" prop="paymentRatio">
|
|
||||||
<el-input-number v-model="form.paymentRatio" :min="0" :max="100" placeholder="请输入付款比例" @change="updatePaymentDescription"></el-input-number>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="付款条件" prop="paymentDescription">
|
|
||||||
<el-input v-model="form.paymentDescription" type="textarea" :rows="3" readonly/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="其他特别说明" prop="remark">
|
|
||||||
<el-input v-model="form.remark" placeholder="请输入其他特别说明"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="配置信息" name="config">
|
<el-tab-pane label="配置信息" name="config">
|
||||||
|
|
@ -248,12 +48,6 @@
|
||||||
<div v-else>暂无流转过程数据。</div>
|
<div v-else>暂无流转过程数据。</div>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<!-- <el-tab-pane label="备货信息" name="stock">-->
|
|
||||||
<!-- <!– 备货信息 –>-->
|
|
||||||
<!-- </el-tab-pane>-->
|
|
||||||
<!-- <el-tab-pane label="物流信息" name="delivery">-->
|
|
||||||
<!-- <!– 物流信息 –>-->
|
|
||||||
<!-- </el-tab-pane>-->
|
|
||||||
<el-tab-pane label="合同信息" name="contract">
|
<el-tab-pane label="合同信息" name="contract">
|
||||||
<div style="max-height: 60vh; overflow-y: auto; padding: 15px;">
|
<div style="max-height: 60vh; overflow-y: auto; padding: 15px;">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
@ -347,7 +141,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
|
|
@ -355,14 +148,10 @@
|
||||||
<el-button type="success" @click="submitForApproval" v-if="!isOrderApprovedOrInReview">提交审批</el-button>
|
<el-button type="success" @click="submitForApproval" v-if="!isOrderApprovedOrInReview">提交审批</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" v-model="form.processType" />
|
|
||||||
<input type="hidden" v-model="form.processTemplate" />
|
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<select-agent :visible.sync="selectAgentVisible" @agent-selected="handleAgentSelected"/>
|
|
||||||
<select-customer :visible.sync="selectCustomerVisible" @customer-selected="handleCustomerSelected"/>
|
|
||||||
<select-partner :visible.sync="selectPartnerVisible" @partner-selected="handlePartnerSelected"/>
|
|
||||||
<select-user :visible.sync="selectUserVisible" @user-selected="handleUserSelected"/>
|
|
||||||
<select-project :visible.sync="selectProjectVisible" @project-selected="handleProjectSelected"/>
|
<select-project :visible.sync="selectProjectVisible" @project-selected="handleProjectSelected"/>
|
||||||
|
<select-user :visible.sync="selectUserVisible" @user-selected="handleUserSelected"/>
|
||||||
|
<select-partner :visible.sync="selectPartnerVisible" @partner-selected="handlePartnerSelected"/>
|
||||||
<select-commit-type :visible.sync="selectCommitTypeVisible" :order-channel="form.orderChannel" @commit-type-selected="handleCommitTypeSelected"/>
|
<select-commit-type :visible.sync="selectCommitTypeVisible" :order-channel="form.orderChannel" @commit-type-selected="handleCommitTypeSelected"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -375,27 +164,23 @@
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getOrder, addOrder, updateOrder, delContractFile, uploadContractFile } from "@/api/project/order";
|
import { getOrder, addOrder, updateOrder, delContractFile, uploadContractFile, getProject } from "@/api/project/order";
|
||||||
import { getProject } from "@/api/project/info";
|
|
||||||
import { getDicts } from "@/api/system/dict/data";
|
|
||||||
import ProductConfig from '@/views/project/info/ProductConfig.vue';
|
import ProductConfig from '@/views/project/info/ProductConfig.vue';
|
||||||
import SelectAgent from "@/views/system/agent/selectAgent.vue";
|
|
||||||
import SelectCustomer from "@/views/system/customer/selectCustomer.vue";
|
|
||||||
import SelectPartner from "@/views/system/partner/selectPartner.vue";
|
|
||||||
import SelectUser from "@/views/system/user/selectUser.vue";
|
|
||||||
import SelectProject from "@/views/project/info/SelectProject.vue";
|
|
||||||
import SelectCommitType from "./SelectCommitType.vue";
|
import SelectCommitType from "./SelectCommitType.vue";
|
||||||
|
import OrderInfo from '@/components/order/OrderInfo.vue';
|
||||||
|
import SelectProject from "@/views/project/info/SelectProject";
|
||||||
|
import SelectUser from "@/views/system/user/selectUser";
|
||||||
|
import SelectPartner from "@/views/system/partner/selectPartner";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "OrderDetail",
|
name: "OrderDetail",
|
||||||
components: {
|
components: {
|
||||||
SelectAgent,
|
|
||||||
SelectCustomer,
|
|
||||||
SelectPartner,
|
|
||||||
SelectUser,
|
|
||||||
ProductConfig,
|
ProductConfig,
|
||||||
SelectProject,
|
|
||||||
SelectCommitType,
|
SelectCommitType,
|
||||||
|
OrderInfo,
|
||||||
|
SelectProject,
|
||||||
|
SelectUser,
|
||||||
|
SelectPartner,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
visible: {
|
visible: {
|
||||||
|
|
@ -428,25 +213,16 @@ export default {
|
||||||
file_log_arr: [ "(请上传商务折扣审批邮件信息).pdf/.jpg/.png","(请上传合同信息).pdf/.jpg/.png", "(补充附件).zip/.rar/.jpg/.png","(请上传已盖章合同信息).pdf/.jpg/.png"],
|
file_log_arr: [ "(请上传商务折扣审批邮件信息).pdf/.jpg/.png","(请上传合同信息).pdf/.jpg/.png", "(补充附件).zip/.rar/.jpg/.png","(请上传已盖章合同信息).pdf/.jpg/.png"],
|
||||||
// 内部可见性控制
|
// 内部可见性控制
|
||||||
internalVisible: this.visible,
|
internalVisible: this.visible,
|
||||||
selectAgentVisible: false,
|
|
||||||
selectCustomerVisible: false,
|
|
||||||
selectPartnerVisible: false,
|
|
||||||
selectUserVisible: false,
|
|
||||||
selectProjectVisible: false,
|
|
||||||
selectCommitTypeVisible: false,
|
|
||||||
isProjectSelected: false,
|
isProjectSelected: false,
|
||||||
canUpdate: false, // 新增 canUpdate 属性
|
canUpdate: false,
|
||||||
uploadFinalFile: false, // 新增 uploadFinalFile 属性
|
uploadFinalFile: false,
|
||||||
updateFile: false, // 新增 updateFile 属性
|
updateFile: false,
|
||||||
|
selectProjectVisible: false,
|
||||||
|
selectUserVisible: false,
|
||||||
|
selectPartnerVisible: false,
|
||||||
|
selectCommitTypeVisible: false,
|
||||||
// 当前激活的Tab
|
// 当前激活的Tab
|
||||||
activeTab: 'basic',
|
activeTab: 'basic',
|
||||||
// 字典数据
|
|
||||||
bgOptions: [],
|
|
||||||
industryOptions: [],
|
|
||||||
currencyOptions: [],
|
|
||||||
companyDeliveryOptions: [],
|
|
||||||
partnerLevelOptions: [],
|
|
||||||
paymentMethodOptions: [],
|
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
projectName: [{ required: true, message: "项目名称不能为空", trigger: "blur" }],
|
projectName: [{ required: true, message: "项目名称不能为空", trigger: "blur" }],
|
||||||
|
|
@ -482,21 +258,15 @@ export default {
|
||||||
return this.form.orderStatus === '1' || this.form.orderStatus === '2';
|
return this.form.orderStatus === '1' || this.form.orderStatus === '2';
|
||||||
},
|
},
|
||||||
uniqueVersions() {
|
uniqueVersions() {
|
||||||
if (!this.approveLogList || this.approveLogList.length === 0) {
|
if (!this.approveLogList || this.approveLogList.length === 0) return [];
|
||||||
return [];
|
|
||||||
}
|
|
||||||
const versions = [...new Set(this.approveLogList.map(log => log.extendField1))];
|
const versions = [...new Set(this.approveLogList.map(log => log.extendField1))];
|
||||||
return versions.sort((a, b) => b - a); // 降序排列版本号
|
return versions.sort((a, b) => b - a);
|
||||||
},
|
},
|
||||||
groupedApproveLogs() {
|
groupedApproveLogs() {
|
||||||
if (!this.approveLogList || this.approveLogList.length === 0) {
|
if (!this.approveLogList || this.approveLogList.length === 0) return {};
|
||||||
return {};
|
|
||||||
}
|
|
||||||
return this.approveLogList.reduce((acc, log) => {
|
return this.approveLogList.reduce((acc, log) => {
|
||||||
const version = log.extendField1;
|
const version = log.extendField1;
|
||||||
if (!acc[version]) {
|
if (!acc[version]) acc[version] = [];
|
||||||
acc[version] = [];
|
|
||||||
}
|
|
||||||
acc[version].push(log);
|
acc[version].push(log);
|
||||||
return acc;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
@ -513,42 +283,33 @@ export default {
|
||||||
if (version) versions.add(String(version));
|
if (version) versions.add(String(version));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 确保当前版本号始终存在
|
|
||||||
if (this.form.versionCode) {
|
if (this.form.versionCode) {
|
||||||
versions.add(String(this.form.versionCode));
|
versions.add(String(this.form.versionCode));
|
||||||
}
|
}
|
||||||
return Array.from(versions).sort((a, b) => Number(b) - Number(a)); // 降序排列版本号
|
return Array.from(versions).sort((a, b) => Number(b) - Number(a));
|
||||||
},
|
},
|
||||||
groupedContractFiles() {
|
groupedContractFiles() {
|
||||||
const grouped = {};
|
const grouped = {};
|
||||||
if (this.form.contractTableData) {
|
if (this.form.contractTableData) {
|
||||||
for (const version in this.form.contractTableData) {
|
for (const version in this.form.contractTableData) {
|
||||||
if (!grouped[version]) {
|
if (!grouped[version]) grouped[version] = { files: [], bakFile: null };
|
||||||
grouped[version] = { files: [], bakFile: null };
|
|
||||||
}
|
|
||||||
grouped[version].files = this.form.contractTableData[version];
|
grouped[version].files = this.form.contractTableData[version];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.orderBakFile) {
|
if (this.orderBakFile) {
|
||||||
for (const version in this.orderBakFile) {
|
for (const version in this.orderBakFile) {
|
||||||
if (!grouped[version]) {
|
if (!grouped[version]) grouped[version] = { files: [], bakFile: null };
|
||||||
grouped[version] = { files: [], bakFile: null };
|
|
||||||
}
|
|
||||||
grouped[version].bakFile = this.orderBakFile[version];
|
grouped[version].bakFile = this.orderBakFile[version];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return grouped;
|
return grouped;
|
||||||
},
|
},
|
||||||
currentContractFiles() {
|
currentContractFiles() {
|
||||||
if (!this.activeContractVersionTab || !this.groupedContractFiles[this.activeContractVersionTab]) {
|
if (!this.activeContractVersionTab || !this.groupedContractFiles[this.activeContractVersionTab]) return [];
|
||||||
return [];
|
|
||||||
}
|
|
||||||
return this.groupedContractFiles[this.activeContractVersionTab].files;
|
return this.groupedContractFiles[this.activeContractVersionTab].files;
|
||||||
},
|
},
|
||||||
currentContractBakFile() {
|
currentContractBakFile() {
|
||||||
if (!this.activeContractVersionTab || !this.groupedContractFiles[this.activeContractVersionTab]) {
|
if (!this.activeContractVersionTab || !this.groupedContractFiles[this.activeContractVersionTab]) return null;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return this.groupedContractFiles[this.activeContractVersionTab].bakFile;
|
return this.groupedContractFiles[this.activeContractVersionTab].bakFile;
|
||||||
},
|
},
|
||||||
totalConfigAmount() {
|
totalConfigAmount() {
|
||||||
|
|
@ -574,88 +335,34 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getDicts("bg_type").then(response => { this.bgOptions = response.data; });
|
|
||||||
this.getDicts("currency_type").then(response => { this.currencyOptions = response.data; });
|
|
||||||
this.getDicts("company_delivery").then(response => { this.companyDeliveryOptions = response.data; });
|
|
||||||
this.getDicts("identify_level").then(response => { this.partnerLevelOptions = response.data; });
|
|
||||||
|
|
||||||
// If projectId is passed and we are in add mode (orderId is null), call handleOpen immediately
|
|
||||||
if (this.projectId && this.orderId === null) {
|
if (this.projectId && this.orderId === null) {
|
||||||
this.handleOpen();
|
this.handleOpen();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleAgentSelected(agent) {
|
|
||||||
this.form.agentName = agent.agentName;
|
|
||||||
this.form.agentCode = agent.agentCode;
|
|
||||||
this.selectAgentVisible = false;
|
|
||||||
},
|
|
||||||
openSelectCustomer() {
|
|
||||||
this.selectCustomerVisible = true;
|
|
||||||
},
|
|
||||||
handleCustomerSelected(customer) {
|
|
||||||
this.form.customerName = customer.customerName;
|
|
||||||
this.form.customerCode = customer.customerCode;
|
|
||||||
this.form.customerUserName = customer.contactPerson;
|
|
||||||
this.form.customerPhone = customer.contactPhone;
|
|
||||||
this.selectCustomerVisible = false;
|
|
||||||
},
|
|
||||||
openSelectPartner() {
|
|
||||||
this.selectPartnerVisible = true;
|
|
||||||
},
|
|
||||||
handlePartnerSelected(partner) {
|
|
||||||
this.form.partnerName = partner.partnerName;
|
|
||||||
this.form.partnerCode = partner.partnerCode;
|
|
||||||
this.form.partnerUserName = partner.contactPerson;
|
|
||||||
this.form.level = partner.level;
|
|
||||||
this.form.partnerPhone = partner.contactPhone;
|
|
||||||
this.form.partnerEmail = partner.contactEmail;
|
|
||||||
this.selectPartnerVisible = false;
|
|
||||||
},
|
|
||||||
openSelectPeople() {
|
|
||||||
this.selectUserVisible = true;
|
|
||||||
},
|
|
||||||
handleUserSelected(user) {
|
|
||||||
this.form.dutyName = user.userName;
|
|
||||||
this.form.duty = user.userId;
|
|
||||||
this.form.dutyPhone = user.phonenumber;
|
|
||||||
this.form.dutyEmail = user.email;
|
|
||||||
this.selectUserVisible = false;
|
|
||||||
},
|
|
||||||
// 打开弹窗处理
|
|
||||||
handleOpen() {
|
handleOpen() {
|
||||||
this.reset();
|
this.reset();
|
||||||
if (this.isEdit) {
|
if (this.isEdit) {
|
||||||
getOrder(this.orderId).then(response => {
|
getOrder(this.orderId).then(response => {
|
||||||
|
|
||||||
this.form = {...response.data.projectOrderInfo};
|
this.form = {...response.data.projectOrderInfo};
|
||||||
this.title=this.form.projectName+"Rev."+this.form.versionCode
|
this.title = this.form.projectName + "Rev." + this.form.versionCode;
|
||||||
this.isProjectSelected = true;
|
this.isProjectSelected = true;
|
||||||
// 兼容版本号为空的情况
|
if (!this.form.versionCode) this.form.versionCode = 1;
|
||||||
if (!this.form.versionCode) {
|
|
||||||
this.form.versionCode = 1;
|
|
||||||
}
|
|
||||||
this.approveLogList = response.data.approveLog;
|
this.approveLogList = response.data.approveLog;
|
||||||
this.orderBakFile = response.data.orderBakFile || {};
|
this.orderBakFile = response.data.orderBakFile || {};
|
||||||
this.showFileFlag = response.data.showFileFlag || false;
|
this.showFileFlag = response.data.showFileFlag || false;
|
||||||
this.canUpdate = response.data.canUpdate || false; // 从 response.data 获取
|
this.canUpdate = response.data.canUpdate || false;
|
||||||
this.uploadFinalFile = response.data.uploadFinalFile || false; // 从 response.data 获取
|
this.uploadFinalFile = response.data.uploadFinalFile || false;
|
||||||
this.updateFile = response.data.updateFile || false; // 从 response.data 获取
|
this.updateFile = response.data.updateFile || false;
|
||||||
|
|
||||||
// 如果合同信息为空,则手动构造一个空的结构
|
|
||||||
if (!this.form.contractTableData) {
|
|
||||||
this.form.contractTableData = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (!this.form.contractTableData) this.form.contractTableData = {};
|
||||||
const currentVersion = String(this.form.versionCode);
|
const currentVersion = String(this.form.versionCode);
|
||||||
if (!this.form.contractTableData[currentVersion]) {
|
if (!this.form.contractTableData[currentVersion]) {
|
||||||
this.$set(this.form.contractTableData, currentVersion, []);
|
this.$set(this.form.contractTableData, currentVersion, []);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add placeholders for uploading if permitted and not already present
|
|
||||||
const files = this.form.contractTableData[currentVersion];
|
const files = this.form.contractTableData[currentVersion];
|
||||||
const existingSorts = new Set(files.map(f => String(f.fileSort)));
|
const existingSorts = new Set(files.map(f => String(f.fileSort)));
|
||||||
|
|
||||||
if (this.canUpdate) {
|
if (this.canUpdate) {
|
||||||
if (!existingSorts.has('0')) files.push({id: -1, fileSort: 0});
|
if (!existingSorts.has('0')) files.push({id: -1, fileSort: 0});
|
||||||
if (!existingSorts.has('1')) files.push({id: -1, fileSort: 1});
|
if (!existingSorts.has('1')) files.push({id: -1, fileSort: 1});
|
||||||
|
|
@ -665,40 +372,13 @@ export default {
|
||||||
if (!existingSorts.has('3')) files.push({id: -1, fileSort: 3});
|
if (!existingSorts.has('3')) files.push({id: -1, fileSort: 3});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.uniqueVersions.length > 0) {
|
if (this.uniqueVersions.length > 0) this.activeVersionTab = String(this.uniqueVersions[0]);
|
||||||
this.activeVersionTab = String(this.uniqueVersions[0]); // 默认显示最新版本
|
if (this.uniqueContractVersions.length > 0) this.activeContractVersionTab = String(this.uniqueContractVersions[0]);
|
||||||
}
|
|
||||||
if (this.uniqueContractVersions.length > 0) {
|
|
||||||
this.activeContractVersionTab = String(this.uniqueContractVersions[0]); // 默认显示最新合同版本
|
|
||||||
}
|
|
||||||
// 手动触发联动
|
|
||||||
this.handleBgChange(this.form.bgProperty);
|
|
||||||
// 先调用 handleChannelChange 设置 paymentMethodOptions
|
|
||||||
this.handleChannelChange(this.form.orderChannel);
|
|
||||||
// 存储原始的付款方式、付款比例和付款条件
|
|
||||||
const originalPaymentMethod = response.data.projectOrderInfo.paymentMethod;
|
|
||||||
const originalPaymentRatio = response.data.projectOrderInfo.paymentRatio;
|
|
||||||
const originalPaymentDescription = response.data.projectOrderInfo.paymentDescription;
|
|
||||||
|
|
||||||
// 重新设置付款方式,并触发其change事件以更新付款条件描述
|
|
||||||
if (originalPaymentMethod) {
|
|
||||||
this.form.paymentMethod = originalPaymentMethod;
|
|
||||||
this.handlePaymentMethodChange(originalPaymentMethod);
|
|
||||||
}
|
|
||||||
// 恢复原始的付款比例和付款条件,以防被 handlePaymentMethodChange 覆盖
|
|
||||||
if (originalPaymentRatio !== null) {
|
|
||||||
this.form.paymentRatio = originalPaymentRatio;
|
|
||||||
}
|
|
||||||
if (originalPaymentDescription) {
|
|
||||||
this.form.paymentDescription = originalPaymentDescription;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 设置新增时的默认值
|
|
||||||
this.form.dutyName = this.$store.state.user.name;
|
this.form.dutyName = this.$store.state.user.name;
|
||||||
this.form.dutyEmail = this.$store.state.user.email;
|
this.form.dutyEmail = this.$store.state.user.email;
|
||||||
this.form.dutyPhone = this.$store.state.user.phonenumber;
|
this.form.dutyPhone = this.$store.state.user.phonenumber;
|
||||||
// 初始化合同信息
|
|
||||||
this.showFileFlag = true;
|
this.showFileFlag = true;
|
||||||
this.canUpdate = true;
|
this.canUpdate = true;
|
||||||
const currentVersion = String(this.form.versionCode);
|
const currentVersion = String(this.form.versionCode);
|
||||||
|
|
@ -710,71 +390,33 @@ export default {
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
this.activeContractVersionTab = currentVersion;
|
this.activeContractVersionTab = currentVersion;
|
||||||
// 如果有项目ID,则加载项目信息
|
|
||||||
console.log(this.projectId)
|
|
||||||
if (this.projectId) {
|
if (this.projectId) {
|
||||||
getProject(this.projectId).then(response => {
|
getProject(this.projectId).then(response => {
|
||||||
this.handleProjectSelected(response.data.project);
|
this.handleProjectSelected(response.data.project);
|
||||||
}).catch(error => {
|
|
||||||
console.error('OrderDetail.vue: Error fetching project data:', error);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 关闭弹窗
|
|
||||||
handleClose() {
|
handleClose() {
|
||||||
this.$emit('update:visible', false);
|
this.$emit('update:visible', false);
|
||||||
},
|
},
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
cancel() {
|
||||||
if (this.projectId && this.orderId === null) {
|
if (this.projectId && this.orderId === null) {
|
||||||
this.$router.go(-1); // Navigate back to the previous page (project info)
|
this.$router.go(-1);
|
||||||
} else {
|
} else {
|
||||||
this.handleClose();
|
this.handleClose();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 表单重置
|
|
||||||
reset() {
|
reset() {
|
||||||
this.form = {
|
this.form = {
|
||||||
id: null,
|
id: null, projectName: null, versionCode: 1, projectCode: null, customerName: null, bgProperty: null,
|
||||||
projectName: null,
|
industryType: null, agentName: null, businessPerson: null, businessEmail: null, businessPhone: null,
|
||||||
versionCode: 1,
|
orderCode: null, orderEndTime: null, currencyType: null, actualPurchaseAmount: null, shipmentAmount: null,
|
||||||
projectCode: null,
|
deliveryTime: null, companyDelivery: null, orderChannel: null, supplier: null, dutyName: null,
|
||||||
customerName: null,
|
dutyEmail: null, dutyPhone: null, partnerName: null, level: null, partnerUserName: null, partnerEmail: null,
|
||||||
bgProperty: null,
|
partnerPhone: null, notifierAddress: null, notifier: null, notifierEmail: null, notifierPhone: null,
|
||||||
industryType: null,
|
paymentMethod: null, paymentRatio: 0, paymentDescription: null, remark: null,
|
||||||
agentName: null,
|
softwareProjectProductInfoList: [], hardwareProjectProductInfoList: [], maintenanceProjectProductInfoList: []
|
||||||
businessPerson: null,
|
|
||||||
businessEmail: null,
|
|
||||||
businessPhone: null,
|
|
||||||
orderCode: null,
|
|
||||||
orderEndTime: null,
|
|
||||||
currencyType: null,
|
|
||||||
actualPurchaseAmount: null,
|
|
||||||
shipmentAmount: null,
|
|
||||||
deliveryTime: null,
|
|
||||||
companyDelivery: null,
|
|
||||||
orderChannel: null,
|
|
||||||
supplier: null,
|
|
||||||
dutyName: null,
|
|
||||||
dutyEmail: null,
|
|
||||||
dutyPhone: null,
|
|
||||||
partnerName: null,
|
|
||||||
level: null,
|
|
||||||
partnerUserName: null,
|
|
||||||
partnerEmail: null,
|
|
||||||
partnerPhone: null,
|
|
||||||
notifierAddress: null,
|
|
||||||
notifier: null,
|
|
||||||
notifierEmail: null,
|
|
||||||
notifierPhone: null,
|
|
||||||
paymentMethod: null,
|
|
||||||
paymentRatio: 0,
|
|
||||||
paymentDescription: null,
|
|
||||||
remark: null,
|
|
||||||
softwareProjectProductInfoList: [],
|
|
||||||
hardwareProjectProductInfoList: [],
|
|
||||||
maintenanceProjectProductInfoList: []
|
|
||||||
};
|
};
|
||||||
this.orderBakFile = {};
|
this.orderBakFile = {};
|
||||||
this.activeTab = 'basic';
|
this.activeTab = 'basic';
|
||||||
|
|
@ -783,13 +425,11 @@ export default {
|
||||||
this.isProjectSelected = false;
|
this.isProjectSelected = false;
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
/** 提交数据到后端 */
|
|
||||||
_performSubmit() {
|
_performSubmit() {
|
||||||
const action = this.isEdit ? updateOrder : addOrder;
|
const action = this.isEdit ? updateOrder : addOrder;
|
||||||
action(this.form).then(response => {
|
action(this.form).then(response => {
|
||||||
this.$modal.msgSuccess(this.isEdit ? "保存成功" : "提交成功");
|
this.$modal.msgSuccess(this.isEdit ? "保存成功" : "提交成功");
|
||||||
if (this.isEdit) {
|
if (this.isEdit) {
|
||||||
// If it was a new draft, update the form to allow file uploads etc.
|
|
||||||
this.form.id = response.data.id;
|
this.form.id = response.data.id;
|
||||||
this.isEdit = true;
|
this.isEdit = true;
|
||||||
this.title = "修改订单";
|
this.title = "修改订单";
|
||||||
|
|
@ -801,141 +441,40 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 保存草稿 */
|
|
||||||
saveDraft() {
|
saveDraft() {
|
||||||
if (!this.form.projectCode) {
|
if (!this.form.projectCode) {
|
||||||
this.msgError("项目编号为必填");
|
this.msgError("项目编号为必填");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const checkDiscount = (list) => !list || list.every(item => item.discount === null || item.discount === undefined || item.discount <= 1);
|
||||||
const checkDiscount = (list) => {
|
if (!checkDiscount(this.form.softwareProjectProductInfoList) || !checkDiscount(this.form.hardwareProjectProductInfoList) || !checkDiscount(this.form.maintenanceProjectProductInfoList)) {
|
||||||
if (!list) return true;
|
|
||||||
return list.every(item => item.discount === null || item.discount === undefined || item.discount <= 1);
|
|
||||||
};
|
|
||||||
|
|
||||||
const allDiscountsValid = checkDiscount(this.form.softwareProjectProductInfoList) &&
|
|
||||||
checkDiscount(this.form.hardwareProjectProductInfoList) &&
|
|
||||||
checkDiscount(this.form.maintenanceProjectProductInfoList);
|
|
||||||
|
|
||||||
if (!allDiscountsValid) {
|
|
||||||
this.msgError("折扣不能大于100%");
|
this.msgError("折扣不能大于100%");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.form.orderStatus = '0';
|
this.form.orderStatus = '0';
|
||||||
this._performSubmit();
|
this._performSubmit();
|
||||||
},
|
},
|
||||||
/** 提交审批 */
|
|
||||||
submitForApproval() {
|
submitForApproval() {
|
||||||
const contractFiles = this.currentContractFiles;
|
const hasBusinessApprovalFile = this.currentContractFiles && this.currentContractFiles.length > 0 && this.currentContractFiles[0].id !== -1;
|
||||||
const hasBusinessApprovalFile = contractFiles && contractFiles.length > 0 && contractFiles[0].id !== -1;
|
|
||||||
|
|
||||||
if (!hasBusinessApprovalFile) {
|
if (!hasBusinessApprovalFile) {
|
||||||
this.msgError("请补充商务审批文件");
|
this.msgError("请补充商务审批文件");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) this.selectCommitTypeVisible = true;
|
||||||
this.selectCommitTypeVisible = true;
|
else this.msgError("请完善表单");
|
||||||
} else {
|
|
||||||
this.msgError("请完善表单");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 处理合同和流程类型选择 */
|
|
||||||
handleCommitTypeSelected(data) {
|
handleCommitTypeSelected(data) {
|
||||||
this.form.processTemplate = data.processTemplate;
|
this.form.processTemplate = data.processTemplate;
|
||||||
this.form.processType = data.processType;
|
this.form.processType = data.processType;
|
||||||
this.form.orderStatus = '1';
|
this.form.orderStatus = '1';
|
||||||
this._performSubmit();
|
this._performSubmit();
|
||||||
},
|
},
|
||||||
/** BG改变事件 */
|
|
||||||
handleBgChange(value) {
|
|
||||||
this.form.industryType = null;
|
|
||||||
const dictType = value === 'YYS' ? 'bg_yys' : 'bg_hysy';
|
|
||||||
return getDicts(dictType).then(response => {
|
|
||||||
this.industryOptions = response.data;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 下单通路改变事件 */
|
|
||||||
handleChannelChange(value) {
|
|
||||||
this.form.supplier = value === '1' ? '广州佳都技术有限公司' : '紫光汇智信息技术有限公司';
|
|
||||||
this.form.paymentMethod = null;
|
|
||||||
this.form.paymentRatio = 0;
|
|
||||||
this.form.paymentDescription = null;
|
|
||||||
|
|
||||||
if (value === '1') { // 总代
|
|
||||||
this.paymentMethodOptions = [
|
|
||||||
{ label: '全款支付,无需预付款', value: '1-1' },
|
|
||||||
{ label: '全款支付,需单独备货生产,预付订单总货款百分比', value: '1-2' }
|
|
||||||
];
|
|
||||||
} else if (value === '2') { // 直签
|
|
||||||
this.paymentMethodOptions = [
|
|
||||||
{ label: '全款支付', value: '2-1' },
|
|
||||||
{ label: '全款支付,需单独备货生产,预付订单总货款百分比', value: '2-2' },
|
|
||||||
{ label: '商业汇票支付,预付订单总货款百分比', value: '2-3' }
|
|
||||||
];
|
|
||||||
} else {
|
|
||||||
this.paymentMethodOptions = [];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 付款方式改变事件 */
|
|
||||||
handlePaymentMethodChange(value) {
|
|
||||||
const descriptionTemplates = {
|
|
||||||
'1-2': '总代预付{ratio}%订单金额作为备货押金后开始备货生产,备货完成供货商发起付款通知后,总代需1个月内支付尾款完成提货,否则备货押金不予退还。',
|
|
||||||
'2-2': '进货商预付{ratio}%订单金额作为备货押金后开始备货生产,备货完成供货商发起付款通知后,进货商需3个工作日内付全部剩余款项,即可享受订单约定的现金折扣。',
|
|
||||||
'2-3': '进货商预付{ratio}%订单金额作为备货押金后开始备货生产,备货完成供货商发起付款通知后,供货商需在1个月内提交剩余款项额度的商业汇票完成提货,否则备货押金不予退还。'
|
|
||||||
};
|
|
||||||
|
|
||||||
let description = '';
|
|
||||||
let paymentRatio = 0;
|
|
||||||
|
|
||||||
switch (value) {
|
|
||||||
case '1-1':
|
|
||||||
description = '备货完成供货商发起付款通知后,总代按照订单金额支付全款。';
|
|
||||||
paymentRatio = 100;
|
|
||||||
break;
|
|
||||||
case '1-2':
|
|
||||||
paymentRatio = 30;
|
|
||||||
description = descriptionTemplates['1-2'].replace('{ratio}', paymentRatio);
|
|
||||||
break;
|
|
||||||
case '2-1':
|
|
||||||
description = '备货完成供货商发起付款通知后,进货商需3个工作日内付订单全部款项,即可享受订单约定的现金折扣。';
|
|
||||||
paymentRatio = 100;
|
|
||||||
break;
|
|
||||||
case '2-2':
|
|
||||||
paymentRatio = 30;
|
|
||||||
description = descriptionTemplates['2-2'].replace('{ratio}', paymentRatio);
|
|
||||||
break;
|
|
||||||
case '2-3':
|
|
||||||
paymentRatio = 30;
|
|
||||||
description = descriptionTemplates['2-3'].replace('{ratio}', paymentRatio);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.form.paymentDescription = description;
|
|
||||||
this.form.paymentRatio = paymentRatio;
|
|
||||||
},
|
|
||||||
/** 更新付款条件描述 */
|
|
||||||
updatePaymentDescription() {
|
|
||||||
const paymentMethod = this.form.paymentMethod;
|
|
||||||
const ratio = this.form.paymentRatio;
|
|
||||||
const descriptionTemplates = {
|
|
||||||
'1-2': '总代预付{ratio}%订单金额作为备货押金后开始备货生产,备货完成供货商发起付款通知后,总代需1个月内支付尾款完成提货,否则备货押金不予退还。',
|
|
||||||
'2-2': '进货商预付{ratio}%订单金额作为备货押金后开始备货生产,备货完成供货商发起付款通知后,进货商需3个工作日内付全部剩余款项,即可享受订单约定的现金折扣。',
|
|
||||||
'2-3': '进货商预付{ratio}%订单金额作为备货押金后开始备货生产,备货完成供货商发起付款通知后,供货商需在1个月内提交剩余款项额度的商业汇票完成提货,否则备货押金不予退还。'
|
|
||||||
};
|
|
||||||
if (descriptionTemplates[paymentMethod]) {
|
|
||||||
this.form.paymentDescription = descriptionTemplates[paymentMethod].replace('{ratio}', ratio);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 选择项目按钮操作 */
|
|
||||||
handleSelectProject() {
|
handleSelectProject() {
|
||||||
this.selectProjectVisible = true;
|
this.selectProjectVisible = true;
|
||||||
},
|
},
|
||||||
handleProjectSelected(projectData) {
|
handleProjectSelected(projectData) {
|
||||||
|
|
||||||
this.form.projectName = projectData.projectName;
|
this.form.projectName = projectData.projectName;
|
||||||
this.form.projectCode = projectData.projectCode;
|
this.form.projectCode = projectData.projectCode;
|
||||||
this.form.projectId = projectData.id;
|
this.form.projectId = projectData.id;
|
||||||
|
|
@ -952,23 +491,34 @@ export default {
|
||||||
this.form.softwareProjectProductInfoList = projectData.softwareProjectProductInfoList || [];
|
this.form.softwareProjectProductInfoList = projectData.softwareProjectProductInfoList || [];
|
||||||
this.form.hardwareProjectProductInfoList = projectData.hardwareProjectProductInfoList || [];
|
this.form.hardwareProjectProductInfoList = projectData.hardwareProjectProductInfoList || [];
|
||||||
this.form.maintenanceProjectProductInfoList = projectData.maintenanceProjectProductInfoList || [];
|
this.form.maintenanceProjectProductInfoList = projectData.maintenanceProjectProductInfoList || [];
|
||||||
|
|
||||||
// Handle BG change and then industry type
|
|
||||||
this.handleBgChange(projectData.bgProperty).then(() => {
|
|
||||||
this.form.industryType = projectData.industryType;
|
this.form.industryType = projectData.industryType;
|
||||||
});
|
|
||||||
|
|
||||||
this.isProjectSelected = true;
|
this.isProjectSelected = true;
|
||||||
this.selectProjectVisible = false;
|
this.selectProjectVisible = false;
|
||||||
|
|
||||||
},
|
},
|
||||||
|
openSelectPeople() {
|
||||||
|
this.selectUserVisible = true;
|
||||||
|
},
|
||||||
|
handleUserSelected(user) {
|
||||||
|
this.form.dutyName = user.userName;
|
||||||
|
this.form.duty = user.userId;
|
||||||
|
this.form.dutyPhone = user.phonenumber;
|
||||||
|
this.form.dutyEmail = user.email;
|
||||||
|
this.selectUserVisible = false;
|
||||||
|
},
|
||||||
|
openSelectPartner() {
|
||||||
|
this.selectPartnerVisible = true;
|
||||||
|
},
|
||||||
|
handlePartnerSelected(partner) {
|
||||||
|
this.form.partnerName = partner.partnerName;
|
||||||
|
this.form.partnerCode = partner.partnerCode;
|
||||||
|
this.form.partnerUserName = partner.contactPerson;
|
||||||
|
this.form.level = partner.level;
|
||||||
|
this.form.partnerPhone = partner.contactPhone;
|
||||||
|
this.form.partnerEmail = partner.contactEmail;
|
||||||
|
this.selectPartnerVisible = false;
|
||||||
|
},
|
||||||
formatApproveStatus(status) {
|
formatApproveStatus(status) {
|
||||||
const statusMap = {
|
const statusMap = { '1': '提交审批', '2': '驳回', '3': '批准' };
|
||||||
'1': '提交审批',
|
|
||||||
'2': '驳回',
|
|
||||||
'3': '批准'
|
|
||||||
};
|
|
||||||
return statusMap[status] || '提交审批';
|
return statusMap[status] || '提交审批';
|
||||||
},
|
},
|
||||||
downloadTem() {
|
downloadTem() {
|
||||||
|
|
@ -976,16 +526,11 @@ export default {
|
||||||
this.$modal.alertWarning("请先选择下单通路");
|
this.$modal.alertWarning("请先选择下单通路");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const orderId = this.form.id;
|
window.location.href = process.env.VUE_APP_BASE_API + `/project/order/contract/export?orderId=${this.form.id}`;
|
||||||
window.location.href = process.env.VUE_APP_BASE_API + `/project/order/contract/export?orderId=${orderId}`;
|
|
||||||
},
|
},
|
||||||
previewFile(filePath, fileName) {
|
previewFile(filePath, fileName) {
|
||||||
if (filePath.endsWith(".png") || filePath.endsWith(".jpg") || filePath.endsWith(".jpeg") || filePath.endsWith(".pdf")) {
|
|
||||||
const url = process.env.VUE_APP_BASE_API + `/project/order/file/view?filePath=${encodeURIComponent(filePath)}&fileName=${encodeURIComponent(fileName)}`;
|
const url = process.env.VUE_APP_BASE_API + `/project/order/file/view?filePath=${encodeURIComponent(filePath)}&fileName=${encodeURIComponent(fileName)}`;
|
||||||
window.open(url);
|
window.open(url);
|
||||||
} else {
|
|
||||||
this.downFile(filePath, fileName);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
downFile(filePath, fileName) {
|
downFile(filePath, fileName) {
|
||||||
window.location.href = process.env.VUE_APP_BASE_API + `/project/order/file/download?filePath=${encodeURIComponent(filePath)}&fileName=${encodeURIComponent(fileName)}`;
|
window.location.href = process.env.VUE_APP_BASE_API + `/project/order/file/download?filePath=${encodeURIComponent(filePath)}&fileName=${encodeURIComponent(fileName)}`;
|
||||||
|
|
@ -993,17 +538,14 @@ export default {
|
||||||
handleUploadFile(event) {
|
handleUploadFile(event) {
|
||||||
const file = event.target.files[0];
|
const file = event.target.files[0];
|
||||||
if (!file) return;
|
if (!file) return;
|
||||||
|
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append('file', file);
|
formData.append('file', file);
|
||||||
formData.append('orderId', this.form.id);
|
formData.append('orderId', this.form.id);
|
||||||
formData.append('versionCode', this.form.versionCode);
|
formData.append('versionCode', this.form.versionCode);
|
||||||
formData.append('fileSort', this.fileSort);
|
formData.append('fileSort', this.fileSort);
|
||||||
|
|
||||||
uploadContractFile(formData).then(response => {
|
uploadContractFile(formData).then(response => {
|
||||||
this.$modal.msgSuccess('导入成功');
|
this.$modal.msgSuccess('导入成功');
|
||||||
this.addFile(response.data);
|
this.addFile(response.data);
|
||||||
// 清空文件输入框,以便再次上传相同文件
|
|
||||||
event.target.value = '';
|
event.target.value = '';
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$modal.msgError('导入失败');
|
this.$modal.msgError('导入失败');
|
||||||
|
|
@ -1016,55 +558,31 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.fileSort = sortNum;
|
this.fileSort = sortNum;
|
||||||
if (sortNum === 0) {
|
document.getElementById(`uploadInput${sortNum > 1 ? 2 : sortNum}`).click();
|
||||||
document.getElementById('uploadInput').click();
|
|
||||||
} else if (sortNum === 1) {
|
|
||||||
document.getElementById('uploadInput1').click();
|
|
||||||
} else {
|
|
||||||
document.getElementById('uploadInput2').click();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
addFile(data) {
|
addFile(data) {
|
||||||
const sortNum = data.fileSort;
|
|
||||||
if (!this.groupedContractFiles[String(this.form.versionCode)]) {
|
|
||||||
this.$set(this.groupedContractFiles, String(this.form.versionCode), {files: [], bakFile: null});
|
|
||||||
}
|
|
||||||
const currentVersionFiles = this.groupedContractFiles[String(this.form.versionCode)].files;
|
const currentVersionFiles = this.groupedContractFiles[String(this.form.versionCode)].files;
|
||||||
const fileIndex = currentVersionFiles.findIndex(file => file.fileSort === sortNum);
|
const fileIndex = currentVersionFiles.findIndex(file => file.fileSort === data.fileSort);
|
||||||
|
if (fileIndex !== -1) this.$set(currentVersionFiles, fileIndex, data);
|
||||||
if (fileIndex !== -1) {
|
else currentVersionFiles.push(data);
|
||||||
this.$set(currentVersionFiles, fileIndex, data);
|
|
||||||
} else {
|
|
||||||
currentVersionFiles.push(data);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
delUploadRow(sortNum, id) {
|
delUploadRow(sortNum, id) {
|
||||||
this.$modal.confirm("确定删除该文件吗?").then(() => {
|
this.$modal.confirm("确定删除该文件吗?").then(() => {
|
||||||
delContractFile(id).then(() => {
|
delContractFile(id).then(() => {
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
// 找到当前版本的文件列表并更新
|
|
||||||
const currentVersionFiles = this.groupedContractFiles[String(this.activeContractVersionTab)].files;
|
const currentVersionFiles = this.groupedContractFiles[String(this.activeContractVersionTab)].files;
|
||||||
const fileIndex = currentVersionFiles.findIndex(file => file.id === id);
|
const fileIndex = currentVersionFiles.findIndex(file => file.id === id);
|
||||||
if (fileIndex !== -1) {
|
if (fileIndex !== -1) {
|
||||||
this.$set(currentVersionFiles, fileIndex, {
|
this.$set(currentVersionFiles, fileIndex, { id: -1, fileSort: sortNum });
|
||||||
id: -1,
|
|
||||||
fileSort: sortNum,
|
|
||||||
fileName: this.file_log_arr[sortNum],
|
|
||||||
uploadUserName: '',
|
|
||||||
uploadTime: '',
|
|
||||||
filePath: ''
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
|
||||||
this.$modal.msgError("删除失败");
|
|
||||||
});
|
});
|
||||||
}).catch(() => {});
|
});
|
||||||
},
|
},
|
||||||
handleProductConfigInput(productData) {
|
handleProductConfigInput(productData) {
|
||||||
this.form.softwareProjectProductInfoList = productData.softwareProjectProductInfoList;
|
this.form.softwareProjectProductInfoList = productData.softwareProjectProductInfoList;
|
||||||
this.form.hardwareProjectProductInfoList = productData.hardwareProjectProductInfoList;
|
this.form.hardwareProjectProductInfoList = productData.hardwareProjectProductInfoList;
|
||||||
this.form.maintenanceProjectProductInfoList = productData.maintenanceProjectProductInfoList;
|
this.form.maintenanceProjectProductInfoList = productData.maintenanceProjectProductInfoList;
|
||||||
this.form.shipmentAmount = this.totalConfigAmount; // Update shipmentAmount
|
this.form.shipmentAmount = this.totalConfigAmount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,220 +1,17 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<!-- 添加或修改订单管理对话框 -->
|
<!-- 订单详情抽屉 -->
|
||||||
<el-drawer :title="title" :visible.sync="internalVisible" direction="rtl" size="1400px" @close="handleClose">
|
<el-drawer :title="title" :visible.sync="internalVisible" direction="rtl" size="1400px" @close="handleClose">
|
||||||
<div style="padding: 20px;">
|
<div style="padding: 20px;">
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px" :disabled="true">
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px" :disabled="true">
|
||||||
<el-tabs v-model="activeTab">
|
<el-tabs v-model="activeTab">
|
||||||
<el-tab-pane label="基础信息" name="basic">
|
<el-tab-pane label="基础信息" name="basic">
|
||||||
<div style="max-height: 80vh; overflow-y: auto; padding: 15px;">
|
<div style="max-height: 80vh; overflow-y: auto; padding: 15px;">
|
||||||
<el-row>
|
<order-info
|
||||||
<el-col :span="16">
|
:order-data.sync="form"
|
||||||
<el-form-item label="项目名称" prop="projectName">
|
layout="drawer"
|
||||||
<el-input v-model="form.projectName" placeholder="选择项目后带入" readonly>
|
:is-readonly="true"
|
||||||
<el-button slot="append" icon="el-icon-search" @click="handleSelectProject"></el-button>
|
/>
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="版本号" prop="versionCode">
|
|
||||||
<el-input v-model="form.versionCode" :min="1" readonly label="版本号"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="项目编号" prop="projectCode">
|
|
||||||
<el-input v-model="form.projectCode" placeholder="选择项目后带入" readonly/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="16">
|
|
||||||
<el-form-item label="最终客户" prop="customerName">
|
|
||||||
<el-input v-model="form.customerName" placeholder="选择项目后带入" readonly/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="BG" prop="bgProperty">
|
|
||||||
<el-select v-model="form.bgProperty" placeholder="请选择BG" @change="handleBgChange">
|
|
||||||
<el-option v-for="dict in bgOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="行业" prop="industryType">
|
|
||||||
<el-select v-model="form.industryType" placeholder="请先选择BG">
|
|
||||||
<el-option v-for="dict in industryOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="代表处" prop="agentName">
|
|
||||||
<el-input v-model="form.agentName" placeholder="选择项目后带入" readonly/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="进货商接口人" prop="businessPerson">
|
|
||||||
<el-input v-model="form.businessPerson" placeholder="请输入进货商接口人"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="Email" prop="businessEmail">
|
|
||||||
<el-input v-model="form.businessEmail" placeholder="请输入Email"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="联系方式" prop="businessPhone">
|
|
||||||
<el-input v-model="form.businessPhone" placeholder="请输入联系方式"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="合同编号" prop="orderCode">
|
|
||||||
<el-input v-model="form.orderCode" placeholder="自动生成" readonly/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="16">
|
|
||||||
<el-form-item label="执行单截止时间" prop="orderEndTime">
|
|
||||||
<el-date-picker v-model="form.orderEndTime" type="date" value-format="yyyy-MM-dd" placeholder="审批完成后自动计算" disabled></el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="币种" prop="currencyType">
|
|
||||||
<el-select v-model="form.currencyType" placeholder="请选择币种">
|
|
||||||
<el-option v-for="dict in currencyOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col
|
|
||||||
v-if="(form.processTemplate=='1' ||(form.processTemplate!='1' &&( form.orderStatus=='1'||form.orderStatus=='2')))"
|
|
||||||
:span="8">
|
|
||||||
<el-form-item label="总代进货金额" prop="actualPurchaseAmount">
|
|
||||||
<el-input v-model="form.actualPurchaseAmount" readonly/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="(form.processTemplate=='1' ||(form.processTemplate!='1' &&( form.orderStatus=='1'||form.orderStatus=='2')))?8:16"
|
|
||||||
>
|
|
||||||
<el-form-item label="总代出货金额" prop="shipmentAmount">
|
|
||||||
<el-input v-model="form.shipmentAmount" placeholder="请输入金额"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="要求到货时间" prop="deliveryTime">
|
|
||||||
<el-date-picker clearable v-model="form.deliveryTime" type="date" value-format="yyyy-MM-dd"
|
|
||||||
placeholder="选择要求到货时间">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="16">
|
|
||||||
<el-form-item label="公司直发" prop="companyDelivery">
|
|
||||||
<el-select v-model="form.companyDelivery" placeholder="请选择">
|
|
||||||
<el-option v-for="dict in companyDeliveryOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="下单通路" prop="orderChannel">
|
|
||||||
<el-select v-model="form.orderChannel" placeholder="请选择" @change="handleChannelChange">
|
|
||||||
<el-option label="总代" value="1"></el-option>
|
|
||||||
<el-option label="直签" value="2"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8" v-if="form.orderChannel == '1'">
|
|
||||||
<el-form-item label="总代" prop="zd">
|
|
||||||
<el-input value="广州佳都技术有限公司" readonly/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="form.orderChannel == '2' ? 16 : 8">
|
|
||||||
<el-form-item label="供货商" prop="supplier">
|
|
||||||
<el-input v-model="form.supplier"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="汇智责任人" prop="dutyName">
|
|
||||||
<el-input v-model="form.dutyName" placeholder="请选择责任人" @click.native=" openSelectPeople()">
|
|
||||||
<el-button slot="append" icon="el-icon-search" @click.native=" openSelectPeople()"></el-button>
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="Email" prop="dutyEmail">
|
|
||||||
<el-input v-model="form.dutyEmail" placeholder="请输入Email"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="联系方式" prop="dutyPhone">
|
|
||||||
<el-input v-model="form.dutyPhone" placeholder="请输入联系方式"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="16">
|
|
||||||
<el-form-item label="进货商" prop="partnerName">
|
|
||||||
<el-input v-model="form.partnerName" placeholder="请选择进货商" @click.native="openSelectPartner">
|
|
||||||
<el-button slot="append" icon="el-icon-search" @click.native="openSelectPartner"></el-button>
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="进货商类型" prop="level">
|
|
||||||
<el-select v-model="form.level" placeholder="选择后带入" disabled>
|
|
||||||
<el-option v-for="dict in partnerLevelOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="进货商联系人" prop="partnerUserName">
|
|
||||||
<el-input v-model="form.partnerUserName" placeholder="请输入进货商联系人"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="Email" prop="partnerEmail">
|
|
||||||
<el-input v-model="form.partnerEmail" placeholder="请输入Email"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="联系方式" prop="partnerPhone">
|
|
||||||
<el-input v-model="form.partnerPhone" placeholder="请输入联系方式"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="收货地址" prop="notifierAddress">
|
|
||||||
<el-input v-model="form.notifierAddress" placeholder="请输入收货地址"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="收货人" prop="notifier">
|
|
||||||
<el-input v-model="form.notifier" placeholder="请输入收货人"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="Email" prop="notifierEmail">
|
|
||||||
<el-input v-model="form.notifierEmail" placeholder="请输入Email"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="联系方式" prop="notifierPhone">
|
|
||||||
<el-input v-model="form.notifierPhone" placeholder="请输入联系方式"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="付款方式" prop="paymentMethod">
|
|
||||||
<el-select v-model="form.paymentMethod" placeholder="请选择付款方式" @change="handlePaymentMethodChange">
|
|
||||||
<el-option v-for="item in paymentMethodOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="付款比例" prop="paymentRatio">
|
|
||||||
<el-input-number v-model="form.paymentRatio" :min="0" :max="100" placeholder="请输入付款比例" @change="updatePaymentDescription"></el-input-number>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="付款条件" prop="paymentDescription">
|
|
||||||
<el-input v-model="form.paymentDescription" type="textarea" :rows="3" readonly/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="其他特别说明" prop="remark">
|
|
||||||
<el-input v-model="form.remark" placeholder="请输入其他特别说明"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="配置信息" name="config">
|
<el-tab-pane label="配置信息" name="config">
|
||||||
|
|
@ -297,14 +94,6 @@
|
||||||
<el-table-column label="上传时间" prop="uploadTime" width="180"></el-table-column>
|
<el-table-column label="上传时间" prop="uploadTime" width="180"></el-table-column>
|
||||||
<el-table-column label="操作" width="200">
|
<el-table-column label="操作" width="200">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<!-- <el-button-->
|
|
||||||
<!-- v-if="scope.row.id === -1 && ((canUpdate && scope.row.fileSort !== '3') || (uploadFinalFile && scope.row.fileSort === '3'))"-->
|
|
||||||
<!-- type="text"-->
|
|
||||||
<!-- icon="el-icon-upload"-->
|
|
||||||
<!-- @click="importList(scope.$index)"-->
|
|
||||||
<!-- :disabled="isOrderApprovedOrInReview"-->
|
|
||||||
<!-- >上传-->
|
|
||||||
<!-- </el-button>-->
|
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.id !== -1"
|
v-if="scope.row.id !== -1"
|
||||||
type="text"
|
type="text"
|
||||||
|
|
@ -321,14 +110,6 @@
|
||||||
@click="downFile(scope.row.filePath, scope.row.fileName)"
|
@click="downFile(scope.row.filePath, scope.row.fileName)"
|
||||||
>下载
|
>下载
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
|
||||||
v-if="scope.row.id !== -1 && activeContractVersionTab == form.versionCode && ((canUpdate && scope.row.fileSort !== '3') || (uploadFinalFile && scope.row.fileSort === '3'))"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="delUploadRow(scope.$index, scope.row.id)"
|
|
||||||
:disabled="isOrderApprovedOrInReview"
|
|
||||||
>删除
|
|
||||||
</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -337,52 +118,29 @@
|
||||||
<div v-else>暂无合同信息数据。</div>
|
<div v-else>暂无合同信息数据。</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input id="uploadInput" type="file" accept=".pdf,.jpg,.png" style="display: none" @change="handleUploadFile"/>
|
|
||||||
<input id="uploadInput1" type="file" accept=".pdf,.jpg,.png" style="display: none" @change="handleUploadFile"/>
|
|
||||||
<input id="uploadInput2" type="file" accept=".zip,.rar,.jpg,.png" style="display: none" @change="handleUploadFile"/>
|
|
||||||
<input id="fileSort" type="hidden" v-model="fileSort"/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div class="dialog-footer" style="padding: 10px 20px; text-align: right;">
|
||||||
<el-button @click="cancel">关 闭</el-button>
|
<el-button @click="cancel">关 闭</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
<select-agent :visible.sync="selectAgentVisible" @agent-selected="handleAgentSelected"/>
|
|
||||||
<select-customer :visible.sync="selectCustomerVisible" @customer-selected="handleCustomerSelected"/>
|
|
||||||
<select-partner :visible.sync="selectPartnerVisible" @partner-selected="handlePartnerSelected"/>
|
|
||||||
<select-user :visible.sync="selectUserVisible" @user-selected="handleUserSelected"/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.el-form-item .el-select,
|
|
||||||
.el-form-item .el-date-picker {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getOrder, addOrder, updateOrder, delContractFile, uploadContractFile } from "@/api/project/order";
|
import { getOrder } from "@/api/project/order";
|
||||||
import { getDicts } from "@/api/system/dict/data";
|
|
||||||
import ProductConfig from '@/views/project/info/ProductConfig.vue';
|
import ProductConfig from '@/views/project/info/ProductConfig.vue';
|
||||||
import SelectAgent from "@/views/system/agent/selectAgent.vue";
|
import OrderInfo from '@/components/order/OrderInfo.vue';
|
||||||
import SelectCustomer from "@/views/system/customer/selectCustomer.vue";
|
|
||||||
import SelectPartner from "@/views/system/partner/selectPartner.vue";
|
|
||||||
import SelectUser from "@/views/system/user/selectUser.vue";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "OrderDetailDrawer",
|
name: "OrderDetailDrawer",
|
||||||
components: {
|
components: {
|
||||||
SelectAgent,
|
|
||||||
SelectCustomer,
|
|
||||||
SelectPartner,
|
|
||||||
SelectUser,
|
|
||||||
ProductConfig,
|
ProductConfig,
|
||||||
|
OrderInfo,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
visible: {
|
visible: {
|
||||||
|
|
@ -400,83 +158,28 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 表单参数
|
|
||||||
form: {},
|
form: {},
|
||||||
approveLogList: [],
|
approveLogList: [],
|
||||||
activeVersionTab: null,
|
activeVersionTab: null,
|
||||||
activeContractVersionTab: null, // 当前激活的合同版本Tab
|
activeContractVersionTab: null,
|
||||||
showFileFlag: false, // 是否显示文件上传区域
|
showFileFlag: false,
|
||||||
uploadInput: null, // 文件上传的引用
|
|
||||||
fileSort: null, // 文件类型排序
|
|
||||||
file_log_arr: [ "(请上传商务折扣审批邮件信息).pdf/.jpg/.png","(请上传合同信息).pdf/.jpg/.png", "(补充附件).zip/.rar/.jpg/.png","(请上传已盖章合同信息).pdf/.jpg/.png"],
|
file_log_arr: [ "(请上传商务折扣审批邮件信息).pdf/.jpg/.png","(请上传合同信息).pdf/.jpg/.png", "(补充附件).zip/.rar/.jpg/.png","(请上传已盖章合同信息).pdf/.jpg/.png"],
|
||||||
// 内部可见性控制
|
|
||||||
internalVisible: this.visible,
|
internalVisible: this.visible,
|
||||||
selectAgentVisible: false,
|
|
||||||
selectCustomerVisible: false,
|
|
||||||
selectPartnerVisible: false,
|
|
||||||
selectUserVisible: false,
|
|
||||||
canUpdate: false, // 新增 canUpdate 属性
|
|
||||||
uploadFinalFile: false, // 新增 uploadFinalFile 属性
|
|
||||||
updateFile: false, // 新增 updateFile 属性
|
|
||||||
// 当前激活的Tab
|
|
||||||
activeTab: 'basic',
|
activeTab: 'basic',
|
||||||
// 字典数据
|
rules: {} // Rules are now within the child component
|
||||||
bgOptions: [],
|
|
||||||
industryOptions: [],
|
|
||||||
currencyOptions: [],
|
|
||||||
companyDeliveryOptions: [],
|
|
||||||
partnerLevelOptions: [],
|
|
||||||
paymentMethodOptions: [],
|
|
||||||
// 表单校验
|
|
||||||
rules: {
|
|
||||||
projectName: [{ required: true, message: "项目名称不能为空", trigger: "blur" }],
|
|
||||||
versionCode: [{ required: true, message: "版本号不能为空", trigger: "blur" }],
|
|
||||||
projectCode: [{ required: true, message: "项目编号不能为空", trigger: "blur" }],
|
|
||||||
customerName: [{ required: true, message: "最终客户不能为空", trigger: "blur" }],
|
|
||||||
bgProperty: [{ required: true, message: "BG不能为空", trigger: "change" }],
|
|
||||||
industryType: [{ required: true, message: "行业不能为空", trigger: "change" }],
|
|
||||||
agentName: [{ required: true, message: "代表处不能为空", trigger: "blur" }],
|
|
||||||
businessPerson: [{ required: true, message: "进货商接口人不能为空", trigger: "blur" }],
|
|
||||||
businessPhone: [{ required: true, message: "联系方式不能为空", trigger: "blur" }],
|
|
||||||
currencyType: [{ required: true, message: "币种不能为空", trigger: "change" }],
|
|
||||||
shipmentAmount: [{ required: true, message: "总代出货金额不能为空", trigger: "blur" }],
|
|
||||||
deliveryTime: [{ required: true, message: "要求到货时间不能为空", trigger: "blur" }],
|
|
||||||
orderChannel: [{ required: true, message: "下单通路不能为空", trigger: "change" }],
|
|
||||||
supplier: [{ required: true, message: "供货商不能为空", trigger: "blur" }],
|
|
||||||
dutyPhone: [{ required: true, message: "联系方式不能为空", trigger: "blur" }],
|
|
||||||
partnerName: [{ required: true, message: "进货商不能为空", trigger: "blur" }],
|
|
||||||
level: [{ required: true, message: "进货商类型不能为空", trigger: "change" }],
|
|
||||||
partnerPhone: [{ required: true, message: "联系方式不能为空", trigger: "blur" }],
|
|
||||||
notifierAddress: [{ required: true, message: "收货地址不能为空", trigger: "blur" }],
|
|
||||||
notifierPhone: [{ required: true, message: "联系方式不能为空", trigger: "blur" }],
|
|
||||||
paymentMethod: [{ required: true, message: "付款方式不能为空", trigger: "change" }],
|
|
||||||
paymentRatio: [{ required: true, message: "付款比例不能为空", trigger: "blur" }],
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isEdit() {
|
|
||||||
return this.orderId != null;
|
|
||||||
},
|
|
||||||
isOrderApprovedOrInReview() {
|
|
||||||
return this.form.orderStatus === '1' || this.form.orderStatus === '2';
|
|
||||||
},
|
|
||||||
uniqueVersions() {
|
uniqueVersions() {
|
||||||
if (!this.approveLogList || this.approveLogList.length === 0) {
|
if (!this.approveLogList || this.approveLogList.length === 0) return [];
|
||||||
return [];
|
|
||||||
}
|
|
||||||
const versions = [...new Set(this.approveLogList.map(log => log.extendField1))];
|
const versions = [...new Set(this.approveLogList.map(log => log.extendField1))];
|
||||||
return versions.sort((a, b) => b - a); // 降序排列版本号
|
return versions.sort((a, b) => b - a);
|
||||||
},
|
},
|
||||||
groupedApproveLogs() {
|
groupedApproveLogs() {
|
||||||
if (!this.approveLogList || this.approveLogList.length === 0) {
|
if (!this.approveLogList || this.approveLogList.length === 0) return {};
|
||||||
return {};
|
|
||||||
}
|
|
||||||
return this.approveLogList.reduce((acc, log) => {
|
return this.approveLogList.reduce((acc, log) => {
|
||||||
const version = log.extendField1;
|
const version = log.extendField1;
|
||||||
if (!acc[version]) {
|
if (!acc[version]) acc[version] = [];
|
||||||
acc[version] = [];
|
|
||||||
}
|
|
||||||
acc[version].push(log);
|
acc[version].push(log);
|
||||||
return acc;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
@ -493,42 +196,33 @@ export default {
|
||||||
if (version) versions.add(String(version));
|
if (version) versions.add(String(version));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 确保当前版本号始终存在
|
|
||||||
if (this.form.versionCode) {
|
if (this.form.versionCode) {
|
||||||
versions.add(String(this.form.versionCode));
|
versions.add(String(this.form.versionCode));
|
||||||
}
|
}
|
||||||
return Array.from(versions).sort((a, b) => Number(b) - Number(a)); // 降序排列版本号
|
return Array.from(versions).sort((a, b) => Number(b) - Number(a));
|
||||||
},
|
},
|
||||||
groupedContractFiles() {
|
groupedContractFiles() {
|
||||||
const grouped = {};
|
const grouped = {};
|
||||||
if (this.form.contractTableData) {
|
if (this.form.contractTableData) {
|
||||||
for (const version in this.form.contractTableData) {
|
for (const version in this.form.contractTableData) {
|
||||||
if (!grouped[version]) {
|
if (!grouped[version]) grouped[version] = { files: [], bakFile: null };
|
||||||
grouped[version] = { files: [], bakFile: null };
|
|
||||||
}
|
|
||||||
grouped[version].files = this.form.contractTableData[version];
|
grouped[version].files = this.form.contractTableData[version];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.orderBakFile) {
|
if (this.orderBakFile) {
|
||||||
for (const version in this.orderBakFile) {
|
for (const version in this.orderBakFile) {
|
||||||
if (!grouped[version]) {
|
if (!grouped[version]) grouped[version] = { files: [], bakFile: null };
|
||||||
grouped[version] = { files: [], bakFile: null };
|
|
||||||
}
|
|
||||||
grouped[version].bakFile = this.orderBakFile[version];
|
grouped[version].bakFile = this.orderBakFile[version];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return grouped;
|
return grouped;
|
||||||
},
|
},
|
||||||
currentContractFiles() {
|
currentContractFiles() {
|
||||||
if (!this.activeContractVersionTab || !this.groupedContractFiles[this.activeContractVersionTab]) {
|
if (!this.activeContractVersionTab || !this.groupedContractFiles[this.activeContractVersionTab]) return [];
|
||||||
return [];
|
|
||||||
}
|
|
||||||
return this.groupedContractFiles[this.activeContractVersionTab].files;
|
return this.groupedContractFiles[this.activeContractVersionTab].files;
|
||||||
},
|
},
|
||||||
currentContractBakFile() {
|
currentContractBakFile() {
|
||||||
if (!this.activeContractVersionTab || !this.groupedContractFiles[this.activeContractVersionTab]) {
|
if (!this.activeContractVersionTab || !this.groupedContractFiles[this.activeContractVersionTab]) return null;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return this.groupedContractFiles[this.activeContractVersionTab].bakFile;
|
return this.groupedContractFiles[this.activeContractVersionTab].bakFile;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -540,171 +234,44 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
|
||||||
this.getDicts("bg_type").then(response => { this.bgOptions = response.data; });
|
|
||||||
this.getDicts("currency_type").then(response => { this.currencyOptions = response.data; });
|
|
||||||
this.getDicts("company_delivery").then(response => { this.companyDeliveryOptions = response.data; });
|
|
||||||
this.getDicts("identify_level").then(response => { this.partnerLevelOptions = response.data; });
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
handleAgentSelected(agent) {
|
|
||||||
this.form.agentName = agent.agentName;
|
|
||||||
this.form.agentCode = agent.agentCode;
|
|
||||||
this.selectAgentVisible = false;
|
|
||||||
},
|
|
||||||
openSelectCustomer() {
|
|
||||||
this.selectCustomerVisible = true;
|
|
||||||
},
|
|
||||||
handleCustomerSelected(customer) {
|
|
||||||
this.form.customerName = customer.customerName;
|
|
||||||
this.form.customerCode = customer.customerCode;
|
|
||||||
this.form.customerUserName = customer.contactPerson;
|
|
||||||
this.form.customerPhone = customer.contactPhone;
|
|
||||||
this.selectCustomerVisible = false;
|
|
||||||
},
|
|
||||||
openSelectPartner() {
|
|
||||||
this.selectPartnerVisible = true;
|
|
||||||
},
|
|
||||||
handlePartnerSelected(partner) {
|
|
||||||
this.form.partnerName = partner.partnerName;
|
|
||||||
this.form.partnerCode = partner.partnerCode;
|
|
||||||
this.form.partnerUserName = partner.contactPerson;
|
|
||||||
this.form.level = partner.level;
|
|
||||||
this.form.partnerPhone = partner.contactPhone;
|
|
||||||
this.form.partnerEmail = partner.contactEmail;
|
|
||||||
this.selectPartnerVisible = false;
|
|
||||||
},
|
|
||||||
openSelectPeople() {
|
|
||||||
this.selectUserVisible = true;
|
|
||||||
},
|
|
||||||
handleUserSelected(user) {
|
|
||||||
this.form.dutyName = user.userName;
|
|
||||||
this.form.duty = user.userId;
|
|
||||||
this.form.dutyPhone = user.phonenumber;
|
|
||||||
this.form.dutyEmail = user.email;
|
|
||||||
this.selectUserVisible = false;
|
|
||||||
},
|
|
||||||
// 打开弹窗处理
|
|
||||||
handleOpen() {
|
handleOpen() {
|
||||||
this.reset();
|
this.reset();
|
||||||
if (this.isEdit) {
|
if (this.orderId) {
|
||||||
getOrder(this.orderId).then(response => {
|
getOrder(this.orderId).then(response => {
|
||||||
this.form = {...response.data.projectOrderInfo}
|
this.form = {...response.data.projectOrderInfo};
|
||||||
// 兼容版本号为空的情况
|
if (!this.form.versionCode) this.form.versionCode = 1;
|
||||||
if (!this.form.versionCode) {
|
|
||||||
this.form.versionCode = 1;
|
|
||||||
}
|
|
||||||
this.approveLogList = response.data.approveLog;
|
this.approveLogList = response.data.approveLog;
|
||||||
this.orderBakFile = response.data.orderBakFile || {};
|
this.orderBakFile = response.data.orderBakFile || {};
|
||||||
this.showFileFlag = response.data.showFileFlag || false;
|
this.showFileFlag = response.data.showFileFlag || false;
|
||||||
this.canUpdate = response.data.canUpdate || false; // 从 response.data 获取
|
|
||||||
this.uploadFinalFile = response.data.uploadFinalFile || false; // 从 response.data 获取
|
|
||||||
this.updateFile = response.data.updateFile || false; // 从 response.data 获取
|
|
||||||
|
|
||||||
// 如果合同信息为空,则手动构造一个空的结构
|
|
||||||
if (!this.form.contractTableData) {
|
|
||||||
this.form.contractTableData = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (!this.form.contractTableData) this.form.contractTableData = {};
|
||||||
const currentVersion = String(this.form.versionCode);
|
const currentVersion = String(this.form.versionCode);
|
||||||
if (!this.form.contractTableData[currentVersion]) {
|
if (!this.form.contractTableData[currentVersion]) {
|
||||||
this.$set(this.form.contractTableData, currentVersion, []);
|
this.$set(this.form.contractTableData, currentVersion, []);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add placeholders for uploading if permitted and not already present
|
if (this.uniqueVersions.length > 0) this.activeVersionTab = String(this.uniqueVersions[0]);
|
||||||
const files = this.form.contractTableData[currentVersion];
|
if (this.uniqueContractVersions.length > 0) this.activeContractVersionTab = String(this.uniqueContractVersions[0]);
|
||||||
const existingSorts = new Set(files.map(f => String(f.fileSort)));
|
|
||||||
|
|
||||||
if (this.canUpdate) {
|
|
||||||
if (!existingSorts.has('0')) files.push({id: -1, fileSort: 0});
|
|
||||||
if (!existingSorts.has('1')) files.push({id: -1, fileSort: 1});
|
|
||||||
if (!existingSorts.has('2')) files.push({id: -1, fileSort: 2});
|
|
||||||
}
|
|
||||||
if (this.uploadFinalFile) {
|
|
||||||
if (!existingSorts.has('3')) files.push({id: -1, fileSort: 3});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.uniqueVersions.length > 0) {
|
|
||||||
this.activeVersionTab = String(this.uniqueVersions[0]); // 默认显示最新版本
|
|
||||||
}
|
|
||||||
if (this.uniqueContractVersions.length > 0) {
|
|
||||||
this.activeContractVersionTab = String(this.uniqueContractVersions[0]); // 默认显示最新合同版本
|
|
||||||
}
|
|
||||||
// 手动触发联动
|
|
||||||
this.handleBgChange(this.form.bgProperty);
|
|
||||||
this.handleChannelChange(this.form.orderChannel);
|
|
||||||
|
|
||||||
|
|
||||||
// 重新设置付款方式,并触发其change事件以更新付款条件描述
|
|
||||||
if (response.data.projectOrderInfo.paymentMethod) {
|
|
||||||
this.form.paymentMethod = response.data.projectOrderInfo.paymentMethod;
|
|
||||||
this.handlePaymentMethodChange(response.data.projectOrderInfo.paymentMethod);
|
|
||||||
}
|
|
||||||
// 恢复原始的付款比例和付款条件,以防被 handlePaymentMethodChange 覆盖
|
|
||||||
if (response.data.projectOrderInfo.paymentRatio) {
|
|
||||||
this.form.paymentRatio = response.data.projectOrderInfo.paymentRatio;
|
|
||||||
}
|
|
||||||
if (response.data.projectOrderInfo.paymentDescription) {
|
|
||||||
this.form.paymentDescription = response.data.projectOrderInfo.paymentDescription;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
// 设置新增时的默认值
|
|
||||||
this.form.dutyName = this.$store.state.user.name;
|
|
||||||
this.form.dutyEmail = this.$store.state.user.email;
|
|
||||||
this.form.dutyPhone = this.$store.state.user.phonenumber;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 关闭弹窗
|
|
||||||
handleClose() {
|
handleClose() {
|
||||||
this.$emit('update:visible', false);
|
this.$emit('update:visible', false);
|
||||||
},
|
},
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
cancel() {
|
||||||
this.handleClose();
|
this.handleClose();
|
||||||
},
|
},
|
||||||
// 表单重置
|
|
||||||
reset() {
|
reset() {
|
||||||
this.form = {
|
this.form = {
|
||||||
id: null,
|
id: null, projectName: null, versionCode: 1, projectCode: null, customerName: null, bgProperty: null,
|
||||||
projectName: null,
|
industryType: null, agentName: null, businessPerson: null, businessEmail: null, businessPhone: null,
|
||||||
versionCode: 1,
|
orderCode: null, orderEndTime: null, currencyType: null, actualPurchaseAmount: null, shipmentAmount: null,
|
||||||
projectCode: null,
|
deliveryTime: null, companyDelivery: '0', orderChannel: null, supplier: null, dutyName: null,
|
||||||
customerName: null,
|
dutyEmail: null, dutyPhone: null, partnerName: null, level: null, partnerUserName: null, partnerEmail: null,
|
||||||
bgProperty: null,
|
partnerPhone: null, notifierAddress: null, notifier: null, notifierEmail: null, notifierPhone: null,
|
||||||
industryType: null,
|
paymentMethod: null, paymentRatio: 0, paymentDescription: null, remark: null,
|
||||||
agentName: null,
|
softwareProjectProductInfoList: [], hardwareProjectProductInfoList: [], maintenanceProjectProductInfoList: []
|
||||||
businessPerson: null,
|
|
||||||
businessEmail: null,
|
|
||||||
businessPhone: null,
|
|
||||||
orderCode: null,
|
|
||||||
orderEndTime: null,
|
|
||||||
currencyType: null,
|
|
||||||
actualPurchaseAmount: null,
|
|
||||||
shipmentAmount: null,
|
|
||||||
deliveryTime: null,
|
|
||||||
companyDelivery: '0',
|
|
||||||
orderChannel: null,
|
|
||||||
supplier: null,
|
|
||||||
dutyName: null,
|
|
||||||
dutyEmail: null,
|
|
||||||
dutyPhone: null,
|
|
||||||
partnerName: null,
|
|
||||||
level: null,
|
|
||||||
partnerUserName: null,
|
|
||||||
partnerEmail: null,
|
|
||||||
partnerPhone: null,
|
|
||||||
notifierAddress: null,
|
|
||||||
notifier: null,
|
|
||||||
notifierEmail: null,
|
|
||||||
notifierPhone: null,
|
|
||||||
paymentMethod: null,
|
|
||||||
paymentRatio: 0,
|
|
||||||
paymentDescription: null,
|
|
||||||
remark: null,
|
|
||||||
softwareProjectProductInfoList: [],
|
|
||||||
hardwareProjectProductInfoList: [],
|
|
||||||
maintenanceProjectProductInfoList: []
|
|
||||||
};
|
};
|
||||||
this.orderBakFile = {};
|
this.orderBakFile = {};
|
||||||
this.activeTab = 'basic';
|
this.activeTab = 'basic';
|
||||||
|
|
@ -712,118 +279,8 @@ export default {
|
||||||
this.showFileFlag = false;
|
this.showFileFlag = false;
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm() {
|
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
const action = this.isEdit ? updateOrder : addOrder;
|
|
||||||
action(this.form).then(response => {
|
|
||||||
this.msgSuccess(this.isEdit ? "修改成功" : "新增成功");
|
|
||||||
this.handleClose();
|
|
||||||
this.$emit('success');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** BG改变事件 */
|
|
||||||
handleBgChange(value) {
|
|
||||||
this.form.industryType = null;
|
|
||||||
const dictType = value === 'YYS' ? 'bg_yys' : 'bg_hysy';
|
|
||||||
getDicts(dictType).then(response => {
|
|
||||||
this.industryOptions = response.data;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 下单通路改变事件 */
|
|
||||||
handleChannelChange(value) {
|
|
||||||
this.form.supplier = value === '1' ? '广州佳都技术有限公司' : '紫光汇智信息技术有限公司';
|
|
||||||
this.form.paymentMethod = null;
|
|
||||||
this.form.paymentRatio = 0;
|
|
||||||
this.form.paymentDescription = null;
|
|
||||||
|
|
||||||
if (value === '1') { // 总代
|
|
||||||
this.paymentMethodOptions = [
|
|
||||||
{ label: '全款支付,无需预付款', value: '1-1' },
|
|
||||||
{ label: '全款支付,需单独备货生产,预付订单总货款百分比', value: '1-2' }
|
|
||||||
];
|
|
||||||
} else if (value === '2') { // 直签
|
|
||||||
this.paymentMethodOptions = [
|
|
||||||
{ label: '全款支付', value: '2-1' },
|
|
||||||
{ label: '全款支付,需单独备货生产,预付订单总货款百分比', value: '2-2' },
|
|
||||||
{ label: '商业汇票支付,预付订单总货款百分比', value: '2-3' }
|
|
||||||
];
|
|
||||||
} else {
|
|
||||||
this.paymentMethodOptions = [];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 付款方式改变事件 */
|
|
||||||
handlePaymentMethodChange(value) {
|
|
||||||
const descriptionTemplates = {
|
|
||||||
'1-2': '总代预付{ratio}%订单金额作为备货押金后开始备货生产,备货完成供货商发起付款通知后,总代需1个月内支付尾款完成提货,否则备货押金不予退还。',
|
|
||||||
'2-2': '进货商预付{ratio}%订单金额作为备货押金后开始备货生产,备货完成供货商发起付款通知后,进货商需3个工作日内付全部剩余款项,即可享受订单约定的现金折扣。',
|
|
||||||
'2-3': '进货商预付{ratio}%订单金额作为备货押金后开始备货生产,备货完成供货商发起付款通知后,供货商需在1个月内提交剩余款项额度的商业汇票完成提货,否则备货押金不予退还。'
|
|
||||||
};
|
|
||||||
|
|
||||||
let description = '';
|
|
||||||
let paymentRatio = 0;
|
|
||||||
|
|
||||||
switch (value) {
|
|
||||||
case '1-1':
|
|
||||||
description = '备货完成供货商发起付款通知后,总代按照订单金额支付全款。';
|
|
||||||
paymentRatio = 100;
|
|
||||||
break;
|
|
||||||
case '1-2':
|
|
||||||
paymentRatio = 30;
|
|
||||||
description = descriptionTemplates['1-2'].replace('{ratio}', paymentRatio);
|
|
||||||
break;
|
|
||||||
case '2-1':
|
|
||||||
description = '备货完成供货商发起付款通知后,进货商需3个工作日内付订单全部款项,即可享受订单约定的现金折扣。';
|
|
||||||
paymentRatio = 100;
|
|
||||||
break;
|
|
||||||
case '2-2':
|
|
||||||
paymentRatio = 30;
|
|
||||||
description = descriptionTemplates['2-2'].replace('{ratio}', paymentRatio);
|
|
||||||
break;
|
|
||||||
case '2-3':
|
|
||||||
paymentRatio = 30;
|
|
||||||
description = descriptionTemplates['2-3'].replace('{ratio}', paymentRatio);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.form.paymentDescription = description;
|
|
||||||
this.form.paymentRatio = paymentRatio;
|
|
||||||
},
|
|
||||||
/** 更新付款条件描述 */
|
|
||||||
updatePaymentDescription() {
|
|
||||||
const paymentMethod = this.form.paymentMethod;
|
|
||||||
const ratio = this.form.paymentRatio;
|
|
||||||
const descriptionTemplates = {
|
|
||||||
'1-2': '总代预付{ratio}%订单金额作为备货押金后开始备货生产,备货完成供货商发起付款通知后,总代需1个月内支付尾款完成提货,否则备货押金不予退还。',
|
|
||||||
'2-2': '进货商预付{ratio}%订单金额作为备货押金后开始备货生产,备货完成供货商发起付款通知后,进货商需3个工作日内付全部剩余款项,即可享受订单约定的现金折扣。',
|
|
||||||
'2-3': '进货商预付{ratio}%订单金额作为备货押金后开始备货生产,备货完成供货商发起付款通知后,供货商需在1个月内提交剩余款项额度的商业汇票完成提货,否则备货押金不予退还。'
|
|
||||||
};
|
|
||||||
if (descriptionTemplates[paymentMethod]) {
|
|
||||||
this.form.paymentDescription = descriptionTemplates[paymentMethod].replace('{ratio}', ratio);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 选择项目按钮操作 */
|
|
||||||
handleSelectProject() {
|
|
||||||
this.msgWarning("选择项目功能待实现");
|
|
||||||
},
|
|
||||||
/** 选择用户按钮操作 */
|
|
||||||
handleSelectUser() {
|
|
||||||
this.msgWarning("选择用户功能待实现");
|
|
||||||
},
|
|
||||||
/** 选择合作伙伴按钮操作 */
|
|
||||||
handleSelectPartner() {
|
|
||||||
this.msgWarning("选择合作伙伴功能待实现");
|
|
||||||
},
|
|
||||||
|
|
||||||
formatApproveStatus(status) {
|
formatApproveStatus(status) {
|
||||||
const statusMap = {
|
const statusMap = { '1': '提交审批', '2': '驳回', '3': '批准' };
|
||||||
'1': '提交审批',
|
|
||||||
'2': '驳回',
|
|
||||||
'3': '批准'
|
|
||||||
};
|
|
||||||
return statusMap[status] || '提交审批';
|
return statusMap[status] || '提交审批';
|
||||||
},
|
},
|
||||||
downloadTem() {
|
downloadTem() {
|
||||||
|
|
@ -831,86 +288,27 @@ export default {
|
||||||
this.$modal.alertWarning("请先选择下单通路");
|
this.$modal.alertWarning("请先选择下单通路");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const orderId = this.form.id;
|
window.location.href = process.env.VUE_APP_BASE_API + `/project/order/contract/export?orderId=${this.form.id}`;
|
||||||
window.location.href = process.env.VUE__APP_BASE_API + `/project/order/contract/export?orderId=${orderId}`;
|
|
||||||
},
|
},
|
||||||
previewFile(filePath, fileName) {
|
previewFile(filePath, fileName) {
|
||||||
if (filePath.endsWith(".png") || filePath.endsWith(".jpg") || filePath.endsWith(".jpeg") || filePath.endsWith(".pdf")) {
|
|
||||||
const url = process.env.VUE_APP_BASE_API + `/project/order/file/view?filePath=${encodeURIComponent(filePath)}&fileName=${encodeURIComponent(fileName)}`;
|
const url = process.env.VUE_APP_BASE_API + `/project/order/file/view?filePath=${encodeURIComponent(filePath)}&fileName=${encodeURIComponent(fileName)}`;
|
||||||
window.open(url);
|
window.open(url);
|
||||||
} else {
|
|
||||||
this.downFile(filePath, fileName);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
downFile(filePath, fileName) {
|
downFile(filePath, fileName) {
|
||||||
window.location.href = process.env.VUE_APP_BASE_API + `/project/order/file/download?filePath=${encodeURIComponent(filePath)}&fileName=${encodeURIComponent(fileName)}`;
|
window.location.href = process.env.VUE_APP_BASE_API + `/project/order/file/download?filePath=${encodeURIComponent(filePath)}&fileName=${encodeURIComponent(fileName)}`;
|
||||||
},
|
|
||||||
handleUploadFile(event) {
|
|
||||||
const file = event.target.files[0];
|
|
||||||
if (!file) return;
|
|
||||||
|
|
||||||
const formData = new FormData();
|
|
||||||
formData.append('file', file);
|
|
||||||
formData.append('orderId', this.form.id);
|
|
||||||
formData.append('versionCode', this.form.versionCode);
|
|
||||||
formData.append('fileSort', this.fileSort);
|
|
||||||
|
|
||||||
uploadContractFile(formData).then(response => {
|
|
||||||
this.$modal.msgSuccess('导入成功');
|
|
||||||
this.addFile(response.data);
|
|
||||||
// 清空文件输入框,以便再次上传相同文件
|
|
||||||
event.target.value = '';
|
|
||||||
}).catch(() => {
|
|
||||||
this.$modal.msgError('导入失败');
|
|
||||||
event.target.value = '';
|
|
||||||
});
|
|
||||||
},
|
|
||||||
importList(sortNum) {
|
|
||||||
this.fileSort = sortNum;
|
|
||||||
if (sortNum === 0) {
|
|
||||||
document.getElementById('uploadInput').click();
|
|
||||||
} else if (sortNum === 1) {
|
|
||||||
document.getElementById('uploadInput1').click();
|
|
||||||
} else {
|
|
||||||
document.getElementById('uploadInput2').click();
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
addFile(data) {
|
|
||||||
const sortNum = data.fileSort;
|
|
||||||
if (!this.groupedContractFiles[String(this.form.versionCode)]) {
|
|
||||||
this.$set(this.groupedContractFiles, String(this.form.versionCode), {files: [], bakFile: null});
|
|
||||||
}
|
|
||||||
const currentVersionFiles = this.groupedContractFiles[String(this.form.versionCode)].files;
|
|
||||||
const fileIndex = currentVersionFiles.findIndex(file => file.fileSort === sortNum);
|
|
||||||
|
|
||||||
if (fileIndex !== -1) {
|
|
||||||
this.$set(currentVersionFiles, fileIndex, data);
|
|
||||||
} else {
|
|
||||||
currentVersionFiles.push(data);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
delUploadRow(sortNum, id) {
|
|
||||||
this.$modal.confirm("确定删除该文件吗?").then(() => {
|
|
||||||
delContractFile(id).then(() => {
|
|
||||||
this.$modal.msgSuccess("删除成功");
|
|
||||||
// 找到当前版本的文件列表并更新
|
|
||||||
const currentVersionFiles = this.groupedContractFiles[String(this.activeContractVersionTab)].files;
|
|
||||||
const fileIndex = currentVersionFiles.findIndex(file => file.id === id);
|
|
||||||
if (fileIndex !== -1) {
|
|
||||||
this.$set(currentVersionFiles, fileIndex, {
|
|
||||||
id: -1,
|
|
||||||
fileSort: sortNum,
|
|
||||||
fileName: this.file_log_arr[sortNum],
|
|
||||||
uploadUserName: '',
|
|
||||||
uploadTime: '',
|
|
||||||
filePath: ''
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}).catch(() => {
|
|
||||||
this.$modal.msgError("删除失败");
|
|
||||||
});
|
|
||||||
}).catch(() => {});
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.el-form-item .el-select,
|
||||||
|
.el-form-item .el-date-picker {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.dialog-footer {
|
||||||
|
text-align: right;
|
||||||
|
padding: 10px 20px;
|
||||||
|
border-top: 1px solid #ebeef5;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue