|
@@ -39,6 +39,9 @@
|
|
|
|
|
|
<template #btn="{ item }">
|
|
|
<div>
|
|
|
+ <el-button type="primary" link @click="handleReturnGoods(item)"
|
|
|
+ >退货</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
link
|
|
@@ -116,7 +119,13 @@
|
|
|
<el-table-column prop="productCode" label="物品编码" />
|
|
|
<el-table-column prop="productName" label="物品名称" />
|
|
|
<el-table-column prop="productSpec" label="规格型号" />
|
|
|
- <el-table-column prop="productUnit" label="单位" />
|
|
|
+ <el-table-column
|
|
|
+ prop="productUnit"
|
|
|
+ label="单位"
|
|
|
+ :formatter="
|
|
|
+ (row) => dictValueLabel(row.productUnit, productUnit)
|
|
|
+ "
|
|
|
+ />
|
|
|
<el-table-column prop="count" label="采购数量" />
|
|
|
<el-table-column
|
|
|
prop="alreadyDeliverGoodsQuantity"
|
|
@@ -141,7 +150,7 @@
|
|
|
>
|
|
|
<el-input-number
|
|
|
v-model="row.deliverGoodsQuantity"
|
|
|
- :precision="4"
|
|
|
+ :precision="2"
|
|
|
:controls="false"
|
|
|
:min="0"
|
|
|
/>
|
|
@@ -169,7 +178,7 @@
|
|
|
>
|
|
|
<el-input-number
|
|
|
v-model="row.deliverGoodsQuantity"
|
|
|
- :precision="4"
|
|
|
+ :precision="2"
|
|
|
:controls="false"
|
|
|
:min="0"
|
|
|
/>
|
|
@@ -198,7 +207,6 @@
|
|
|
:title="'到货详情'"
|
|
|
v-model="dialogVisibleOne"
|
|
|
width="80%"
|
|
|
- v-loading="loadingOne"
|
|
|
destroy-on-close
|
|
|
>
|
|
|
<byForm
|
|
@@ -210,11 +218,11 @@
|
|
|
>
|
|
|
<template #detailSlot>
|
|
|
<div style="width: 100%">
|
|
|
- <el-table :data="formData.dataOne.arrivalDetailList">
|
|
|
- <el-table-column prop="productCode" label="物品编码" />
|
|
|
+ <el-table :data="formData.dataOne.purchaseDetailVoList">
|
|
|
+ <el-table-column prop="productCustomCode" label="物品编码" />
|
|
|
<el-table-column prop="productName" label="物品名称" />
|
|
|
<el-table-column prop="count" label="采购数量" />
|
|
|
- <el-table-column prop="shipmentQuantity" label="已发货">
|
|
|
+ <el-table-column prop="deliverGoodsQuantity" label="已发货">
|
|
|
<template #default="{ row }">
|
|
|
<div>
|
|
|
<el-popover
|
|
@@ -224,33 +232,94 @@
|
|
|
trigger="hover"
|
|
|
>
|
|
|
<div default>
|
|
|
- <el-table :data="row.quantityList">
|
|
|
+ <el-table :data="row.deliverGoodsDetailList">
|
|
|
<el-table-column
|
|
|
label="发货时间"
|
|
|
prop="createTime"
|
|
|
- width="150"
|
|
|
+ width="155"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="物流单号"
|
|
|
+ prop="logisticsCode"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="数量"
|
|
|
+ prop="deliverGoodsQuantity"
|
|
|
+ width="100"
|
|
|
+ />
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <template #reference>
|
|
|
+ <div style="cursor: pointer; color: #0084ff">
|
|
|
+ {{ row.deliverGoodsQuantity }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-popover>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="arrivalQuantity" label="已到货">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <div>
|
|
|
+ <el-popover
|
|
|
+ placement="bottom-start"
|
|
|
+ title="到货详情"
|
|
|
+ :width="500"
|
|
|
+ trigger="hover"
|
|
|
+ >
|
|
|
+ <div default>
|
|
|
+ <el-table :data="row.arrivalDetailList">
|
|
|
+ <el-table-column
|
|
|
+ label="到货时间"
|
|
|
+ prop="createTime"
|
|
|
+ width="155"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="物流单号"
|
|
|
+ prop="logisticsCode"
|
|
|
/>
|
|
|
- <el-table-column label="物流单号" prop="code" />
|
|
|
<el-table-column
|
|
|
label="数量"
|
|
|
- prop="shipmentQuantity"
|
|
|
+ prop="count"
|
|
|
width="100"
|
|
|
/>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
<template #reference>
|
|
|
<div style="cursor: pointer; color: #0084ff">
|
|
|
- {{ row.shipmentQuantity }}
|
|
|
+ {{ row.arrivalQuantity }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-popover>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="purchaseBackQuantity" label="退货">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <div>
|
|
|
+ <el-popover
|
|
|
+ placement="bottom-start"
|
|
|
+ title="退货详情"
|
|
|
+ :width="500"
|
|
|
+ trigger="hover"
|
|
|
+ >
|
|
|
+ <div default>
|
|
|
+ <el-table :data="row.purchaseBackDetailsList">
|
|
|
+ <el-table-column label="退货时间" prop="createTime" />
|
|
|
+ <el-table-column label="数量" prop="quantity" />
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <template #reference>
|
|
|
+ <div style="cursor: pointer; color: #0084ff">
|
|
|
+ {{ row.purchaseBackQuantity }}
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-popover>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="count" label="已到货" />
|
|
|
- <el-table-column prop="count" label="退货" />
|
|
|
- <el-table-column prop="count" label="已质检数量" />
|
|
|
- <el-table-column prop="count" label="不合格数量" />
|
|
|
+ <el-table-column prop="qualityQuantity" label="已质检数量" />
|
|
|
+ <el-table-column prop="noQualifiedCount" label="不合格数量" />
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -261,6 +330,145 @@
|
|
|
>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ :title="'采购退货'"
|
|
|
+ v-model="dialogVisibleTwo"
|
|
|
+ width="60%"
|
|
|
+ v-loading="loadingTwo"
|
|
|
+ destroy-on-close
|
|
|
+ >
|
|
|
+ <byForm
|
|
|
+ :formConfig="formConfigTwo"
|
|
|
+ :formOption="formOption"
|
|
|
+ v-model="formData.dataTwo"
|
|
|
+ :rules="rulesTwo"
|
|
|
+ ref="byformTwo"
|
|
|
+ >
|
|
|
+ <template #detailSlot>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-table :data="formData.dataTwo.purchaseBackDetailsList">
|
|
|
+ <el-table-column
|
|
|
+ prop="subscribeCode"
|
|
|
+ label="申购单号"
|
|
|
+ width="110"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="planArrivalTime"
|
|
|
+ label="要求到货时间"
|
|
|
+ width="160"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="productCustomCode"
|
|
|
+ label="物品编码"
|
|
|
+ width="110"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="productName"
|
|
|
+ label="物品名称"
|
|
|
+ width="160"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="productUnit"
|
|
|
+ label="物品单位"
|
|
|
+ width="80"
|
|
|
+ :formatter="
|
|
|
+ (row) => dictValueLabel(row.productUnit, productUnit)
|
|
|
+ "
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="price"
|
|
|
+ label="单价"
|
|
|
+ width="60"
|
|
|
+ :formatter="
|
|
|
+ (row) => dictValueLabel(row.productUnit, productUnit)
|
|
|
+ "
|
|
|
+ />
|
|
|
+ <el-table-column prop="count" label="采购数量" width="100" />
|
|
|
+ <el-table-column
|
|
|
+ prop="quantity"
|
|
|
+ label="退货数量"
|
|
|
+ min-width="150"
|
|
|
+ fixed="right"
|
|
|
+ >
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <el-form-item
|
|
|
+ :prop="'purchaseBackDetailsList.' + $index + '.quantity'"
|
|
|
+ :rules="rulesTwo.quantity"
|
|
|
+ :inline-message="true"
|
|
|
+ >
|
|
|
+ <el-input-number
|
|
|
+ v-model="row.quantity"
|
|
|
+ :precision="0"
|
|
|
+ :controls="false"
|
|
|
+ :min="1"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #countryId>
|
|
|
+ <div>
|
|
|
+ <el-select
|
|
|
+ v-model="formData.dataTwo.countryId"
|
|
|
+ placeholder="国家"
|
|
|
+ @change="(val) => getCityData(val, '20', true)"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in countryData"
|
|
|
+ :label="item.chineseName"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #provinceId>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <selectCity
|
|
|
+ placeholder="省/洲"
|
|
|
+ @change="(val) => getCityData(val, '30', true)"
|
|
|
+ addressId="provinceId"
|
|
|
+ addressName="provinceName"
|
|
|
+ v-model="formData.dataTwo"
|
|
|
+ :data="provinceData"
|
|
|
+ >
|
|
|
+ </selectCity>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #cityId>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <selectCity
|
|
|
+ placeholder="城市"
|
|
|
+ addressId="cityId"
|
|
|
+ addressName="cityName"
|
|
|
+ v-model="formData.dataTwo"
|
|
|
+ :data="cityData"
|
|
|
+ >
|
|
|
+ </selectCity>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </byForm>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="dialogVisibleTwo = false" size="large"
|
|
|
+ >取 消</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="submitFormTwo()"
|
|
|
+ size="large"
|
|
|
+ :loading="loadingTwo"
|
|
|
+ >
|
|
|
+ 确 定
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -269,7 +477,10 @@ import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
import byTable from "@/components/byTable/index";
|
|
|
import byForm from "@/components/byForm/index";
|
|
|
import { computed } from "vue";
|
|
|
+import selectCity from "@/components/selectCity/index.vue";
|
|
|
+
|
|
|
const loading = ref(false);
|
|
|
+const loadingTwo = ref(false);
|
|
|
const submitLoading = ref(false);
|
|
|
const sourceList = ref({
|
|
|
data: [],
|
|
@@ -281,6 +492,7 @@ const sourceList = ref({
|
|
|
});
|
|
|
const dialogVisible = ref(false);
|
|
|
const dialogVisibleOne = ref(false);
|
|
|
+const dialogVisibleTwo = ref(false);
|
|
|
const modalType = ref("add");
|
|
|
let rules = ref({
|
|
|
deliverGoodsId: [
|
|
@@ -293,7 +505,16 @@ let rules = ref({
|
|
|
deliverGoodsQuantity: [
|
|
|
{ required: true, message: "请输入本次发货", trigger: "blur" },
|
|
|
],
|
|
|
+ aa: [{ required: true, message: "请输入退货数量", trigger: "blur" }],
|
|
|
});
|
|
|
+
|
|
|
+let rulesTwo = ref({
|
|
|
+ contacts: [{ required: true, message: "请输入收件人", trigger: "blur" }],
|
|
|
+ phone: [{ required: true, message: "请输入联系电话", trigger: "blur" }],
|
|
|
+ countryId: [{ required: true, message: "请选择国家", trigger: "change" }],
|
|
|
+ quantity: [{ required: true, message: "请输入退货数量", trigger: "blur" }],
|
|
|
+});
|
|
|
+
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const arrivalStatus = [
|
|
|
{
|
|
@@ -444,6 +665,7 @@ const config = computed(() => {
|
|
|
let formData = reactive({
|
|
|
data: {},
|
|
|
dataOne: {},
|
|
|
+ dataTwo: {},
|
|
|
});
|
|
|
const formOption = reactive({
|
|
|
inline: true,
|
|
@@ -451,6 +673,7 @@ const formOption = reactive({
|
|
|
itemWidth: 100,
|
|
|
});
|
|
|
const byform = ref(null);
|
|
|
+const byformTwo = ref(null);
|
|
|
let formConfig = reactive([]);
|
|
|
let formConfigOne = computed(() => [
|
|
|
{
|
|
@@ -482,6 +705,82 @@ let formConfigOne = computed(() => [
|
|
|
},
|
|
|
]);
|
|
|
|
|
|
+let formConfigTwo = computed(() => [
|
|
|
+ {
|
|
|
+ type: "title",
|
|
|
+ title: "基础信息",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "supplyName",
|
|
|
+ label: "供应商",
|
|
|
+ disabled: true,
|
|
|
+ itemWidth: 50,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "purchaseCode",
|
|
|
+ label: "采购单号",
|
|
|
+ disabled: true,
|
|
|
+ itemWidth: 50,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "title",
|
|
|
+ title: "采购明细",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "detailSlot",
|
|
|
+ label: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "title",
|
|
|
+ title: "收获信息",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "contacts",
|
|
|
+ label: "收件人",
|
|
|
+ itemWidth: 20,
|
|
|
+ placeholder: "收件人",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "phone",
|
|
|
+ label: " ",
|
|
|
+ itemWidth: 80,
|
|
|
+ placeholder: "联系电话",
|
|
|
+ style: {
|
|
|
+ width: "30%",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "countryId",
|
|
|
+ prop: "countryId",
|
|
|
+ label: "收件地址",
|
|
|
+ itemWidth: 33.33,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "provinceId",
|
|
|
+ label: " ",
|
|
|
+ itemWidth: 33.33,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "cityId",
|
|
|
+ prop: "cityId",
|
|
|
+ label: " ",
|
|
|
+ itemWidth: 33.33,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "textarea",
|
|
|
+ prop: "detailedAddress",
|
|
|
+ },
|
|
|
+]);
|
|
|
+
|
|
|
const configData = [
|
|
|
[
|
|
|
{
|
|
@@ -656,6 +955,34 @@ const submitForm = () => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+const submitFormTwo = () => {
|
|
|
+ byformTwo.value.handleSubmit((valid) => {
|
|
|
+ loadingTwo.value = true;
|
|
|
+ const list = formData.dataTwo.purchaseBackDetailsList;
|
|
|
+ formData.dataTwo.purchaseBackDetailsList =
|
|
|
+ formData.dataTwo.purchaseBackDetailsList.map((x) => ({
|
|
|
+ purchaseDetailsId: x.id,
|
|
|
+ productId: x.bussinessId,
|
|
|
+ quantity: x.quantity,
|
|
|
+ }));
|
|
|
+ proxy.post("/purchaseBack/add", formData.dataTwo).then(
|
|
|
+ (res) => {
|
|
|
+ ElMessage({
|
|
|
+ message: `操作成功!`,
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ dialogVisibleTwo.value = false;
|
|
|
+ loadingTwo.value = false;
|
|
|
+ getList();
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ formData.dataTwo.purchaseBackDetailsList = list;
|
|
|
+ loadingTwo.value = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
const getDtl = (row) => {
|
|
|
modalType.value = "edit";
|
|
|
proxy.post("/productionProcesses/detail", { id: row.id }).then((res) => {
|
|
@@ -796,20 +1123,73 @@ const handleClickContractCode = (row) => {
|
|
|
};
|
|
|
|
|
|
const handleClickArrivalStatus = (row) => {
|
|
|
- // formData.dataOne = {
|
|
|
- // supplyName: row.supplyName,
|
|
|
- // purchaseCode: row.contractCode,
|
|
|
- // arrivalDetailList: [
|
|
|
- // {
|
|
|
- // shipmentQuantity: "3",
|
|
|
- // quantityList: [],
|
|
|
- // },
|
|
|
- // ],
|
|
|
- // };
|
|
|
- // dialogVisibleOne.value = true;
|
|
|
+ proxy
|
|
|
+ .post("/deliverGoods/arrivalDetail", { purchaseId: row.id })
|
|
|
+ .then((res) => {
|
|
|
+ formData.dataOne = {
|
|
|
+ supplyName: row.supplyName,
|
|
|
+ purchaseCode: row.contractCode,
|
|
|
+ purchaseDetailVoList: res.purchaseDetailVoList,
|
|
|
+ };
|
|
|
+ dialogVisibleOne.value = true;
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const handleReturnGoods = (row) => {
|
|
|
+ proxy.post("/purchase/detail", { id: row.id }).then((res) => {
|
|
|
+ formData.dataTwo = {
|
|
|
+ purchaseId: row.id,
|
|
|
+ supplyName: row.supplyName,
|
|
|
+ purchaseCode: row.contractCode,
|
|
|
+ countryId: "44",
|
|
|
+ purchaseBackDetailsList: res.purchaseDetailList.map((x) => ({
|
|
|
+ ...x,
|
|
|
+ planArrivalTime: res.planArrivalTime,
|
|
|
+ subscribeCode: res.subscribeCode,
|
|
|
+ })),
|
|
|
+ };
|
|
|
+ getCityData(formData.dataTwo.countryId, "20");
|
|
|
+ dialogVisibleTwo.value = true;
|
|
|
+ });
|
|
|
+};
|
|
|
+const countryData = ref([]);
|
|
|
+const provinceData = ref([]);
|
|
|
+const cityData = ref([]);
|
|
|
+
|
|
|
+const getCityData = (id, type, flag) => {
|
|
|
+ proxy.post("/customizeArea/list", { parentId: id }).then((res) => {
|
|
|
+ if (type === "20") {
|
|
|
+ provinceData.value = res;
|
|
|
+ if (flag) {
|
|
|
+ formData.data.provinceId = "";
|
|
|
+ formData.data.provinceName = "";
|
|
|
+ formData.data.cityId = "";
|
|
|
+ formData.data.cityName = "";
|
|
|
+ }
|
|
|
+ } else if (type === "30") {
|
|
|
+ cityData.value = res;
|
|
|
+ if (flag) {
|
|
|
+ formData.data.cityId = "";
|
|
|
+ formData.data.cityName = "";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ countryData.value = res;
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+const productUnit = ref([]);
|
|
|
+const getDict = () => {
|
|
|
+ proxy.getDictOne(["unit"]).then((res) => {
|
|
|
+ productUnit.value = res["unit"].map((x) => ({
|
|
|
+ label: x.dictValue,
|
|
|
+ value: x.dictKey,
|
|
|
+ }));
|
|
|
+ });
|
|
|
};
|
|
|
+getCityData("0");
|
|
|
getList();
|
|
|
getLogisticsData();
|
|
|
+getDict();
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|