cz 2 жил өмнө
parent
commit
5bbececa4a

+ 18 - 0
src/api/process/index.js

@@ -0,0 +1,18 @@
+import request from '@/router/axios'
+
+// 流程记录
+export function exampleInfo(data = {}) {
+  return request({
+    url: '/api/victoriatourist/service-flow/exampleInfo/record',
+    method: 'post',
+    data: data,
+  })
+}
+
+export function exampleInfoShowFlow(data = {}) {
+  return request({
+    url: '/api/victoriatourist/service-flow/exampleInfo/showFlow',
+    method: 'post',
+    data: data,
+  })
+}

+ 112 - 0
src/components/process/purchase/purchaseDetails.vue

@@ -0,0 +1,112 @@
+<template>
+  <div>
+    <el-form :model="form" label-position="left" v-loading="loading">
+      <div style="margin-bottom: 20px">
+        <labelTitle content="基本信息"></labelTitle>
+      </div>
+      <div style="padding: 0px 20px">
+        <el-row :gutter="10">
+          <el-col :span="12">
+            <el-form-item label="供应商:" prop="supplierName">
+              <span>{{ form.supplierName }}</span>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="采购单号:" prop="code">
+              <span>
+                {{ form.code }}
+              </span>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </div>
+
+      <div style="margin-bottom: 20px">
+        <labelTitle content="采购明细"></labelTitle>
+      </div>
+      <div style="padding: 0px 20px">
+        <el-table :data="form.goodsList">
+          <el-table-column label="申购单号" prop="code" />
+          <el-table-column
+            label="要求到货时间"
+            prop="planArrivalTime"
+            width="150"
+          />
+          <el-table-column label="物品类型" prop="goodsType" :formatter="(row)
+          => dictDataEcho(row.goodsType, productTypeList)" / >
+          <el-table-column label="物品编码" prop="goodsCode" />
+          <el-table-column label="物品名称" prop="goodsName" />
+          <el-table-column label="物品单位" prop="goodsUnit" width="80" />
+          <el-table-column label="单价" prop="unitPrice" width="100" />
+          <el-table-column label="采购数量" prop="quantity" width="120" />
+        </el-table>
+      </div>
+    </el-form>
+  </div>
+</template>
+
+<script>
+import labelTitle from "@/components/label-title/index.vue";
+import { purchaseDetails } from "@/api/purchase-management/purchase/index.js";
+import { supplySelect } from "@/api/product-material/supply/index.js";
+
+export default {
+  props: {
+    rowData: {
+      type: Object,
+    },
+  },
+  components: {
+    labelTitle,
+  },
+  data() {
+    return {
+      loading: true,
+      form: {},
+      supplySelectList: [],
+      productTypeList: [],
+    };
+  },
+  created() {
+    const businessDictData = JSON.parse(
+      window.localStorage.getItem("businessDict")
+    );
+    this.productTypeList = businessDictData.find(
+      (item) => item.code === "productType"
+    ).children;
+  },
+  mounted() {
+    if (this.rowData.id) {
+      this.getDetails();
+    }
+  },
+  methods: {
+    async getDetails() {
+      this.loading = true;
+      const { data } = await supplySelect({ name: "", code: "", type: "" });
+      this.supplySelectList = data.data;
+      purchaseDetails({ id: this.rowData.id }).then((res) => {
+        this.getSupplierName(res.data.data.supplierId, res.data.data);
+      });
+    },
+    getSupplierName(id, data) {
+      const current = this.supplySelectList.find((x) => x.id === id);
+      if (current) {
+        this.form = {
+          ...data,
+          supplierName: current.name,
+        };
+        this.loading = false;
+      }
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+::v-deep {
+  .el-form-item {
+    margin-bottom: 5px;
+  }
+}
+</style>

+ 291 - 0
src/components/process/purchase/purchaseMake.vue

@@ -0,0 +1,291 @@
+<template>
+  <div v-loading="loading">
+    <div class="form-box">
+      <el-form
+        label-position="top"
+        :model="form"
+        ref="ruleForm"
+        :rules="formRules"
+        label-width="100px"
+      >
+        <div>
+          <labelTitle content="基本信息"></labelTitle>
+        </div>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item label="供应商" prop="supplierId">
+              <el-select
+                v-model="form.supplierId"
+                placeholder="请选择"
+                style="width: 100%"
+                @change="handleChangeSupply"
+              >
+                <el-option
+                  v-for="item in supplySelectList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                  <span style="float: left">{{
+                    `${item.name}(${dictDataEcho(item.type, supplyTypeList)})`
+                  }}</span>
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="备注" prop="flowRemark">
+              <el-input
+                v-model="form.flowRemark"
+                placeholder="请输入"
+                type="textarea"
+                rows="4"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <div style="margin-bottom: 20px">
+          <labelTitle content="采购明细"></labelTitle>
+        </div>
+
+        <el-form-item>
+          <el-table :data="form.goodsList">
+            <el-table-column label="物品编码" prop="goodsCode">
+            </el-table-column>
+            <el-table-column label="物品名称" prop="goodsName">
+            </el-table-column>
+            <el-table-column
+              label="物品类型"
+              prop="goodsType"
+              :formatter="(row) => dictDataEcho(row.goodsType, productTypeList)"
+            >
+            </el-table-column>
+            <el-table-column label="单位" prop="goodsUnit"> </el-table-column>
+            <el-table-column label="采购数量" prop="quantityOne">
+            </el-table-column>
+            <el-table-column label="已采购数量" prop="purchaseQuantity">
+            </el-table-column>
+            <el-table-column label="此次采购数量" prop="quantity">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="'goodsList.' + scope.$index + '.quantity'"
+                  :rules="formRules.quantity"
+                  :inline-message="true"
+                  label-width="0"
+                >
+                  <el-input-number
+                    v-model="scope.row.quantity"
+                    label="请输入"
+                    style="width: 100%"
+                    size="mini"
+                    :controls="false"
+                    :min="1"
+                    :max="9999999"
+                  >
+                  </el-input-number>
+                </el-form-item>
+              </template>
+            </el-table-column>
+
+            <el-table-column label="单价" prop="unitPrice">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="'goodsList.' + scope.$index + '.unitPrice'"
+                  :rules="formRules.unitPrice"
+                  :inline-message="true"
+                  label-width="0"
+                >
+                  <el-input-number
+                    v-model="scope.row.unitPrice"
+                    label="请输入"
+                    style="width: 100%"
+                    size="mini"
+                    :controls="false"
+                    :min="1"
+                    :max="9999999"
+                  >
+                  </el-input-number>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column label="小计" prop="sum">
+              <template slot-scope="scope">
+                <div>
+                  {{ (scope.row.quantity * scope.row.unitPrice).toFixed(2) }}
+                </div>
+              </template>
+            </el-table-column>
+
+            <el-table-column label="操作" width="100" align="left">
+              <template slot-scope="scope">
+                <el-button type="text" @click="deleteRow(scope.$index)"
+                  >删除</el-button
+                >
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-form-item>
+      </el-form>
+    </div>
+  </div>
+</template>
+
+<script>
+import labelTitle from "@/components/label-title/index.vue";
+import { getSupplierPrice } from "@/api/purchase-management/purchase/index.js";
+import { supplyPriceList } from "@/api/product-material/supply/priceMaintenance.js";
+import { supplySelect } from "@/api/product-material/supply/index.js";
+
+import { getToken } from "@/util/auth";
+
+export default {
+  name: "addPurchase",
+  components: { labelTitle },
+  props: {
+    form: {
+      type: Object,
+      default: () => {},
+    },
+  },
+  data() {
+    return {
+      uploadHeader: {
+        Authorization: "Basic c2FiZXI6c2FiZXJfc2VjcmV0",
+        "Blade-Auth": "bearer " + getToken(),
+      },
+      supplySelectList: [],
+      supplyTypeList: [],
+      productTypeList: [],
+      loading: false,
+      formRules: {
+        supplierId: [
+          {
+            required: true,
+            message: "请选择供应商",
+            trigger: "change",
+          },
+        ],
+        quantity: [
+          {
+            required: true,
+            message: "请输入采购数量",
+            trigger: "blur",
+          },
+        ],
+        unitPrice: [
+          {
+            required: true,
+            message: "请输入单价",
+            trigger: "blur",
+          },
+        ],
+      },
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        keyword: "",
+        supplierId: "",
+        materialId: "",
+        supplierName: "",
+        materialName: "",
+        materialCode: "",
+        materialType: "",
+      },
+      tableList: [],
+      priceData: {},
+    };
+  },
+  created() {
+    // supplyPriceList(this.queryParams).then(
+    //   (res) => {
+    //     this.tableList = res.data.data.records;
+    //   },
+    //   (err) => {
+    //     console.log("supplyPriceList: " + err);
+    //   }
+    // );
+    const businessDictData = JSON.parse(
+      window.localStorage.getItem("businessDict")
+    );
+    this.productTypeList = businessDictData.find(
+      (item) => item.code === "productType"
+    ).children;
+    this.supplyTypeList = businessDictData.find(
+      (item) => item.code === "supplyType"
+    ).children;
+
+    supplySelect({ name: "", code: "", type: "" }).then((res) => {
+      this.supplySelectList = res.data.data;
+    });
+  },
+  methods: {
+    handleSubmit() {
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          const data = [...this.form.goodsList];
+          for (let i = 0; i < data.length; i++) {
+            const e = data[i];
+            if (Number(e.assw) + Number(e.quantity) > Number(e.quantity)) {
+              return this.msgInfo("此次采购数量和已采购数量合不可大于采购数量");
+            }
+          }
+          this.loading = true;
+          this.$emit("submit");
+        }
+      });
+    },
+    handleCancel() {
+      this.$emit("cancel");
+    },
+    handleChange() {},
+    deleteRow(index) {
+      if (this.form.goodsList.length === 1) {
+        return this.msgInfo("已经是最后一条数据啦!");
+      }
+      this.form.goodsList.splice(index, 1);
+      this.msgSuccess("删除成功");
+    },
+    handleChangeSupply(val) {
+      const productIdList = this.form.goodsList.map((x) => {
+        return x.goodsId;
+      });
+      getSupplierPrice({ supplierId: val, productIdList }).then((res) => {
+        const priceData = res.data.data;
+        for (let i = 0; i < this.form.goodsList.length; i++) {
+          const x = this.form.goodsList[i];
+          if (Object.keys(priceData).length > 0) {
+            for (const key in priceData) {
+              if (x.goodsId === key) {
+                this.form.goodsList[i].unitPrice = priceData[key];
+              }
+            }
+          } else {
+            this.form.goodsList[i].unitPrice = "";
+          }
+        }
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+// .form-box {
+//   height: calc(100vh - 280px);
+//   overflow: auto;
+//   box-sizing: border-box;
+//   padding: 10px;
+// }
+::v-deep {
+  .el-form-item {
+    margin-bottom: 3px;
+  }
+  .el-form--label-top .el-form-item__label {
+    padding: 8px 0 0 0;
+  }
+}
+</style>

+ 21 - 6
src/views/inbound-outbound/arrivalInspection/addInspection.vue

@@ -54,12 +54,16 @@
                   :inline-message="true"
                   label-width="0"
                 >
-                  <el-input
+                  <el-input-number
                     v-model="scope.row.qualifiedQuantity"
-                    placeholder="请输入"
+                    label="请输入"
+                    style="width: 100%"
                     size="mini"
+                    :controls="false"
+                    :min="0"
+                    :max="9999"
                   >
-                  </el-input>
+                  </el-input-number>
                 </el-form-item>
               </template>
             </el-table-column>
@@ -75,12 +79,16 @@
                   :inline-message="true"
                   label-width="0"
                 >
-                  <el-input
+                  <el-input-number
                     v-model="scope.row.disqualificationQuantity"
-                    placeholder="请输入"
+                    label="请输入"
+                    style="width: 100%"
                     size="mini"
+                    :controls="false"
+                    :min="0"
+                    :max="9999"
                   >
-                  </el-input>
+                  </el-input-number>
                 </el-form-item>
               </template>
             </el-table-column>
@@ -165,6 +173,13 @@ export default {
         if (valid) {
           for (let i = 0; i < this.form.changeProductList.length; i++) {
             if (
+              this.form.changeProductList[i].qualifiedQuantity +
+                this.form.changeProductList[i].disqualificationQuantity ===
+              0
+            ) {
+              return this.msgInfo("质检合格和质检不合格总合不能为0");
+            }
+            if (
               Number(this.form.changeProductList[i].qualifiedQuantity) +
                 Number(
                   this.form.changeProductList[i].disqualificationQuantity

+ 1 - 1
src/views/inbound-outbound/outbound/manualOutbound/index.vue

@@ -119,7 +119,7 @@ export default {
     handleSubmit() {
       API.manualOutbound(this.form).then(
         () => {
-          this.msgSuccess("添加成功");
+          this.msgSuccess("出库成功");
           this.$refs.addManualOutbound.loading = false;
           this.open = false;
           this.getList();

+ 60 - 33
src/views/process/examinationApproval/index.vue

@@ -7,7 +7,14 @@
   >
     <el-row>
       <el-col :span="18" style="padding-right: 5px">
-        <el-card class="card-top"> </el-card>
+        <el-card class="card-top">
+          <PurchaseMake
+            :form="transferParams.detailsData"
+            ref="make"
+            v-if="startStatus"
+          ></PurchaseMake>
+          <PurchaseDetails :rowData="transferParams" v-else></PurchaseDetails>
+        </el-card>
         <div style="height: 10px"></div>
         <el-card class="card-bottom">
           <labelTitle content="操作"></labelTitle>
@@ -79,12 +86,25 @@
 <script>
 import labelTitle from "@/components/label-title/index.vue";
 import ApprovalRecords from "./approvalRecords";
+//采购
+import PurchaseMake from "@/components/process/purchase/purchaseMake.vue";
+import PurchaseDetails from "@/components/process/purchase/purchaseDetails.vue";
+
+import { exampleInfo, exampleInfoShowFlow } from "@/api/process";
+
+import {
+  sendPurchase,
+  purchaseApproval,
+} from "@/api/purchase-management/purchase/index.js";
 
 export default {
   name: "examinationApproval",
   components: {
     labelTitle,
     ApprovalRecords,
+
+    PurchaseMake,
+    PurchaseDetails,
   },
   data() {
     return {
@@ -111,6 +131,12 @@ export default {
   created() {
     //接收页面参数
     this.transferParams = this.$route.query;
+    if (this.$route.query.detailsData) {
+      this.transferParams.detailsData = JSON.parse(
+        this.$route.query.detailsData
+      );
+    }
+
     if (this.transferParams.processInstanceId) {
       exampleInfo({ flowLinkNo: this.transferParams.id }).then((res) => {
         this.recordsList = res.data.data;
@@ -154,46 +180,47 @@ export default {
       if (this.startStatus) {
         this.$refs.make.$refs.ruleForm.validate((valid) => {
           if (valid) {
+            if (this.transferParams.flowCode === "PURCHASE_CONTRACT") {
+              const data = this.$refs.make.form;
+              sendPurchase(data).then(
+                () => {
+                  this.msgSuccess("发起成功");
+                  this.clickCancel();
+                },
+                (err) => {
+                  console.log("sendPurchase: " + err);
+                }
+              );
+            }
           }
         });
       } else {
+        this.$refs.ruleForm.validate((valid) => {
+          if (valid) {
+            if (this.transferParams.flowCode === "PURCHASE_CONTRACT") {
+              purchaseApproval({
+                id: this.transferParams.id,
+                buttonId: ID,
+                flowRemark: this.form.flowRemark,
+              }).then(
+                () => {
+                  this.msgSuccess("审批成功");
+                  this.clickCancel();
+                },
+                (err) => {
+                  console.log("purchaseApproval: " + err);
+                }
+              );
+            }
+          }
+        });
       }
     },
     clickCancel() {
-      this.$store.dispatch("delView", this.$route);
-      if (
-        this.transferParams.processInstanceId &&
-        !this.transferParams.status
-      ) {
+      if (this.transferParams.flowCode === "PURCHASE_CONTRACT") {
         this.$router.replace({
-          path: "/process/backlog/index",
+          path: "/purchase-management/purchase/index",
         });
-      } else {
-        if (this.transferParams.flowCode === "FUNDS") {
-          this.$router.replace({
-            path: "/tenant/finance/funds/index",
-          });
-        } else if (this.transferParams.flowCode === "APPLY") {
-          this.$router.replace({
-            path: "/supplyChain/purchasingManagement/purchase/index",
-          });
-        } else if (this.transferParams.flowCode === "PURCHASE") {
-          this.$router.replace({
-            path: "/supplyChain/purchasingManagement/awaitPurchase/index",
-          });
-        } else if (this.transferParams.flowCode === "RETURN") {
-          this.$router.replace({
-            path: "/supplyChain/purchasingManagement/salesReturn/index",
-          });
-        } else if (this.transferParams.flowCode === "REPORT_PRICE") {
-          this.$router.replace({
-            path: "/tenant/trading/quotationManagement/index",
-          });
-        } else if (this.transferParams.flowCode === "PAYMENT_GOODS") {
-          this.$router.replace({
-            path: "/tenant/wms/cgPayment/index",
-          });
-        }
       }
     },
   },

+ 13 - 0
src/views/purchase-management/deliver-goods/index.vue

@@ -301,6 +301,16 @@ export default {
     handleCancelBack() {
       this.backDialog = false;
     },
+    handleExamine(row) {
+      this.$router.push({
+        path: "/process/examinationApproval/index",
+        query: {
+          id: row.id,
+          processInstanceId: row.processInstanceId || "",
+          flowCode: "PURCHASE_CONTRACT",
+        },
+      });
+    },
   },
 };
 </script>
@@ -377,6 +387,9 @@ export default {
               <el-button type="text" @click="handlePurchaseCancel(scope.row)"
                 >取消
               </el-button>
+              <el-button type="text" @click="handleExamine(scope.row)"
+                >审批
+              </el-button>
             </div>
           </template>
         </el-table-column>

+ 12 - 2
src/views/purchase-management/purchase/index.vue

@@ -190,8 +190,18 @@ export default {
         supplierId: "",
         goodsList: arr,
       };
-      this.titleText = "add";
-      this.open = true;
+      // this.titleText = "add";
+      // this.open = true;
+
+      this.$router.push({
+        path: "/process/examinationApproval/index",
+        query: {
+          id: "",
+          processInstanceId: "",
+          flowCode: "PURCHASE_CONTRACT",
+          detailsData: JSON.stringify({ ...this.form }),
+        },
+      });
     },
     handleCancel() {
       this.form = {