瀏覽代碼

Merge remote-tracking branch 'remotes/origin/采购调整'

lxf 1 年之前
父節點
當前提交
b2e46141cb
共有 3 個文件被更改,包括 206 次插入31 次删除
  1. 48 4
      src/components/process/purchase.vue
  2. 129 12
      src/views/group/purchase/contract/index.vue
  3. 29 15
      src/views/group/purchase/supplier/index.vue

+ 48 - 4
src/components/process/purchase.vue

@@ -191,6 +191,15 @@
           </el-form-item>
         </div>
       </template>
+      <template #balancePayment>
+        <div style="width: 100%">{{ computeBalancePayment() }}</div>
+      </template>
+      <template #paymentDate>
+        <div style="width: 100%">
+          <span v-if="supplierData && supplierData.paymentType == 1">{{ formData.data.paymentDate }}</span>
+          <el-date-picker v-model="formData.data.paymentDate" type="date" placeholder="请选择" value-format="YYYY-MM-DD" v-else />
+        </div>
+      </template>
       <template #money>
         <div style="width: 100%">
           <div style="padding: 8px; background-color: #e9f5fb; font-size: 12px; font-weight: 700">
@@ -254,6 +263,10 @@ const formData = reactive({
     contract: "",
     purchaseBomList: [],
     fileList: [],
+    receiveProvince: "福建省",
+    receiveCity: "福州市",
+    receiveDetailedAddress: "福清市三山镇横坑村金园路18号3号楼",
+    receivePostcode: "350000",
   },
 });
 const judgeStatus = () => {
@@ -351,6 +364,18 @@ const formConfig = computed(() => {
       itemWidth: 33,
     },
     {
+      type: "slot",
+      slotName: "balancePayment",
+      label: "尾款 (%)",
+      itemWidth: 34,
+    },
+    {
+      type: "slot",
+      prop: "paymentDate",
+      slotName: "paymentDate",
+      label: "付款日期",
+    },
+    {
       type: "title",
       title: "款项金额",
       label: "",
@@ -401,6 +426,7 @@ const rules = ref({
   deliveryDate: [{ required: true, message: "请选择交付日期", trigger: "change" }],
   currency: [{ required: true, message: "请选择币种", trigger: "change" }],
   advancePayment: [{ required: true, message: "请输入预付款", trigger: "blur" }],
+  paymentDate: [{ required: true, message: "请选择付款日期", trigger: "change" }],
 });
 const getDemandData = () => {
   proxy.post("/supplier/page", { pageNum: 1, pageSize: 999 }).then((res) => {
@@ -427,17 +453,21 @@ const getDemandData = () => {
   });
 };
 getDemandData();
+const supplierData = ref({});
 const changeSupplier = () => {
   if (formData.data.supplierId) {
     let list = supplierList.value.filter((item) => item.id === formData.data.supplierId);
     if (list && list.length > 0) {
+      supplierData.value = list[0];
       formData.data.province = list[0].province;
       formData.data.city = list[0].city;
       formData.data.detailedAddress = list[0].detailedAddress;
       formData.data.contactPerson = list[0].contactPerson1;
       formData.data.contactNumber = list[0].contactNumber1;
+      formData.data.paymentDate = "到货后次月1号起" + list[0].nextMonthDays + "天内,结算费用";
     }
   } else {
+    supplierData.value = {};
     formData.data.province = "";
     formData.data.city = "";
     formData.data.detailedAddress = "";
@@ -474,10 +504,17 @@ const clickDelete = (index) => {
   formData.data.purchaseBomList.splice(index, 1);
 };
 const changeReceiveGoodsType = () => {
-  formData.data.receiveProvince = "";
-  formData.data.receiveCity = "";
-  formData.data.receiveDetailedAddress = "";
-  formData.data.receivePostcode = "";
+  if (formData.data.receiveGoodsType == 1) {
+    formData.data.receiveProvince = "福建省";
+    formData.data.receiveCity = "福州市";
+    formData.data.receiveDetailedAddress = "福清市三山镇横坑村金园路18号3号楼";
+    formData.data.receivePostcode = "350000";
+  } else {
+    formData.data.receiveProvince = "";
+    formData.data.receiveCity = "";
+    formData.data.receiveDetailedAddress = "";
+    formData.data.receivePostcode = "";
+  }
   formData.data.receiveContactPerson = "";
   formData.data.receiveContactNumber = "";
 };
@@ -660,6 +697,13 @@ onMounted(() => {
     });
   }
 });
+const computeBalancePayment = () => {
+  let num = 100;
+  if (formData.data.advancePayment) {
+    num = Number(Math.round((num - formData.data.advancePayment) * 100) / 100);
+  }
+  return num + "%";
+};
 // 向父组件暴露
 defineExpose({ getFormData, handleSubmit });
 </script>

+ 129 - 12
src/views/group/purchase/contract/index.vue

@@ -80,6 +80,21 @@
             </template>
           </byTable>
         </el-tab-pane>
+        <el-tab-pane label="采购明细" name="third">
+          <byTable
+            :source="sourceListThree.data"
+            :pagination="sourceListThree.pagination"
+            :config="configThree"
+            :loading="loading"
+            :searchConfig="searchConfigThree"
+            highlight-current-row
+            @get-list="getListThree"
+            @clickReset="clickResetThree">
+            <template #size="{ item }">
+              <span>{{ `${item.length} * ${item.width} * ${item.height}` }}</span>
+            </template>
+          </byTable>
+        </el-tab-pane>
       </el-tabs>
     </el-card>
 
@@ -115,7 +130,6 @@
                 <th style="width: 100px">品号</th>
                 <th style="width: 280px">产品名称</th>
                 <th style="width: 45px">数量</th>
-                <!-- <th style="width: 45px">单位</th> -->
                 <th style="width: 45px">单价</th>
                 <th style="width: 60px">金额</th>
                 <th style="width: 110px">交货期</th>
@@ -134,9 +148,6 @@
                   <td>
                     <span>{{ item.purchaseQuantity }}</span>
                   </td>
-                  <!-- <td>
-                    <span>{{ item.bomCompany }}</span>
-                  </td> -->
                   <td>
                     <span>{{ item.unitPrice }}</span>
                   </td>
@@ -152,7 +163,6 @@
                 <td>合计:</td>
                 <td colspan="2"></td>
                 <td>{{ computeQuantity() }}</td>
-                <!-- <td colspan="2"></td> -->
                 <td></td>
                 <td>
                   <span>{{ moneyFormat(pdfDetail.purchaseContract.totalAmountIncludingTax, 2) }}</span>
@@ -176,12 +186,6 @@
                     <span>需方(签章):福清市胜德体育用品有限公司</span>
                   </div>
                   <div style="position: absolute; top: -50px; left: 20px">
-                    <!-- <img
-                      v-if="pdfDetail.company.companySeal"
-                      style="width: 160px; height: 160px"
-                      :src="pathPrefix + pdfDetail.company.companySeal"
-                      alt=""
-                      srcset="" /> -->
                     <img
                       style="width: 160px; height: 160px"
                       :src="'http://www.printmat.cn:8181/file/upload/2023/02/24/20230224180954A0974981a85a2400425eb03c2c3f588a9711.png'"
@@ -275,6 +279,17 @@ const sourceListTwo = ref({
     supplierName: "",
   },
 });
+const sourceListThree = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    purchaseCode: "",
+    bomSpecCode: "",
+    bomSpecName: "",
+  },
+});
 const loading = ref(false);
 const searchConfig = computed(() => {
   return [
@@ -310,6 +325,25 @@ const searchConfigTwo = computed(() => {
     },
   ];
 });
+const searchConfigThree = computed(() => {
+  return [
+    {
+      type: "input",
+      prop: "purchaseCode",
+      label: "采购单号",
+    },
+    {
+      type: "input",
+      prop: "bomSpecCode",
+      label: "BOM品号",
+    },
+    {
+      type: "input",
+      prop: "bomSpecName",
+      label: "BOM品名",
+    },
+  ];
+});
 const config = computed(() => {
   return [
     {
@@ -533,6 +567,66 @@ const configTwo = computed(() => {
     },
   ];
 });
+const configThree = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "采购单号",
+        prop: "purchaseCode",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "BOM品号",
+        prop: "bomSpecCode",
+        width: 180,
+      },
+    },
+    {
+      attrs: {
+        label: "BOM品名",
+        prop: "bomSpecName",
+        "min-width": 240,
+      },
+    },
+    {
+      attrs: {
+        label: "尺寸(长宽高,cm)",
+        slot: "size",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "采购数量",
+        prop: "purchaseQuantity",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
+        label: "已到货数量",
+        prop: "arrivalQuantity",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
+        label: "在途数量",
+        prop: "inTransitQuantity",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
+        label: "已退货数量",
+        prop: "returnQuantity",
+        width: 120,
+      },
+    },
+  ];
+});
 const getList = (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
@@ -568,11 +662,34 @@ const getListTwo = (req, status) => {
 const clickResetTwo = () => {
   getListTwo("", true);
 };
+const getListThree = (req, status) => {
+  if (status) {
+    sourceListThree.value.pagination = {
+      pageNum: sourceListThree.value.pagination.pageNum,
+      pageSize: sourceListThree.value.pagination.pageSize,
+    };
+  } else {
+    sourceListThree.value.pagination = { ...sourceListThree.value.pagination, ...req };
+  }
+  loading.value = true;
+  proxy.post("/purchaseBom/purchaseDetailsPage", sourceListThree.value.pagination).then((res) => {
+    sourceListThree.value.data = res.rows;
+    sourceListThree.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+const clickResetThree = () => {
+  getListThree("", true);
+};
 const changeActiveName = (val) => {
   if (val === "first") {
     getList();
-  } else {
+  } else if (val === "second") {
     getListTwo();
+  } else {
+    getListThree();
   }
 };
 const clickCode = (item) => {

+ 29 - 15
src/views/group/purchase/supplier/index.vue

@@ -27,6 +27,30 @@
 
     <el-dialog :title="modalType == 'add' ? '添加供应商' : '编辑供应商'" v-if="openDialog" v-model="openDialog" width="900">
       <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
+        <template #paymentType>
+          <div style="width: 100%; display: flex">
+            <el-form-item label="付款日期" prop="paymentType">
+              <el-radio-group v-model="formData.data.paymentType">
+                <el-radio :label="0">现结</el-radio>
+                <el-radio :label="1">月结</el-radio>
+              </el-radio-group>
+            </el-form-item>
+            <div style="padding-left: 10px">到货后次月1号起</div>
+            <el-form-item
+              label-width="0"
+              prop="nextMonthDays"
+              :rules="[{ required: formData.data.paymentType === 1 ? true : false, message: '请输入天数', trigger: 'blur' }]">
+              <el-input-number
+                onmousewheel="return false;"
+                v-model="formData.data.nextMonthDays"
+                placeholder="请输入"
+                :controls="false"
+                :min="0"
+                :precision="0" />
+            </el-form-item>
+            <div>天内,结算费用</div>
+          </div>
+        </template>
         <template #contactPerson1>
           <div style="width: 100%">
             <el-row :gutter="10">
@@ -116,13 +140,6 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "账期",
-        prop: "paymentPeriod",
-        width: 120,
-      },
-    },
-    {
-      attrs: {
         label: "电话",
         prop: "companyTelephone",
         width: 160,
@@ -245,14 +262,6 @@ const formConfig = computed(() => {
       prop: "companyTelephone",
       label: "公司电话",
       itemType: "text",
-      itemWidth: 50,
-    },
-    {
-      type: "input",
-      prop: "paymentPeriod",
-      label: "账期",
-      itemType: "text",
-      itemWidth: 50,
     },
     {
       type: "input",
@@ -281,6 +290,10 @@ const formConfig = computed(() => {
       itemType: "text",
     },
     {
+      type: "slot",
+      slotName: "paymentType",
+    },
+    {
       type: "title",
       title: "联系人信息",
       label: "",
@@ -330,6 +343,7 @@ const formConfig = computed(() => {
 });
 const rules = ref({
   name: [{ required: true, message: "请输入供应商名称", trigger: "blur" }],
+  paymentType: [{ required: true, message: "请选择付款日期", trigger: "change" }],
 });
 const clickModal = () => {
   modalType.value = "add";