|
@@ -5,7 +5,7 @@
|
|
|
<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 #seller>
|
|
@@ -15,49 +15,53 @@
|
|
|
<el-option v-for="item in corporationList" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="地址" class="wid100">
|
|
|
- <el-row style="width:100%">
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="" prop="buyCountryName" label-width="0px" class="margin-b-0 wid100">
|
|
|
- <el-input v-model="formData.data.buyCountryName" placeholder="请输入国家" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="" prop="buyProvinceName" label-width="0px" class="margin-b-0 wid100">
|
|
|
- <el-input v-model="formData.data.buyProvinceName" placeholder="请输入省/州" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="" prop="buyCityName" label-width="0px" class="margin-b-0 wid100">
|
|
|
- <el-input v-model="formData.data.buyCityName" placeholder="请输入城市" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form-item>
|
|
|
+ <div v-show="isShowOther">
|
|
|
+ <el-form-item label="地址" class="wid100">
|
|
|
+ <el-row style="width:100%">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="" prop="buyCountryName" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input v-model="formData.data.buyCountryName" placeholder="请输入国家" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="" prop="buyProvinceName" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input v-model="formData.data.buyProvinceName" placeholder="请输入省/州" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="" prop="buyCityName" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input v-model="formData.data.buyCityName" placeholder="请输入城市" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- <el-form-item label="详细地址" prop="buyAddress" class="wid100">
|
|
|
- <el-input v-model="formData.data.buyAddress" type="textarea">
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
+ <el-form-item label="详细地址" prop="buyAddress" class="wid100">
|
|
|
+ <el-input v-model="formData.data.buyAddress" type="textarea">
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="联系人" class="wid100">
|
|
|
+ <el-row style="width:100%">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="" prop="buyContactName" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input v-model="formData.data.buyContactName" placeholder="请输入联系人" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="16">
|
|
|
+ <el-form-item label="" prop="buyContactNumber" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input v-model="formData.data.buyContactNumber" placeholder="请输入联系人电话" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
|
|
|
- <el-form-item label="联系人" class="wid100">
|
|
|
- <el-row style="width:100%">
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="" prop="buyContactName" label-width="0px" class="margin-b-0 wid100">
|
|
|
- <el-input v-model="formData.data.buyContactName" placeholder="请输入联系人" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="16">
|
|
|
- <el-form-item label="" prop="buyContactNumber" label-width="0px" class="margin-b-0 wid100">
|
|
|
- <el-input v-model="formData.data.buyContactNumber" placeholder="请输入联系人电话" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form-item>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #buyer>
|
|
|
- <div style="width: 100%">
|
|
|
+ <div style="width: 100%;position:relative">
|
|
|
+
|
|
|
<el-form-item label="卖方信息" prop="sellCorporationId" class="wid100">
|
|
|
<el-select v-model="formData.data.sellCorporationId" filterable remote reserve-keyword placeholder="请输入关键字" remote-show-suffix
|
|
|
:remote-method="remoteMethod" :loading="loadingSearch" @input="remoteMethod" style="width: 100%" @change="changeSupplier" v-if="
|
|
@@ -69,63 +73,75 @@
|
|
|
<el-select v-model="formData.data.sellCorporationName" disabled v-else style="width: 100%">
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="地址" class="wid100" required>
|
|
|
- <el-row style="width: 100%">
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="" prop="countryId" class="margin-b-0">
|
|
|
- <el-select v-model="formData.data.countryId" placeholder="国家" filterable @change="(val) => getCityData(val, '20', true)">
|
|
|
- <el-option v-for="item in countryData" :label="item.name" :value="item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="" prop="provinceName" class="margin-b-0">
|
|
|
- <selectCity placeholder="省/洲" @change="(val) => getCityData(val, '30', true)" addressId="provinceId" addressName="provinceName"
|
|
|
- v-model="formData.data" :data="provinceData">
|
|
|
- </selectCity>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="" prop="cityName" class="margin-b-0">
|
|
|
- <selectCity placeholder="城市" addressId="cityId" addressName="cityName" v-model="formData.data" :data="cityData">
|
|
|
- </selectCity>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="" prop="sellPostalCode" class="margin-b-0">
|
|
|
- <el-input v-model="formData.data.sellPostalCode" placeholder="请输入邮编" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form-item>
|
|
|
|
|
|
- <el-form-item label="详细地址" prop="sellAddress" class="wid100">
|
|
|
- <el-input v-model="formData.data.sellAddress" type="textarea">
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="联系人" class="wid100" required>
|
|
|
- <el-row style="width: 100%">
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="" prop="sellContactName" label-width="0px" class="margin-b-0 wid100">
|
|
|
- <el-input v-model="formData.data.sellContactName" clearable placeholder="请输入联系人">
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="16">
|
|
|
- <el-form-item label="" prop="sellContactNumber" label-width="0px" class="margin-b-0 wid100">
|
|
|
- <el-input v-model="formData.data.sellContactNumber" placeholder="请输入联系人电话" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form-item>
|
|
|
+ <div style="position:absolute;top:0px;right:-20px;cursor:pointer" @click="isShowOther =!isShowOther">
|
|
|
+ <el-icon v-if="!isShowOther">
|
|
|
+ <ArrowDownBold />
|
|
|
+ </el-icon>
|
|
|
+ <el-icon v-else>
|
|
|
+ <ArrowUpBold />
|
|
|
+ </el-icon>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div v-show="isShowOther">
|
|
|
+ <el-form-item label="地址" class="wid100" required>
|
|
|
+ <el-row style="width: 100%">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="" prop="countryId" class="margin-b-0">
|
|
|
+ <el-select v-model="formData.data.countryId" placeholder="国家" filterable @change="(val) => getCityData(val, '20', true)">
|
|
|
+ <el-option v-for="item in countryData" :label="item.name" :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="" prop="provinceName" class="margin-b-0">
|
|
|
+ <selectCity placeholder="省/洲" @change="(val) => getCityData(val, '30', true)" addressId="provinceId" addressName="provinceName"
|
|
|
+ v-model="formData.data" :data="provinceData">
|
|
|
+ </selectCity>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="" prop="cityName" class="margin-b-0">
|
|
|
+ <selectCity placeholder="城市" addressId="cityId" addressName="cityName" v-model="formData.data" :data="cityData">
|
|
|
+ </selectCity>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="" prop="sellPostalCode" class="margin-b-0">
|
|
|
+ <el-input v-model="formData.data.sellPostalCode" placeholder="请输入邮编" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="详细地址" prop="sellAddress" class="wid100">
|
|
|
+ <el-input v-model="formData.data.sellAddress" type="textarea">
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="联系人" class="wid100" required>
|
|
|
+ <el-row style="width: 100%">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="" prop="sellContactName" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input v-model="formData.data.sellContactName" clearable placeholder="请输入联系人">
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="16">
|
|
|
+ <el-form-item label="" prop="sellContactNumber" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input v-model="formData.data.sellContactNumber" placeholder="请输入联系人电话" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<template #commodity>
|
|
|
<div style="width: 100%">
|
|
|
<el-table :data="formData.data.purchaseProductList" style="width: 100%; ">
|
|
|
- <el-table-column label="商品图片" width="80">
|
|
|
+ <el-table-column label="图片" width="80">
|
|
|
<template #default="{ row }">
|
|
|
<div v-if="row.fileUrl">
|
|
|
<img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
|
|
@@ -133,8 +149,8 @@
|
|
|
<div v-else></div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="productName" label="商品名称" min-width="130" />
|
|
|
- <el-table-column prop="productCode" label="商品编码" width="130" />
|
|
|
+ <el-table-column prop="productCode" label="编码" width="150" />
|
|
|
+ <el-table-column prop="productName" label="名称" min-width="130" />
|
|
|
<el-table-column label="规格尺寸 (cm)" width="140">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
@@ -142,9 +158,14 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column prop="productColor" label="颜色" width="130" />
|
|
|
+ <el-table-column prop="productNetWeight" label="净重" width="100" />
|
|
|
+ <el-table-column prop="productFrontalTexture" label="纹路" width="130"
|
|
|
+ :formatter="(row) => dictKeyValue(row.productFrontalTexture, frontLinesData)" />
|
|
|
+ <el-table-column prop="productUnit" label="单位" width="100" />
|
|
|
<el-table-column label="数量" prop="subscribeCount" width="100" v-if="route.query.ids" />
|
|
|
<el-table-column label="已采购数量" prop="purchaseCount" width="100" v-if="route.query.ids" />
|
|
|
- <el-table-column label="采购数量" width="130">
|
|
|
+ <el-table-column label="采购数量" width="110">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
<el-form-item :prop="'purchaseProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
|
|
@@ -155,7 +176,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="单价" width="160">
|
|
|
+ <!-- <el-table-column label="单价" width="160">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
<el-form-item :prop="'purchaseProductList.' + $index + '.price'" :rules="rules.price" :inline-message="true"
|
|
@@ -203,19 +224,42 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #reference>
|
|
|
- <!-- <div style="margin-left:10px;cursor:pointer;position:relative;top:4px">
|
|
|
+ <div style="margin-left:10px;cursor:pointer;position:relative;top:4px">
|
|
|
<el-icon :size="20" color="#85c1a6">
|
|
|
<WarningFilled />
|
|
|
</el-icon>
|
|
|
- </div> -->
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-popover>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</template>
|
|
|
+ </el-table-column> -->
|
|
|
+ <el-table-column label="单价(不含税)" width="130">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-form-item :prop="'purchaseProductList.' + $index + '.price'" :rules="rules.price" :inline-message="true"
|
|
|
+ class="margin-b-0 wid100">
|
|
|
+ <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="2"
|
|
|
+ :controls="false" :min="0" @change="calculationAmount()" />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="amount" label="小计" width="120" />
|
|
|
+ <el-table-column label="单价(含税)" width="120">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-form-item :prop="'purchaseProductList.' + $index + '.priceIncludingTax'" :rules="rules.priceIncludingTax" :inline-message="true"
|
|
|
+ class="margin-b-0 wid100">
|
|
|
+ <el-input-number onmousewheel="return false;" v-model="row.priceIncludingTax" placeholder="请输入" style="width: 100%" :precision="2"
|
|
|
+ :controls="false" :min="0" @change="calculationAmount()" disabled />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="小计(不含税)" width="130" prop="amount" />
|
|
|
+ <el-table-column label="小计(含税)" width="120" prop="amountIncludingTax" />
|
|
|
<el-table-column label="备注" width="200">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
@@ -313,6 +357,9 @@ const fundsPaymentMethod = computed(
|
|
|
const shippingMethod = computed(
|
|
|
() => proxy.useUserStore().allDict["shipping_method"]
|
|
|
);
|
|
|
+const frontLinesData = computed(
|
|
|
+ () => proxy.useUserStore().allDict["front_lines"]
|
|
|
+);
|
|
|
// const companyId = computed(() => proxy.useUserStore().user.companyId);
|
|
|
const deliveryType = ref([
|
|
|
{
|
|
@@ -328,6 +375,10 @@ const deliveryType = ref([
|
|
|
value: "3",
|
|
|
},
|
|
|
]);
|
|
|
+const treeData = ref([]);
|
|
|
+const userList = ref([]);
|
|
|
+const deptData = ref([]);
|
|
|
+const warehouseList = ref([]);
|
|
|
const supplierList = ref([]);
|
|
|
const corporationList = ref([]);
|
|
|
const templateList = ref([]);
|
|
@@ -335,12 +386,13 @@ const customerUserList = ref([]);
|
|
|
const countryData = ref([]);
|
|
|
const provinceData = ref([]);
|
|
|
const cityData = ref([]);
|
|
|
-
|
|
|
const openProductCompany = ref(false);
|
|
|
const copyType = ref(1);
|
|
|
const copyContract = ref(false);
|
|
|
+const isShowOther = ref(false);
|
|
|
const formData = reactive({
|
|
|
data: {
|
|
|
+ fileList: [],
|
|
|
purchaseProductList: [],
|
|
|
remark: "",
|
|
|
},
|
|
@@ -363,7 +415,7 @@ const judgeStatus = () => {
|
|
|
};
|
|
|
const formOption = reactive({
|
|
|
inline: true,
|
|
|
- labelWidth: 100,
|
|
|
+ labelWidth: 110,
|
|
|
itemWidth: 100,
|
|
|
disabled: false,
|
|
|
});
|
|
@@ -379,13 +431,13 @@ const formConfig = computed(() => {
|
|
|
type: "title",
|
|
|
title: "基本信息",
|
|
|
},
|
|
|
-
|
|
|
{
|
|
|
type: "input",
|
|
|
prop: "code",
|
|
|
- label: "合同号",
|
|
|
+ label: "订单号",
|
|
|
+ disabled: true,
|
|
|
isShow: formData.data.code ? true : false,
|
|
|
- itemWidth: 50,
|
|
|
+ itemWidth: 25,
|
|
|
},
|
|
|
{
|
|
|
type: "treeSelect",
|
|
@@ -394,8 +446,55 @@ const formConfig = computed(() => {
|
|
|
data: proxy.useUserStore().allDict["tree_company_data"],
|
|
|
propsTreeLabel: "deptName",
|
|
|
propsTreeValue: "deptId",
|
|
|
- itemWidth: 50,
|
|
|
- disabled: true,
|
|
|
+ itemWidth: 25,
|
|
|
+ // disabled: true,
|
|
|
+ fn: (val) => {
|
|
|
+ formData.data.deptId = "";
|
|
|
+ formData.data.purchaseUserId = "";
|
|
|
+ getDeptData(val);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "treeSelect",
|
|
|
+ prop: "deptId",
|
|
|
+ label: "业务部门",
|
|
|
+ data: deptData.value,
|
|
|
+ propsTreeLabel: "deptName",
|
|
|
+ propsTreeValue: "deptId",
|
|
|
+ itemWidth: 25,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "purchaseUserId",
|
|
|
+ label: "采购员",
|
|
|
+ required: true,
|
|
|
+ filterable: true,
|
|
|
+ data: userList.value,
|
|
|
+ itemWidth: 25,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "date",
|
|
|
+ prop: "purchaseTime",
|
|
|
+ itemType: "date",
|
|
|
+ label: "采购日期",
|
|
|
+ itemWidth: 25,
|
|
|
+ disabled: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "treeSelect",
|
|
|
+ prop: "prodCompanyId",
|
|
|
+ label: "生产单位",
|
|
|
+ data: treeData.value,
|
|
|
+ propsTreeLabel: "deptName",
|
|
|
+ propsTreeValue: "deptId",
|
|
|
+ itemWidth: 25,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "warehouseId",
|
|
|
+ label: "入库仓库",
|
|
|
+ data: warehouseList.value,
|
|
|
+ itemWidth: 25,
|
|
|
},
|
|
|
{
|
|
|
type: "title",
|
|
@@ -414,25 +513,25 @@ const formConfig = computed(() => {
|
|
|
label: "",
|
|
|
itemWidth: 50,
|
|
|
},
|
|
|
- {
|
|
|
- type: "title",
|
|
|
- title: "付款信息",
|
|
|
- haveLine: true,
|
|
|
- },
|
|
|
- {
|
|
|
- type: "select",
|
|
|
- prop: "paymentMethod",
|
|
|
- label: "付款方式",
|
|
|
- data: fundsPaymentMethod.value,
|
|
|
- itemWidth: 25,
|
|
|
- },
|
|
|
- {
|
|
|
- type: "select",
|
|
|
- prop: "invoiceType",
|
|
|
- label: "发票类型",
|
|
|
- data: invoiceType.value,
|
|
|
- itemWidth: 25,
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // type: "title",
|
|
|
+ // title: "付款信息",
|
|
|
+ // haveLine: true,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // type: "select",
|
|
|
+ // prop: "paymentMethod",
|
|
|
+ // label: "付款方式",
|
|
|
+ // data: fundsPaymentMethod.value,
|
|
|
+ // itemWidth: 25,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // type: "select",
|
|
|
+ // prop: "invoiceType",
|
|
|
+ // label: "发票类型",
|
|
|
+ // data: invoiceType.value,
|
|
|
+ // itemWidth: 25,
|
|
|
+ // },
|
|
|
{
|
|
|
type: "title",
|
|
|
title: "交付信息",
|
|
@@ -446,34 +545,70 @@ const formConfig = computed(() => {
|
|
|
// data: deliveryType.value,
|
|
|
// itemWidth: 50,
|
|
|
// },
|
|
|
- {
|
|
|
- type: "select",
|
|
|
- prop: "deliveryType",
|
|
|
- label: "交货类型",
|
|
|
- border: true,
|
|
|
- data: deliveryType.value,
|
|
|
- itemWidth: 50,
|
|
|
- fn: () => {
|
|
|
- changeAddress();
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- type: "input",
|
|
|
- prop: "address",
|
|
|
- itemType: "text",
|
|
|
- label: "详细地址",
|
|
|
- itemWidth: 50,
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // type: "select",
|
|
|
+ // prop: "deliveryType",
|
|
|
+ // label: "交货类型",
|
|
|
+ // border: true,
|
|
|
+ // data: deliveryType.value,
|
|
|
+ // itemWidth: 33.33,
|
|
|
+ // fn: () => {
|
|
|
+ // changeAddress();
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // type: "input",
|
|
|
+ // prop: "address",
|
|
|
+ // itemType: "text",
|
|
|
+ // label: "详细地址",
|
|
|
+ // itemWidth: 33.33,
|
|
|
+ // },
|
|
|
{
|
|
|
type: "date",
|
|
|
itemType: "date",
|
|
|
prop: "deliveryTime",
|
|
|
label: "交付日期",
|
|
|
- itemWidth: 50,
|
|
|
+ itemWidth: 33.33,
|
|
|
disabledFn: (date) => {
|
|
|
return moment(date).isBefore(moment());
|
|
|
},
|
|
|
},
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "supplierIncludingTax",
|
|
|
+ label: "报价是否含税",
|
|
|
+ filterable: true,
|
|
|
+ placeholder: " ",
|
|
|
+ disabled: true,
|
|
|
+ data: [
|
|
|
+ {
|
|
|
+ label: "是",
|
|
|
+ value: "1",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "否",
|
|
|
+ value: "0",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ itemWidth: 33.33,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "supplierTaxPoints",
|
|
|
+ label: "供应商税点",
|
|
|
+ itemType: "text",
|
|
|
+ itemWidth: 33.33,
|
|
|
+ disabled: true,
|
|
|
+ placeholder: " ",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "upload",
|
|
|
+ listType: "text",
|
|
|
+ accept: "",
|
|
|
+ prop: "fileList",
|
|
|
+ label: "附件",
|
|
|
+ itemWidth: 100,
|
|
|
+ },
|
|
|
// {
|
|
|
// type: "number",
|
|
|
// prop: "warranty",
|
|
@@ -518,25 +653,32 @@ const formConfig = computed(() => {
|
|
|
},
|
|
|
{
|
|
|
type: "title",
|
|
|
- title: "合同总金额",
|
|
|
+ title: "总金额",
|
|
|
haveLine: true,
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|
|
|
prop: "amount",
|
|
|
- label: "合同总金额",
|
|
|
+ label: "总金额(不含税)",
|
|
|
+ itemWidth: 25,
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "amountIncludingTax",
|
|
|
+ label: "总金额(含税)",
|
|
|
itemWidth: 25,
|
|
|
disabled: true,
|
|
|
},
|
|
|
{
|
|
|
type: "title",
|
|
|
- title: "合同模板",
|
|
|
+ title: "合同条款",
|
|
|
haveLine: true,
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
|
prop: "contractTemplateId",
|
|
|
- label: "合同模板",
|
|
|
+ label: "合同条款",
|
|
|
data: templateList.value,
|
|
|
itemWidth: 50,
|
|
|
fn: (val) => {
|
|
@@ -598,9 +740,34 @@ const rules = ref({
|
|
|
amount: [{ required: true, message: "请输入金额", trigger: "blur" }],
|
|
|
remark: [{ required: true, message: "请输入条款内容", trigger: "blur" }],
|
|
|
companyId: [{ required: true, message: "请选择业务公司", trigger: "change" }],
|
|
|
+ deptId: [{ required: true, message: "请选择业务部门", trigger: "change" }],
|
|
|
+ purchaseUserId: [
|
|
|
+ { required: true, message: "请选择采购员", trigger: "change" },
|
|
|
+ ],
|
|
|
+ purchaseTime: [
|
|
|
+ { required: true, message: "请选择采购日期", trigger: "change" },
|
|
|
+ ],
|
|
|
+ prodCompanyId: [
|
|
|
+ { required: true, message: "请选择生产单位", trigger: "change" },
|
|
|
+ ],
|
|
|
+ warehouseId: [
|
|
|
+ { required: true, message: "请选择入库仓库", trigger: "change" },
|
|
|
+ ],
|
|
|
});
|
|
|
const getDict = () => {
|
|
|
proxy
|
|
|
+ .get("/tenantDept/list", {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 9999,
|
|
|
+ keyword: "",
|
|
|
+ tenantId: proxy.useUserStore().user.tenantId,
|
|
|
+ type: 0,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ treeData.value = proxy.handleTree(res.data, "deptId");
|
|
|
+ });
|
|
|
+
|
|
|
+ proxy
|
|
|
.post("/supplierInfo/page", {
|
|
|
pageNum: 1,
|
|
|
pageSize: 50,
|
|
@@ -638,6 +805,54 @@ const getDict = () => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+const getDeptData = (val) => {
|
|
|
+ proxy
|
|
|
+ .get("/tenantUser/list", {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10000,
|
|
|
+ tenantId: proxy.useUserStore().user.tenantId,
|
|
|
+ companyId: val,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ userList.value = res.rows.map((item) => {
|
|
|
+ return {
|
|
|
+ label: item.nickName,
|
|
|
+ value: item.userId,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ proxy
|
|
|
+ .get("/tenantDept/list", {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 9999,
|
|
|
+ keyword: "",
|
|
|
+ ancestors: val,
|
|
|
+ tenantId: proxy.useUserStore().user.tenantId,
|
|
|
+ // type: 2,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ deptData.value = proxy.handleTree(res.data, "deptId");
|
|
|
+ });
|
|
|
+
|
|
|
+ proxy
|
|
|
+ .post("/warehouse/page", {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 999,
|
|
|
+ companyId: val,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.rows && res.rows.length > 0) {
|
|
|
+ warehouseList.value = res.rows.map((item) => {
|
|
|
+ return {
|
|
|
+ label: item.name,
|
|
|
+ value: item.id,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
const changeAddress = () => {
|
|
|
if (formData.data.deliveryType === "1") {
|
|
|
let buyCountryName = "";
|
|
@@ -742,6 +957,7 @@ const buyCorporationIdChange = (val) => {
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
const changeSupplierPrice = (val) => {
|
|
|
let productIds = formData.data.purchaseProductList.map((x) => x.productId);
|
|
|
if (val && productIds && productIds.length > 0) {
|
|
@@ -755,17 +971,13 @@ const changeSupplierPrice = (val) => {
|
|
|
for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
|
|
|
const e = formData.data.purchaseProductList[i];
|
|
|
for (const key in res) {
|
|
|
- if (e.productId === key) {
|
|
|
- e.price = Number(res[key]);
|
|
|
+ if (e.productId === key && res[key]) {
|
|
|
+ e.price = Number(res[key].price);
|
|
|
+ e.priceIncludingTax = Number(res[key].includingTaxPrice);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- } else {
|
|
|
- for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
|
|
|
- const e = formData.data.purchaseProductList[i];
|
|
|
- e.price = 0;
|
|
|
- }
|
|
|
}
|
|
|
calculationAmount();
|
|
|
});
|
|
@@ -775,7 +987,10 @@ const changeSupplier = (val) => {
|
|
|
// 产品价格趋势
|
|
|
changeProductPrice();
|
|
|
// 供应价格
|
|
|
- changeSupplierPrice(val);
|
|
|
+ if (route.query.dataType == 1) {
|
|
|
+ changeSupplierPrice(val);
|
|
|
+ }
|
|
|
+
|
|
|
formData.data.countryId = "";
|
|
|
formData.data.provinceId = "";
|
|
|
formData.data.cityId = "";
|
|
@@ -783,15 +998,14 @@ const changeSupplier = (val) => {
|
|
|
formData.data.sellContactName = "";
|
|
|
formData.data.sellContactNumber = "";
|
|
|
if (val) {
|
|
|
- let data = supplierList.value.filter((item) => item.id === val);
|
|
|
- if (data && data.length > 0) {
|
|
|
- formData.data.countryId = data[0].countryId;
|
|
|
- formData.data.provinceId = data[0].provinceId;
|
|
|
- formData.data.cityId = data[0].cityId;
|
|
|
- formData.data.sellAddress = data[0].areaDetail;
|
|
|
- formData.data.sellPostalCode = data[0].postalCode;
|
|
|
- formData.data.sellContactName = data[0].contactPerson;
|
|
|
- formData.data.sellContactNumber = data[0].contactNumber;
|
|
|
+ proxy.post("/supplierInfo/detail", { id: val }).then((res) => {
|
|
|
+ formData.data.countryId = res.countryId;
|
|
|
+ formData.data.provinceId = res.provinceId;
|
|
|
+ formData.data.cityId = res.cityId;
|
|
|
+ formData.data.sellAddress = res.areaDetail;
|
|
|
+ formData.data.sellPostalCode = res.postalCode;
|
|
|
+ formData.data.sellContactName = res.contactPerson;
|
|
|
+ formData.data.sellContactNumber = res.contactNumber;
|
|
|
if (formData.data.countryId) {
|
|
|
getCityData(formData.data.countryId, "20");
|
|
|
}
|
|
@@ -799,11 +1013,14 @@ const changeSupplier = (val) => {
|
|
|
getCityData(formData.data.provinceId, "30");
|
|
|
}
|
|
|
setTimeout(() => changeAddress(), 1500);
|
|
|
- }
|
|
|
+ formData.data.supplierIncludingTax = res.privIncludingTax;
|
|
|
+ formData.data.supplierTaxPoints = res.privTaxPoints;
|
|
|
+ });
|
|
|
}
|
|
|
};
|
|
|
|
|
|
const changeProductPrice = () => {
|
|
|
+ return;
|
|
|
let productIds = formData.data.purchaseProductList.map((x) => x.productId);
|
|
|
if (productIds && productIds.length > 0) {
|
|
|
proxy
|
|
@@ -858,29 +1075,30 @@ const handleRemove = (index) => {
|
|
|
formData.data.purchaseProductList.splice(index, 1);
|
|
|
totalAmount();
|
|
|
};
|
|
|
-const calculationAmount = (att = "") => {
|
|
|
- nextTick(() => {
|
|
|
- if (
|
|
|
- formData.data.purchaseProductList &&
|
|
|
- formData.data.purchaseProductList.length > 0
|
|
|
- ) {
|
|
|
- for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
|
|
|
- let money = 0;
|
|
|
- money = parseFloat(
|
|
|
- Number(formData.data.purchaseProductList[i].quantity) *
|
|
|
- Number(formData.data.purchaseProductList[i].price)
|
|
|
- ).toFixed(2);
|
|
|
- formData.data.purchaseProductList[i].amount = money;
|
|
|
- }
|
|
|
+
|
|
|
+const calculationAmount = () => {
|
|
|
+ if (
|
|
|
+ formData.data.purchaseProductList &&
|
|
|
+ formData.data.purchaseProductList.length > 0
|
|
|
+ ) {
|
|
|
+ for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
|
|
|
+ formData.data.purchaseProductList[i].amount = parseFloat(
|
|
|
+ Number(formData.data.purchaseProductList[i].quantity) *
|
|
|
+ Number(formData.data.purchaseProductList[i].price)
|
|
|
+ ).toFixed(2);
|
|
|
+ formData.data.purchaseProductList[i].amountIncludingTax = parseFloat(
|
|
|
+ Number(formData.data.purchaseProductList[i].quantity) *
|
|
|
+ Number(formData.data.purchaseProductList[i].priceIncludingTax)
|
|
|
+ ).toFixed(2);
|
|
|
}
|
|
|
- nextTick(() => {
|
|
|
- totalAmount();
|
|
|
- });
|
|
|
- });
|
|
|
+ }
|
|
|
+ totalAmount();
|
|
|
};
|
|
|
|
|
|
const totalAmount = () => {
|
|
|
let money = 0;
|
|
|
+ let moneyTwo = 0;
|
|
|
+
|
|
|
if (
|
|
|
formData.data.purchaseProductList &&
|
|
|
formData.data.purchaseProductList.length > 0
|
|
@@ -891,6 +1109,12 @@ const totalAmount = () => {
|
|
|
Number(money) + Number(formData.data.purchaseProductList[i].amount)
|
|
|
).toFixed(2);
|
|
|
}
|
|
|
+ if (formData.data.purchaseProductList[i].amountIncludingTax) {
|
|
|
+ moneyTwo = parseFloat(
|
|
|
+ Number(moneyTwo) +
|
|
|
+ Number(formData.data.purchaseProductList[i].amountIncludingTax)
|
|
|
+ ).toFixed(2);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if (
|
|
@@ -906,7 +1130,9 @@ const totalAmount = () => {
|
|
|
}
|
|
|
}
|
|
|
formData.data.amount = money;
|
|
|
+ formData.data.amountIncludingTax = moneyTwo;
|
|
|
};
|
|
|
+
|
|
|
const clickAdd = () => {
|
|
|
if (
|
|
|
formData.data.purchaseProjectList &&
|
|
@@ -976,6 +1202,7 @@ const handleSubmit = async () => {
|
|
|
// const errorDiv = document.getElementsByClassName("is-error");
|
|
|
// errorDiv[0].scrollIntoView();
|
|
|
// }, 0);
|
|
|
+ isShowOther.value = true;
|
|
|
}
|
|
|
return flag;
|
|
|
};
|
|
@@ -1030,12 +1257,33 @@ const getAllData = (businessId) => {
|
|
|
);
|
|
|
changeProductPrice();
|
|
|
}
|
|
|
+ if (formData.data.companyId) {
|
|
|
+ getDeptData(formData.data.companyId);
|
|
|
+ }
|
|
|
if (formData.data.countryId) {
|
|
|
getCityData(formData.data.countryId, "20");
|
|
|
}
|
|
|
if (formData.data.provinceId) {
|
|
|
getCityData(formData.data.provinceId, "30");
|
|
|
}
|
|
|
+
|
|
|
+ proxy
|
|
|
+ .post("/fileInfo/getList", { businessIdList: [businessId] })
|
|
|
+ .then((fileObj) => {
|
|
|
+ if (fileObj[businessId] && fileObj[businessId].length > 0) {
|
|
|
+ formData.data.fileList = fileObj[businessId]
|
|
|
+ .filter((x) => x.businessType == "0")
|
|
|
+ .map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ name: item.fileName,
|
|
|
+ url: item.fileUrl,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ formData.data.fileList = [];
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
};
|
|
@@ -1043,8 +1291,18 @@ const getAllData = (businessId) => {
|
|
|
const getProductList = (ids) => {
|
|
|
if (ids && ids.length > 0) {
|
|
|
proxy.post("/subscribeDetail/detail", { ids }).then((res) => {
|
|
|
- if (res && res.length > 0) {
|
|
|
- formData.data.purchaseProductList = res.map((item) => {
|
|
|
+ formData.data.companyId =
|
|
|
+ res.companyId || proxy.useUserStore().user.companyId;
|
|
|
+ getDeptData(formData.data.companyId);
|
|
|
+ formData.data.deptId =
|
|
|
+ res.deptId || proxy.useUserStore().user.dept.deptId;
|
|
|
+ formData.data.purchaseUserId =
|
|
|
+ res.subcribeUserId || proxy.useUserStore().user.userId;
|
|
|
+ formData.data.warehouseId = res.putWarehouseId;
|
|
|
+
|
|
|
+ let detailList = res.subscribeDetailList;
|
|
|
+ if (detailList && detailList.length > 0) {
|
|
|
+ formData.data.purchaseProductList = detailList.map((item) => {
|
|
|
let dataResourceId =
|
|
|
item.dataType == 0 ? item.id : item.contractDetailId;
|
|
|
return {
|
|
@@ -1055,11 +1313,17 @@ const getProductList = (ids) => {
|
|
|
productLength: item.productLength,
|
|
|
productWidth: item.productWidth,
|
|
|
productHeight: item.productHeight,
|
|
|
+ productColor: item.productColor,
|
|
|
+ productNetWeight: item.productNetWeight,
|
|
|
+ productFrontalTexture: item.productFrontalTexture,
|
|
|
+ productUnit: item.productUnit,
|
|
|
subscribeCount: item.count || 0,
|
|
|
purchaseCount: item.purchaseCount || 0,
|
|
|
- quantity: null,
|
|
|
- price: "",
|
|
|
- amount: "",
|
|
|
+ quantity: Number(item.count) - Number(item.purchaseCount) || null,
|
|
|
+ price: item.price || null,
|
|
|
+ priceIncludingTax: item.priceIncludingTax || null,
|
|
|
+ amount: item.amount || "",
|
|
|
+ amountIncludingTax: item.amountIncludingTax || "",
|
|
|
remark: "",
|
|
|
fileUrl: "",
|
|
|
dataResource: item.dataType,
|
|
@@ -1070,11 +1334,11 @@ const getProductList = (ids) => {
|
|
|
formData.data.dataResource =
|
|
|
formData.data.purchaseProductList[0].dataResource;
|
|
|
if (formData.data.purchaseProductList[0].dataType == 0) {
|
|
|
- formData.data.dataResourceId = res[0].subscribeId;
|
|
|
+ formData.data.dataResourceId = detailList[0].subscribeId;
|
|
|
} else {
|
|
|
- formData.data.dataResourceId = res[0].contractId;
|
|
|
+ formData.data.dataResourceId = detailList[0].contractId;
|
|
|
}
|
|
|
- let productIdList = res.map((x) => x.productId);
|
|
|
+ let productIdList = detailList.map((x) => x.productId);
|
|
|
proxy
|
|
|
.post("/fileInfo/getList", {
|
|
|
businessIdList: productIdList,
|
|
@@ -1091,9 +1355,13 @@ const getProductList = (ids) => {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+ calculationAmount();
|
|
|
changeProductPrice();
|
|
|
}
|
|
|
+ if (res.supplierId) {
|
|
|
+ formData.data.sellCorporationId = res.supplierId;
|
|
|
+ changeSupplier(formData.data.sellCorporationId);
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
};
|
|
@@ -1105,8 +1373,6 @@ onMounted(() => {
|
|
|
}
|
|
|
if (route.query.businessId && route.query.processType) {
|
|
|
getAllData(route.query.businessId);
|
|
|
- } else if (route.query.businessId) {
|
|
|
- getAllData(route.query.businessId);
|
|
|
}
|
|
|
});
|
|
|
|