|
@@ -5,9 +5,10 @@
|
|
|
<div>
|
|
|
<el-button type="primary" v-if="
|
|
|
[30].includes(route.query.processType) || !route.query.processType
|
|
|
- " @click="clickCopy(1)">复制合同</el-button>
|
|
|
+ " @click="clickCopy(1)">复制订单</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
+
|
|
|
<template #ofCompanyId>
|
|
|
<div style="width: 100%">
|
|
|
<el-form-item label="业务公司" class="margin-b-0 wid100" required>
|
|
@@ -23,8 +24,8 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item prop="deptId" label="" label-width="0px" class="margin-b-0 wid100">
|
|
|
<el-tree-select v-model="formData.data.deptId" :data="deptData" style="width: 100%" placeholder="部门" default-expand-all
|
|
|
- :props="{ value: 'deptId', label: 'deptName', children: 'children', disabled: 'disabled' }"
|
|
|
- :disabled="useUserStore().currentCompany==useUserStore().user.ofCompanyId" />
|
|
|
+ :props="{ value: 'deptId', label: 'deptName', children: 'children', disabled: 'disabled' }" />
|
|
|
+ <!-- :disabled="useUserStore().currentCompany==useUserStore().user.ofCompanyId" -->
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
@@ -32,6 +33,7 @@
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</template>
|
|
|
+
|
|
|
<template #seller>
|
|
|
<div style="width: 100%">
|
|
|
<el-form-item prop="sellCorporationId" label="卖方信息" class="wid100">
|
|
@@ -150,6 +152,29 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
+ <template #advanceRatio>
|
|
|
+ <el-row style="width: 100%">
|
|
|
+ <el-col :span="6" style="padding-right:8px">
|
|
|
+ <el-form-item label="定金比例(%)" prop="advanceRatio" class="margin-b-0 wid100">
|
|
|
+ <el-input-number v-model="formData.data.advanceRatio" placeholder="请输入" style="width: 100%" :precision="2" :min="0" :max="100"
|
|
|
+ :controls="false" @change="(val)=>changeAdvanceRatio(val,true)" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" style="padding:0px 4px">
|
|
|
+ <el-form-item label="出货前付款比例" prop="beforeShipmentRatio" class="margin-b-0 wid100">
|
|
|
+ <el-input-number v-model="formData.data.beforeShipmentRatio" placeholder="请输入" style="width: 100%" :precision="2" :min="0" :max="100"
|
|
|
+ :controls="false" @change="(val)=>changeAdvanceRatio(val,false)" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" style="padding:0px 4px">
|
|
|
+ <el-form-item label="出货后付款比例" prop="afterShipmentRatio" class="margin-b-0 wid100">
|
|
|
+ <el-input-number v-model="formData.data.afterShipmentRatio" placeholder=" " style="width: 100%" :precision="2" :min="0" :max="100"
|
|
|
+ :controls="false" disabled />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </template>
|
|
|
+
|
|
|
<template #commodity>
|
|
|
<div style="width: 100%">
|
|
|
<el-button type="primary" @click="openProductCompany = true" plain style="margin-bottom: 16px" v-if="!judgeStatus() && isEditList"
|
|
@@ -235,38 +260,102 @@
|
|
|
<div v-else></div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="productCnName" label="商品名称" min-width="130" />
|
|
|
- <el-table-column prop="productCode" label="商品编码" width="150" />
|
|
|
- <el-table-column label="规格尺寸 (cm)" width="130">
|
|
|
+ <el-table-column prop="productName" label="商品信息" width="250">
|
|
|
<template #default="{ row, $index }">
|
|
|
- <div style="width: 100%">
|
|
|
- {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
|
|
|
+ <div style="width: 100%;line-height:22px">
|
|
|
+ <div>
|
|
|
+ 分类:{{row.productClassifyName}}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 编码:{{row.productCode}}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 名称:{{row.productName}}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 规格尺寸 (cm): {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 颜色:{{row.productColor}}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 纹路:{{dictKeyValue(row.productFrontalTexture,frontLinesData)}}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 净重: {{row.productNetWeight}}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 单位:{{row.productUnit}}
|
|
|
+ </div>
|
|
|
+ <!-- <el-row :gutter="5">
|
|
|
+ <el-col :span="12">
|
|
|
+ 分类:{{row.productClassifyName}}
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ 编码名称:{{row.productCode}}({{row.productName}})
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="5">
|
|
|
+ <el-col :span="12">
|
|
|
+ 规格尺寸 (cm): {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ 颜色:{{row.productColor}}
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="5">
|
|
|
+ <el-col :span="12">
|
|
|
+ 纹路:{{dictKeyValue(row.productFrontalTexture,frontLinesData)}}
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ 净重: {{row.productNetWeight}}
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ 单位:{{row.productUnit}}
|
|
|
+ </el-col>
|
|
|
+ </el-row> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="productColor" label="颜色" width="140" />
|
|
|
- <!-- <el-table-column label="设计图稿" width="80">
|
|
|
+
|
|
|
+ <!-- <el-table-column label="规格尺寸 (cm)" width="130">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
- <el-upload :action="uploadUrl" accept=".gif, .jpeg, .jpg, .png" :show-file-list="false" :data="uploadData"
|
|
|
- :before-upload="(file)=>handleBeforeUpload(file,$index)" :on-success="()=>handleSuccess($index)">
|
|
|
- <div v-loading="row.imgLoading">
|
|
|
- <img v-if="row.imageUrl" :src="row.imageUrl" class="pic" />
|
|
|
- <el-icon v-else class="avatar-uploader-icon">
|
|
|
- <Plus />
|
|
|
- </el-icon>
|
|
|
- </div>
|
|
|
- </el-upload>
|
|
|
+ {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
|
|
|
</div>
|
|
|
</template>
|
|
|
- </el-table-column> -->
|
|
|
- <el-table-column label="生产plt文件" width="210">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="productColor" label="颜色" width="140" />
|
|
|
+ <el-table-column prop="ww" label="纹路" width="140" />
|
|
|
+ <el-table-column prop="weight" label="净重" width="140" />
|
|
|
+ <el-table-column prop="unit" label="单位" width="140" /> -->
|
|
|
+ <el-table-column label="生产plt文件" width="180">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width:100%">
|
|
|
- <div style="display:flex">
|
|
|
- <div style="writing-mode: vertical-rl;margin-right:10px;background:rgb(94 120 145);color:#fff;padding:5px 2px;border-radius:3px;line-height:21px;cursor:pointer"
|
|
|
+ <!-- <div style="display:flex">
|
|
|
+ <div style="writing-mode: vertical-rl;margin-right:10px;background:rgb(94 120 145);color:#fff;padding:5px 2px;border-radius:3px;line-height:21px;;cursor:pointer"
|
|
|
+ @click="handleClickUploadOne($index)" v-if="!judgeStatus()">
|
|
|
+ {{row.isShowProductFile?'上 传 p l t':'取 消 上 传'}}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <div v-if="row.isShowProductFile &&row.fileListOne && row.fileListOne.length > 0">
|
|
|
+ <span class="el-click" @click="onPicture(row.fileListOne[0].fileUrl)">{{row.fileListOne[0].fileName}}</span>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ <el-upload :file-list="row.prodFileList" :action="uploadUrl" :data="uploadData" :limit="1" :list-type="'text'"
|
|
|
+ :before-upload="(file)=>handleBeforeUploadOne(file,$index)" :on-success="()=>handleSuccessOne($index)"
|
|
|
+ :on-remove="(file)=>handleRemoveFile(file,$index)" :on-preview="onPreviewFile"
|
|
|
+ :on-exceed="()=>msgTip(`上传文件数量不可大于1`, 2)">
|
|
|
+ <el-button text type="primary">上传</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div> -->
|
|
|
+ <div>
|
|
|
+ <!-- writing-mode: vertical-rl; 文字垂直排 -->
|
|
|
+ <div style="margin-right:10px;background:rgb(94 120 145);color:#fff;padding:5px 2px;border-radius:3px;line-height:21px;;cursor:pointer;width:60px;text-align:center"
|
|
|
@click="handleClickUploadOne($index)" v-if="!judgeStatus()">
|
|
|
- {{row.isShowProductFile?'上 传 文 件':'取 消 上 传'}}
|
|
|
+ {{row.isShowProductFile?'上传plt':'取消上传'}}
|
|
|
</div>
|
|
|
<div>
|
|
|
<div v-if="row.isShowProductFile &&row.fileListOne && row.fileListOne.length > 0">
|
|
@@ -291,7 +380,7 @@
|
|
|
<el-form-item :prop="'contractProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
|
|
|
class="margin-b-0 wid100">
|
|
|
<el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
|
|
|
- :controls="false" :min="0" @change="calculationAmount('quantity')" v-if="isEditList" />
|
|
|
+ :controls="false" :min="0" @change="calculationAmount()" v-if="isEditList" />
|
|
|
<div v-else> {{row.quantity}}</div>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
@@ -355,6 +444,8 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="出厂单价" prop="factoryPrice" width="100">
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="amount" label="小计" width="110">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
@@ -362,6 +453,13 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column prop="amountTwo" label="出厂小计金额" width="110">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ ¥ {{row.amountTwo}}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="备注" min-width="200">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
@@ -446,7 +544,7 @@
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <!-- <el-dialog v-if="copyContract" v-model="copyContract" :title="copyType === 1 ? '合同选择' : '样品单选择'" width="90%" append-to-body>
|
|
|
+ <!-- <el-dialog v-if="copyContract" v-model="copyContract" :title="copyType === 1 ? '订单选择' : '样品单选择'" width="90%" append-to-body>
|
|
|
<SelectContract @select="selectContract" v-if="copyType === 1"></SelectContract>
|
|
|
<SelectSample @select="selectContract" v-if="copyType === 2"></SelectSample>
|
|
|
</el-dialog> -->
|
|
@@ -481,6 +579,21 @@ const fundsPaymentMethod = computed(
|
|
|
const shippingMethod = computed(
|
|
|
() => proxy.useUserStore().allDict["shipping_method"]
|
|
|
);
|
|
|
+const contractChannel = computed(
|
|
|
+ () => proxy.useUserStore().allDict["contract_channel"]
|
|
|
+);
|
|
|
+const taxTransportationWay = computed(
|
|
|
+ () => proxy.useUserStore().allDict["tax_transportation_way"]
|
|
|
+);
|
|
|
+const shopName = computed(() => proxy.useUserStore().allDict["shop_name"]);
|
|
|
+
|
|
|
+const taxPoints = computed(() => proxy.useUserStore().allDict["tax_points"]);
|
|
|
+const settlementWay = computed(
|
|
|
+ () => proxy.useUserStore().allDict["settlement_way"]
|
|
|
+);
|
|
|
+const frontLinesData = computed(
|
|
|
+ () => proxy.useUserStore().allDict["front_lines"]
|
|
|
+);
|
|
|
const companyId = computed(() => proxy.useUserStore().user.companyId);
|
|
|
const accountList = ref([]);
|
|
|
const customerList = ref([]);
|
|
@@ -505,6 +618,8 @@ const formData = reactive({
|
|
|
contractProductList: [],
|
|
|
companyId: "",
|
|
|
templateContent: "",
|
|
|
+ contractChannel: "",
|
|
|
+ paymentMethod: "",
|
|
|
},
|
|
|
});
|
|
|
const uploadData = ref({});
|
|
@@ -550,7 +665,7 @@ const formConfig = computed(() => {
|
|
|
{
|
|
|
type: "input",
|
|
|
prop: "code",
|
|
|
- label: "合同号",
|
|
|
+ label: "订单号",
|
|
|
disabled: true,
|
|
|
isShow: formData.data.code ? true : false,
|
|
|
},
|
|
@@ -613,8 +728,7 @@ const formConfig = computed(() => {
|
|
|
propsTreeLabel: "deptName",
|
|
|
propsTreeValue: "deptId",
|
|
|
itemWidth: 50,
|
|
|
- disabled:
|
|
|
- !isEditList.value || route.query.flowKey == "contract_update_flow",
|
|
|
+ disabled: !isEditList.value,
|
|
|
fn: () => {
|
|
|
formData.data.contractProductList = [];
|
|
|
},
|
|
@@ -637,6 +751,31 @@ const formConfig = computed(() => {
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
|
+ prop: "contractChannel",
|
|
|
+ label: "订单渠道",
|
|
|
+ data: contractChannel.value,
|
|
|
+ itemWidth: 50,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "channelCode",
|
|
|
+ label: "渠道订单编号",
|
|
|
+ itemWidth: 50,
|
|
|
+ isShow:
|
|
|
+ formData.data.contractChannel &&
|
|
|
+ formData.data.contractChannel.includes("阿里巴巴")
|
|
|
+ ? true
|
|
|
+ : false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "salesmanId",
|
|
|
+ label: "业务员",
|
|
|
+ data: userList.value,
|
|
|
+ itemWidth: 50,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
prop: "merchUserId",
|
|
|
label: "跟单员",
|
|
|
data: userList.value,
|
|
@@ -700,6 +839,14 @@ const formConfig = computed(() => {
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
|
+ prop: "taxPoints",
|
|
|
+ label: "税点",
|
|
|
+ data: taxPoints.value,
|
|
|
+ itemWidth: 25,
|
|
|
+ isShow: formData.data.isTax && formData.data.isTax == "1" ? true : false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
prop: "isFreight",
|
|
|
label: "是否含运费",
|
|
|
data: [
|
|
@@ -714,40 +861,179 @@ const formConfig = computed(() => {
|
|
|
],
|
|
|
itemWidth: 25,
|
|
|
},
|
|
|
+ // {
|
|
|
+ // type: "select",
|
|
|
+ // prop: "rr",
|
|
|
+ // label: "结算方式",
|
|
|
+ // data: settlementWay.value,
|
|
|
+ // itemWidth: 25,
|
|
|
+ // },
|
|
|
{
|
|
|
type: "select",
|
|
|
prop: "paymentMethod",
|
|
|
- label: "付款方式",
|
|
|
+ label: "客户付款方式",
|
|
|
data: fundsPaymentMethod.value,
|
|
|
itemWidth: 25,
|
|
|
},
|
|
|
+ // {
|
|
|
+ // type: "select",
|
|
|
+ // prop: "paymentMethod",
|
|
|
+ // label: "付款方式",
|
|
|
+ // data: fundsPaymentMethod.value,
|
|
|
+ // itemWidth: 25,
|
|
|
+ // },
|
|
|
{
|
|
|
- type: "number",
|
|
|
- prop: "advanceRatio",
|
|
|
- label: "预付款比列(%)",
|
|
|
- precision: 2,
|
|
|
- min: 0,
|
|
|
- controls: false,
|
|
|
+ type: "input",
|
|
|
+ prop: "alibabaCode",
|
|
|
+ label: "阿里巴巴订单编号",
|
|
|
+ itemType: "text",
|
|
|
itemWidth: 25,
|
|
|
+ isShow:
|
|
|
+ formData.data.paymentMethod &&
|
|
|
+ formData.data.paymentMethod.includes("阿里巴巴")
|
|
|
+ ? true
|
|
|
+ : false,
|
|
|
},
|
|
|
{
|
|
|
- type: "input",
|
|
|
- prop: "remark",
|
|
|
- label: "付款条件",
|
|
|
- itemType: "textarea",
|
|
|
- itemWidth: 50,
|
|
|
+ type: "select",
|
|
|
+ prop: "alibabaShopName",
|
|
|
+ label: "1688店铺名称",
|
|
|
+ data: shopName.value,
|
|
|
+ itemWidth: 25,
|
|
|
+ isShow:
|
|
|
+ formData.data.paymentMethod &&
|
|
|
+ formData.data.paymentMethod.includes("阿里巴巴")
|
|
|
+ ? true
|
|
|
+ : false,
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
|
prop: "shroffAccountId",
|
|
|
- label: "收款账号",
|
|
|
+ label: "付款账号",
|
|
|
data: accountList.value,
|
|
|
- itemWidth: 100,
|
|
|
+ itemWidth: 50,
|
|
|
fn: (val) => {
|
|
|
changeShroffAccount(val);
|
|
|
},
|
|
|
+ isShow: formData.data.paymentMethod == "bank1",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "accountName",
|
|
|
+ label: "户名",
|
|
|
+ placeholder: "请输入户名",
|
|
|
+ itemWidth: 50,
|
|
|
+ isShow:
|
|
|
+ formData.data.paymentMethod &&
|
|
|
+ formData.data.paymentMethod.includes("bank")
|
|
|
+ ? true
|
|
|
+ : false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "openingBank",
|
|
|
+ label: "开户行",
|
|
|
+ placeholder: "请输入开户行",
|
|
|
+ itemWidth: 50,
|
|
|
+ isShow:
|
|
|
+ formData.data.paymentMethod &&
|
|
|
+ formData.data.paymentMethod.includes("bank")
|
|
|
+ ? true
|
|
|
+ : false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "accountOpening",
|
|
|
+ label: "账号",
|
|
|
+ placeholder: "请输入账号",
|
|
|
+ itemWidth: 50,
|
|
|
+ isShow:
|
|
|
+ formData.data.paymentMethod &&
|
|
|
+ (formData.data.paymentMethod.includes("bank") ||
|
|
|
+ ["wxPay", "aliPay"].includes(formData.data.paymentMethod))
|
|
|
+ ? true
|
|
|
+ : false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "remark",
|
|
|
+ label: "其他收款方式备注说明",
|
|
|
+ itemType: "textarea",
|
|
|
+ itemWidth: 100,
|
|
|
+ isShow:
|
|
|
+ formData.data.paymentMethod &&
|
|
|
+ !["bank", "bank1", "阿里巴巴", "wxPay", "aliPay"].includes(
|
|
|
+ formData.data.paymentMethod
|
|
|
+ )
|
|
|
+ ? true
|
|
|
+ : false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "advanceRatio",
|
|
|
+ prop: "",
|
|
|
+ label: "",
|
|
|
},
|
|
|
// {
|
|
|
+ // type: "number",
|
|
|
+ // prop: "advanceRatio",
|
|
|
+ // label: "定金比例",
|
|
|
+ // precision: 2,
|
|
|
+ // min: 0,
|
|
|
+ // max: 100,
|
|
|
+ // controls: false,
|
|
|
+ // itemWidth: 25,
|
|
|
+ // fn: (val) => {
|
|
|
+ // if (val && formData.data.beforeShipmentRatio) {
|
|
|
+ // let total = val + formData.data.beforeShipmentRatio;
|
|
|
+ // if (total > 100) {
|
|
|
+ // formData.data.advanceRatio = null;
|
|
|
+ // formData.data.beforeShipmentRatio = null;
|
|
|
+ // }
|
|
|
+ // formData.data.afterShipmentRatio = 100 - total;
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // type: "number",
|
|
|
+ // prop: "beforeShipmentRatio",
|
|
|
+ // label: "出货前付款⽐例",
|
|
|
+ // precision: 2,
|
|
|
+ // min: 0,
|
|
|
+ // max: 100,
|
|
|
+ // controls: false,
|
|
|
+ // itemWidth: 25,
|
|
|
+ // fn: (val) => {
|
|
|
+ // if (val && formData.data.advanceRatio) {
|
|
|
+ // let total = val + formData.data.advanceRatio;
|
|
|
+ // if (total > 100) {
|
|
|
+ // formData.data.advanceRatio = null;
|
|
|
+ // formData.data.beforeShipmentRatio = null;
|
|
|
+ // }
|
|
|
+ // formData.data.afterShipmentRatio = 100 - total;
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // type: "number",
|
|
|
+ // prop: "afterShipmentRatio",
|
|
|
+ // label: "出货后尾款⽐例",
|
|
|
+ // precision: 2,
|
|
|
+ // min: 0,
|
|
|
+ // max: 100,
|
|
|
+ // controls: false,
|
|
|
+ // itemWidth: 25,
|
|
|
+ // disabled: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // type: "input",
|
|
|
+ // prop: "remark",
|
|
|
+ // label: "付款条件",
|
|
|
+ // itemType: "textarea",
|
|
|
+ // itemWidth: 100,
|
|
|
+ // },
|
|
|
+
|
|
|
+ // {
|
|
|
// type: "input",
|
|
|
// prop: "beneficiaryName",
|
|
|
// label: " ",
|
|
@@ -795,30 +1081,7 @@ const formConfig = computed(() => {
|
|
|
// itemWidth: 50,
|
|
|
// isShow: formData.data.contractType == "1",
|
|
|
// },
|
|
|
- {
|
|
|
- type: "input",
|
|
|
- prop: "accountName",
|
|
|
- label: "户名",
|
|
|
- placeholder: "请输入户名",
|
|
|
- itemWidth: 50,
|
|
|
- // isShow: formData.data.contractType == "2",
|
|
|
- },
|
|
|
- {
|
|
|
- type: "input",
|
|
|
- prop: "openingBank",
|
|
|
- label: "开户行",
|
|
|
- placeholder: "请输入开户行",
|
|
|
- itemWidth: 50,
|
|
|
- // isShow: formData.data.contractType == "2",
|
|
|
- },
|
|
|
- {
|
|
|
- type: "input",
|
|
|
- prop: "accountOpening",
|
|
|
- label: "账号",
|
|
|
- placeholder: "请输入账号",
|
|
|
- itemWidth: 50,
|
|
|
- // isShow: formData.data.contractType == "2",
|
|
|
- },
|
|
|
+
|
|
|
// {
|
|
|
// type: "slot",
|
|
|
// slotName: "payment",
|
|
@@ -831,6 +1094,14 @@ const formConfig = computed(() => {
|
|
|
},
|
|
|
{
|
|
|
type: "date",
|
|
|
+ itemType: "date",
|
|
|
+ prop: "saleDate",
|
|
|
+ label: "销售日期",
|
|
|
+ itemWidth: 50,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "date",
|
|
|
+ itemType: "date",
|
|
|
prop: "deliveryTime",
|
|
|
label: "交货期限",
|
|
|
itemWidth: 50,
|
|
@@ -843,6 +1114,13 @@ const formConfig = computed(() => {
|
|
|
itemWidth: 50,
|
|
|
},
|
|
|
// {
|
|
|
+ // type: "select",
|
|
|
+ // prop: "taxTransportationWay",
|
|
|
+ // label: "税运方式",
|
|
|
+ // data: taxTransportationWay.value,
|
|
|
+ // itemWidth: 50,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
// type: "input",
|
|
|
// prop: "transportRemark",
|
|
|
// label: "运输说明",
|
|
@@ -875,25 +1153,39 @@ const formConfig = computed(() => {
|
|
|
},
|
|
|
{
|
|
|
type: "title",
|
|
|
- title: "合同总金额",
|
|
|
+ title: "订单总金额",
|
|
|
haveLine: true,
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|
|
|
prop: "amount",
|
|
|
- label: "合同总金额",
|
|
|
+ label: "订单总⾦额",
|
|
|
+ itemWidth: 25,
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "factoryAmount",
|
|
|
+ label: "出⼚总⾦额",
|
|
|
+ itemWidth: 25,
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "grossProfit",
|
|
|
+ label: "合计⽑利",
|
|
|
itemWidth: 25,
|
|
|
disabled: true,
|
|
|
},
|
|
|
{
|
|
|
type: "title",
|
|
|
- title: "合同模板",
|
|
|
+ title: "订单模板",
|
|
|
haveLine: true,
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
|
prop: "contractTemplateId",
|
|
|
- label: "合同模板",
|
|
|
+ label: "订单模板",
|
|
|
data: templateList.value,
|
|
|
itemWidth: 50,
|
|
|
fn: (val) => {
|
|
@@ -913,6 +1205,7 @@ const formConfig = computed(() => {
|
|
|
},
|
|
|
];
|
|
|
});
|
|
|
+
|
|
|
const rules = ref({
|
|
|
ofCompanyId: [
|
|
|
{ required: true, message: "请选择业务公司", trigger: "change" },
|
|
@@ -929,6 +1222,7 @@ const rules = ref({
|
|
|
{ required: true, message: "请选择订单归属", trigger: "change" },
|
|
|
],
|
|
|
merchUserId: [{ required: true, message: "请选择跟单员", trigger: "change" }],
|
|
|
+ salesmanId: [{ required: true, message: "请选择业务员", trigger: "change" }],
|
|
|
isTax: [{ required: true, message: "请选择是否含税", trigger: "change" }],
|
|
|
isFreight: [
|
|
|
{ required: true, message: "请选择是否含运费", trigger: "change" },
|
|
@@ -963,7 +1257,9 @@ const rules = ref({
|
|
|
transportMethod: [
|
|
|
{ required: true, message: "请选择运输方式", trigger: "change" },
|
|
|
],
|
|
|
- // remark: [{ required: true, message: "请输入付款条件", trigger: "blur" }],
|
|
|
+ remark: [
|
|
|
+ { required: true, message: "请输入其他收款方式备注说明", trigger: "blur" },
|
|
|
+ ],
|
|
|
rate: [{ required: true, message: "请输入汇率", trigger: "blur" }],
|
|
|
shroffAccountId: [
|
|
|
{ required: true, message: "请选择收款账号", trigger: "change" },
|
|
@@ -974,6 +1270,29 @@ const rules = ref({
|
|
|
templateContent: [
|
|
|
{ required: true, message: "请输入模板内容", trigger: "blur" },
|
|
|
],
|
|
|
+ contractChannel: [
|
|
|
+ { required: true, message: "请选择订单渠道", trigger: "change" },
|
|
|
+ ],
|
|
|
+ channelCode: [
|
|
|
+ { required: true, message: "请输入订单渠道编号", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ saleDate: [{ required: true, message: "请选择销售日期", trigger: "change" }],
|
|
|
+ taxTransportationWay: [
|
|
|
+ { required: true, message: "请选择税运方式", trigger: "change" },
|
|
|
+ ],
|
|
|
+ beforeShipmentRatio: [
|
|
|
+ { required: true, message: "请输入出货前付款比例", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ afterShipmentRatio: [
|
|
|
+ { required: true, message: "请输入出货后付款比例", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ taxPoints: [{ required: true, message: "请选择税点", trigger: "change" }],
|
|
|
+ alibabaCode: [
|
|
|
+ { required: true, message: "请输入阿里巴巴编号", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ alibabaShopName: [
|
|
|
+ { required: true, message: "请选择1688店铺名称", trigger: "change" },
|
|
|
+ ],
|
|
|
});
|
|
|
const getDict = () => {
|
|
|
proxy
|
|
@@ -1176,6 +1495,35 @@ const changeCustomer = (val) => {
|
|
|
formData.data.buyAddress = "";
|
|
|
}
|
|
|
};
|
|
|
+const changeAdvanceRatio = (val, flag) => {
|
|
|
+ if (flag) {
|
|
|
+ let total = Number(
|
|
|
+ parseFloat(val + Number(formData.data.beforeShipmentRatio)).toFixed(2)
|
|
|
+ );
|
|
|
+ if (total > 100) {
|
|
|
+ formData.data.advanceRatio = null;
|
|
|
+ formData.data.beforeShipmentRatio = null;
|
|
|
+ formData.data.afterShipmentRatio = null;
|
|
|
+ } else {
|
|
|
+ formData.data.afterShipmentRatio = Number(
|
|
|
+ parseFloat(100 - total).toFixed(2)
|
|
|
+ );
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ let total = Number(
|
|
|
+ parseFloat(val + Number(formData.data.advanceRatio)).toFixed(2)
|
|
|
+ );
|
|
|
+ if (total > 100) {
|
|
|
+ formData.data.advanceRatio = null;
|
|
|
+ formData.data.beforeShipmentRatio = null;
|
|
|
+ formData.data.afterShipmentRatio = null;
|
|
|
+ } else {
|
|
|
+ formData.data.afterShipmentRatio = Number(
|
|
|
+ parseFloat(100 - total).toFixed(2)
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
const createFilter = (queryString) => {
|
|
|
return (restaurant) => {
|
|
|
return (
|
|
@@ -1243,15 +1591,20 @@ const selectProduct = async (goods) => {
|
|
|
formData.data.contractProductList.push({
|
|
|
fileUrl: fileUrl,
|
|
|
productId: goods.id,
|
|
|
- productCnName: goods.name,
|
|
|
+ productClassifyName: goods.classifyName,
|
|
|
+ productName: goods.name,
|
|
|
productCode: goods.customCode,
|
|
|
productLength: goods["length"],
|
|
|
productWidth: goods.width,
|
|
|
productHeight: goods.height,
|
|
|
productColor: goods.color,
|
|
|
+ productNetWeight: goods.netWeight,
|
|
|
+ productUnit: goods.unit,
|
|
|
+ productFrontalTexture: goods.frontalTexture,
|
|
|
prodFilePath: goods.prodFilePath,
|
|
|
quantity: null,
|
|
|
price: goods.price || null,
|
|
|
+ factoryPrice: goods.factoryPrice || null,
|
|
|
amount: "",
|
|
|
remark: "",
|
|
|
fileList: [],
|
|
@@ -1312,6 +1665,7 @@ const selectMaterial = (goods) => {
|
|
|
};
|
|
|
|
|
|
const changeProductPrice = () => {
|
|
|
+ return;
|
|
|
let productIds = formData.data.contractProductList.map((x) => x.productId);
|
|
|
if (productIds && productIds.length > 0) {
|
|
|
proxy
|
|
@@ -1374,29 +1728,28 @@ const handleDeleteMaterial = (index, sonIndex) => {
|
|
|
);
|
|
|
};
|
|
|
|
|
|
-const calculationAmount = (att = "") => {
|
|
|
- nextTick(() => {
|
|
|
- if (
|
|
|
- formData.data.contractProductList &&
|
|
|
- formData.data.contractProductList.length > 0
|
|
|
- ) {
|
|
|
- for (let i = 0; i < formData.data.contractProductList.length; i++) {
|
|
|
- let money = 0;
|
|
|
- money = parseFloat(
|
|
|
- Number(formData.data.contractProductList[i].quantity) *
|
|
|
- Number(formData.data.contractProductList[i].price)
|
|
|
- ).toFixed(2);
|
|
|
- formData.data.contractProductList[i].amount = money;
|
|
|
- }
|
|
|
+const calculationAmount = () => {
|
|
|
+ if (
|
|
|
+ formData.data.contractProductList &&
|
|
|
+ formData.data.contractProductList.length > 0
|
|
|
+ ) {
|
|
|
+ for (let i = 0; i < formData.data.contractProductList.length; i++) {
|
|
|
+ formData.data.contractProductList[i].amount = parseFloat(
|
|
|
+ Number(formData.data.contractProductList[i].quantity) *
|
|
|
+ Number(formData.data.contractProductList[i].price)
|
|
|
+ ).toFixed(2);
|
|
|
+ formData.data.contractProductList[i].amountTwo = parseFloat(
|
|
|
+ Number(formData.data.contractProductList[i].quantity) *
|
|
|
+ Number(formData.data.contractProductList[i].factoryPrice)
|
|
|
+ ).toFixed(2);
|
|
|
}
|
|
|
- nextTick(() => {
|
|
|
- totalAmount();
|
|
|
- });
|
|
|
- });
|
|
|
+ }
|
|
|
+ totalAmount();
|
|
|
};
|
|
|
|
|
|
const totalAmount = () => {
|
|
|
let money = 0;
|
|
|
+ let moneyTwo = 0;
|
|
|
if (
|
|
|
formData.data.contractProductList &&
|
|
|
formData.data.contractProductList.length > 0
|
|
@@ -1407,6 +1760,12 @@ const totalAmount = () => {
|
|
|
Number(money) + Number(formData.data.contractProductList[i].amount)
|
|
|
).toFixed(2);
|
|
|
}
|
|
|
+ if (formData.data.contractProductList[i].amountTwo) {
|
|
|
+ moneyTwo = parseFloat(
|
|
|
+ Number(moneyTwo) +
|
|
|
+ Number(formData.data.contractProductList[i].amountTwo)
|
|
|
+ ).toFixed(2);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if (
|
|
@@ -1422,6 +1781,10 @@ const totalAmount = () => {
|
|
|
}
|
|
|
}
|
|
|
formData.data.amount = money;
|
|
|
+ formData.data.factoryAmount = moneyTwo;
|
|
|
+ formData.data.grossProfit = parseFloat(
|
|
|
+ Number(formData.data.amount) - Number(formData.data.factoryAmount)
|
|
|
+ ).toFixed(2);
|
|
|
};
|
|
|
const clickAdd = () => {
|
|
|
if (
|
|
@@ -1547,7 +1910,10 @@ const remoteMethod = (keyword) => {
|
|
|
return;
|
|
|
};
|
|
|
|
|
|
-const handleSubmit = async () => {
|
|
|
+const handleSubmit = async (isStag = false) => {
|
|
|
+ if (isStag) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
let flag = await formDom.value.handleSubmit(() => {});
|
|
|
if (flag) {
|
|
|
if (
|
|
@@ -1576,6 +1942,8 @@ const handleSubmit = async () => {
|
|
|
};
|
|
|
|
|
|
const getFormData = () => {
|
|
|
+ // 赋值类型
|
|
|
+ formData.data.type = route.query.flowKey == "sample_flow" ? "1" : "0";
|
|
|
return proxy.deepClone(formData.data);
|
|
|
};
|
|
|
// 向父组件暴露
|
|
@@ -1772,6 +2140,7 @@ const getAllData = (businessId) => {
|
|
|
});
|
|
|
changeProductPrice();
|
|
|
}
|
|
|
+ calculationAmount();
|
|
|
if (formData.data.countryId) {
|
|
|
getCityData(formData.data.countryId, "20");
|
|
|
}
|
|
@@ -1809,12 +2178,18 @@ const getFileData = () => {
|
|
|
});
|
|
|
};
|
|
|
const getPriceSheetData = (id) => {
|
|
|
- proxy.post("/extQuotation/detail", { id }).then((res) => {
|
|
|
+ proxy.post("/extQuotation/detail", { id }).then(async (res) => {
|
|
|
+ if (formData.data.deptId) {
|
|
|
+ res.deptId = formData.data.deptId;
|
|
|
+ }
|
|
|
formData.data = res;
|
|
|
formData.data = {
|
|
|
+ contractType: route.query.contractType,
|
|
|
templateContent: "",
|
|
|
quotationId: res.id,
|
|
|
companyId: res.companyId,
|
|
|
+ ofCompanyId: res.ofCompanyId,
|
|
|
+ deptId: res.deptId,
|
|
|
buyCorporationId: res.buyCorporationId,
|
|
|
buyAddress: res.buyAddress,
|
|
|
buyPostalCode: res.buyPostalCode,
|
|
@@ -1822,20 +2197,20 @@ const getPriceSheetData = (id) => {
|
|
|
buyContactNumber: res.buyContactNumber,
|
|
|
amount: res.amount,
|
|
|
};
|
|
|
- if (res.type == 1) {
|
|
|
- formData.data.contractType = "2";
|
|
|
- if (currencyData.value && currencyData.value.length > 0) {
|
|
|
- formData.data.currency = currencyData.value[0].dictKey;
|
|
|
- }
|
|
|
- formData.data.rate = 1;
|
|
|
- } else {
|
|
|
- formData.data.contractType = "1";
|
|
|
- }
|
|
|
+ // if (res.type == 1) {
|
|
|
+ // formData.data.contractType = "2";
|
|
|
+ // if (currencyData.value && currencyData.value.length > 0) {
|
|
|
+ // formData.data.currency = currencyData.value[0].dictKey;
|
|
|
+ // }
|
|
|
+ // formData.data.rate = 1;
|
|
|
+ // } else {
|
|
|
+ // formData.data.contractType = "1";
|
|
|
+ // }
|
|
|
formData.data.contractProductList = res.quotationProductList.map((x) => ({
|
|
|
quotationProductId: x.id,
|
|
|
fileUrl: "",
|
|
|
productId: x.productId,
|
|
|
- productCnName: x.productName,
|
|
|
+ productName: x.productName,
|
|
|
productCode: x.productCode,
|
|
|
productLength: x.productLength,
|
|
|
productWidth: x.productWidth,
|
|
@@ -1853,7 +2228,39 @@ const getPriceSheetData = (id) => {
|
|
|
rowId: uuidv4(),
|
|
|
}));
|
|
|
changeProductPrice();
|
|
|
+ totalAmount();
|
|
|
getFileData();
|
|
|
+ let productIds = formData.data.contractProductList.map((x) => x.productId);
|
|
|
+ const productAllFile = await proxy.getFileData({
|
|
|
+ businessIdList: productIds,
|
|
|
+ getAll: true,
|
|
|
+ });
|
|
|
+ for (let i = 0; i < formData.data.contractProductList.length; i++) {
|
|
|
+ const ele = formData.data.contractProductList[i];
|
|
|
+ for (const key in productAllFile) {
|
|
|
+ if (
|
|
|
+ ele.productId == key &&
|
|
|
+ productAllFile[ele.productId] &&
|
|
|
+ productAllFile[ele.productId].length > 0
|
|
|
+ ) {
|
|
|
+ ele.productFile = productAllFile[ele.productId].filter(
|
|
|
+ (x) => x.businessType == "0"
|
|
|
+ );
|
|
|
+ if (ele.productFile && ele.productFile.length > 0) {
|
|
|
+ ele.fileUrl = ele.productFile[0].fileUrl;
|
|
|
+ }
|
|
|
+ ele.fileListOne = productAllFile[ele.productId].filter(
|
|
|
+ (x) => x.businessType == "2"
|
|
|
+ );
|
|
|
+ if (ele.fileListOne && ele.fileListOne.length > 0) {
|
|
|
+ ele.isShowProductFile = true;
|
|
|
+ } else {
|
|
|
+ ele.isShowProductFile = false;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
formData.data.countryId = res.buyCountryId;
|
|
|
formData.data.provinceId = res.buyProvinceId;
|
|
|
formData.data.cityId = res.buyCityId;
|
|
@@ -1869,12 +2276,16 @@ const getPriceSheetData = (id) => {
|
|
|
const isEditList = ref(true);
|
|
|
onMounted(() => {
|
|
|
formData.data.ofCompanyId = proxy.useUserStore().user.companyId;
|
|
|
+ formData.data.salesmanId = proxy.useUserStore().user.userId;
|
|
|
handleOfCompanyIdChange(formData.data.ofCompanyId);
|
|
|
if (
|
|
|
proxy.useUserStore().currentCompany == proxy.useUserStore().user.ofCompanyId
|
|
|
) {
|
|
|
formData.data.deptId = proxy.useUserStore().user.deptId;
|
|
|
}
|
|
|
+ if (currencyData.value && currencyData.value.length > 0) {
|
|
|
+ formData.data.currency = currencyData.value[0].dictKey;
|
|
|
+ }
|
|
|
formOption.disabled = judgeStatus();
|
|
|
// 报价转销售订单
|
|
|
if (route.query && route.query.priceSheetId) {
|
|
@@ -1893,21 +2304,21 @@ onMounted(() => {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
-// watch(
|
|
|
-// () => props.queryData,
|
|
|
-// (val) => {
|
|
|
-// nextTick(() => {
|
|
|
-// formOption.disabled = judgeStatus();
|
|
|
-// });
|
|
|
-// if (val.businessId && val.processType) {
|
|
|
-// getAllData(val.businessId);
|
|
|
-// }
|
|
|
-// },
|
|
|
-// {
|
|
|
-// deep: true,
|
|
|
-// immediate: true,
|
|
|
-// }
|
|
|
-// );
|
|
|
+watch(
|
|
|
+ () => props.queryData,
|
|
|
+ (val) => {
|
|
|
+ nextTick(() => {
|
|
|
+ formOption.disabled = judgeStatus();
|
|
|
+ });
|
|
|
+ if (val.businessId && val.processType) {
|
|
|
+ getAllData(val.businessId);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ deep: true,
|
|
|
+ immediate: true,
|
|
|
+ }
|
|
|
+);
|
|
|
|
|
|
const showPriceInfo = () => {
|
|
|
if (props.queryData.processType) {
|