Selaa lähdekoodia

Merge branch 'master' of http://36.137.93.232:3000/hf/byte-sailing-new

lxf 2 vuotta sitten
vanhempi
commit
88c34602c4

+ 4 - 4
src/components/WDLY/process/SendPurchaseWDLY.vue

@@ -499,14 +499,14 @@ const handleChangeAmount = () => {
   let sum = 0;
   for (let i = 0; i < formData.data.purchaseDetailList.length; i++) {
     const e = formData.data.purchaseDetailList[i];
-    e.amount = e.count * e.price;
-    sum += e.amount;
+    e.amount = parseFloat(e.count * e.price).toFixed(4);
+    sum += Number(e.amount);
   }
   for (let i = 0; i < formData.data.otherFeeList.length; i++) {
     const e = formData.data.otherFeeList[i];
-    sum += e.price;
+    sum += Number(e.price);
   }
-  formData.data.amount = sum;
+  formData.data.amount = parseFloat(sum).toFixed(4);
 };
 
 const productUnit = ref([]);

+ 407 - 27
src/views/WDLY/purchaseManage/alreadyPurchase/index.vue

@@ -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>

+ 7 - 7
src/views/WDLY/purchaseManage/arrival/index.vue

@@ -334,12 +334,12 @@ const submitForm = () => {
     const list = formData.data.qualityDetailsList;
     for (let i = 0; i < list.length; i++) {
       const e = list[i];
-      if (!(e.qualifiedQuantity + e.disqualificationQuantity > 0)) {
-        return ElMessage({
-          message: "质检数量不能为0!",
-          type: "info",
-        });
-      }
+      // if (!(e.qualifiedQuantity + e.disqualificationQuantity > 0)) {
+      //   return ElMessage({
+      //     message: "质检数量不能为0!",
+      //     type: "info",
+      //   });
+      // }
       if (
         e.qualifiedQuantity +
           e.disqualificationQuantity +
@@ -351,7 +351,7 @@ const submitForm = () => {
           type: "info",
         });
       }
-      delete e.id
+      delete e.id;
     }
     submitLoading.value = true;
     proxy.post("/qualityInfo/" + modalType.value, formData.data).then(

+ 6 - 0
src/views/WDLY/purchaseManage/purchase/index.vue

@@ -236,6 +236,12 @@ const formConfig = computed(() => {
 });
 
 const getList = async (req) => {
+  if (req === undefined || req.status === "") {
+    req = {
+      ...req,
+      neStatus: "99",
+    };
+  }
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
   proxy

+ 11 - 3
src/views/WDLY/purchaseManage/subscribe/index.vue

@@ -110,12 +110,14 @@ const config = computed(() => {
         label: "申购单号",
         prop: "subscribeCode",
         slot: "code",
+        width: 110,
       },
     },
     {
       attrs: {
         label: "货品类型",
         prop: "productDefinition",
+        width: 80,
       },
       render(definition) {
         return definition == 1 ? "产品" : definition == 2 ? "物料" : "";
@@ -125,12 +127,14 @@ const config = computed(() => {
       attrs: {
         label: "所属分类",
         prop: "productCategory",
+        width: 100,
       },
     },
     {
       attrs: {
         label: "货品编码",
         prop: "productCustomCode",
+        width: 150,
       },
     },
     {
@@ -143,16 +147,17 @@ const config = computed(() => {
       attrs: {
         label: "单位",
         prop: "productUnit",
+        width: 60,
       },
       render(unit) {
         return proxy.dictValueLabel(unit, productUnit.value);
       },
     },
-
     {
       attrs: {
         label: "申购数量",
         prop: "count",
+        width: 110,
       },
     },
     {
@@ -171,18 +176,21 @@ const config = computed(() => {
       attrs: {
         label: "申购时间",
         prop: "createTime",
+        width: 155,
       },
     },
     {
       attrs: {
         label: "审批状态",
         prop: "count11",
+        width: 100,
       },
     },
     {
       attrs: {
         label: "状态",
         prop: "status",
+        width: 80,
       },
       render(status) {
         return statusData.value.find((x) => x.value == status).label;
@@ -191,8 +199,8 @@ const config = computed(() => {
     {
       attrs: {
         label: "操作",
-        width: "200",
-        align: "right",
+        width: "80",
+        align: "center",
       },
       // 渲染 el-button,一般用在最后一列。
       renderHTML(row) {

+ 1 - 0
src/views/process/processApproval/index.vue

@@ -508,6 +508,7 @@ onMounted(() => {
     box-sizing: border-box;
     .flow-chart {
       overflow: auto;
+      height: calc(100vh - 200px);
       padding: 0;
       margin: 0;
       li {