cz 2 years ago
parent
commit
15eefe21ae

+ 20 - 0
src/api/getComDetails.js

@@ -0,0 +1,20 @@
+// 本js文件是处理详情页组件需要用到的详情接口
+import request from '@/router/axios';
+
+// 京东订单出库 详情
+export function getJDoutboundDetails(data = {}) {
+  return request({
+    url: '/api/service-flow/processInfo/page',
+    method: 'post',
+    data: data,
+  })
+}
+
+// 调仓 详情
+export function getTransferDetails(data = {}) {
+  return request({
+    url: '/api/service-flow/processInfo/page',
+    method: 'post',
+    data: data,
+  })
+}

+ 124 - 0
src/components/DetailsComponents/JDOutboundDetails.vue

@@ -0,0 +1,124 @@
+<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> 京东</span>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="订单类型:" prop="code">
+              <span> 京东 </span>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="出库类型:" prop="code">
+              <span> 京东订单 </span>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="10">
+          <el-col :span="12">
+            <el-form-item label="仓库名称:" prop="supplierName">
+              <span> 京东</span>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="预约号:" prop="code">
+              <span> 京东 </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="goodsCode" min-width="150" />
+          <el-table-column label="产品名称" prop="goodsName" min-width="150" />
+          <el-table-column label="规格" prop="goodsUnit" width="80" />
+          <el-table-column label="出库数量" prop="unitPrice" width="100" />
+        </el-table>
+      </div>
+      <div style="margin: 20px 0px">
+        <labelTitle content="物流信息"></labelTitle>
+      </div>
+      <div style="padding: 0px 20px">
+        <el-row :gutter="10">
+          <el-col :span="12">
+            <el-form-item label="物流/快递公司:" prop="supplierName">
+              <span> </span>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="物流/快递单号:" prop="code">
+              <span> </span>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </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 {
+  name: "JDOutboundDetails",
+  props: {
+    rowData: {
+      type: Object,
+    },
+  },
+  components: {
+    labelTitle,
+  },
+  data() {
+    return {
+      loading: false,
+      form: {},
+      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);
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+::v-deep {
+  .el-form-item {
+    margin-bottom: 5px;
+  }
+}
+</style>

+ 96 - 0
src/components/DetailsComponents/TransferDetails.vue

@@ -0,0 +1,96 @@
+<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>
+        <el-form-item label="调仓备注:" prop="supplierName">
+          <span>{{ form.supplierName }}</span>
+        </el-form-item>
+      </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="goodsCode" min-width="150" />
+          <el-table-column label="产品名称" prop="goodsName" min-width="150" />
+          <el-table-column label="规格" prop="goodsUnit" width="80" />
+          <el-table-column label="调仓数量" prop="unitPrice" width="100" />
+        </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 {
+  name: "TransferDetails",
+  props: {
+    rowData: {
+      type: Object,
+    },
+  },
+  components: {
+    labelTitle,
+  },
+  data() {
+    return {
+      loading: false,
+      form: {},
+      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);
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+::v-deep {
+  .el-form-item {
+    margin-bottom: 5px;
+  }
+}
+</style>

+ 203 - 23
src/components/process/purchase/purchaseMake.vue

@@ -11,7 +11,7 @@
         <div>
           <labelTitle content="基本信息"></labelTitle>
         </div>
-        <el-row>
+        <el-row :gutter="10">
           <el-col :span="8">
             <el-form-item label="供应商" prop="supplierId">
               <el-select
@@ -34,6 +34,32 @@
             </el-form-item>
           </el-col>
         </el-row>
+        <el-row :gutter="10">
+          <el-col :span="4">
+            <el-form-item label="是否合同" prop="isAgreement">
+              <el-radio-group v-model="form.isAgreement">
+                <el-radio label="1">是</el-radio>
+                <el-radio label="0">否</el-radio>
+              </el-radio-group>
+            </el-form-item>
+          </el-col>
+          <el-col :span="4">
+            <el-form-item label="付款方式" prop="paymentMethod">
+              <el-select
+                v-model="form.paymentMethod"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in paymentMethodList"
+                  :key="item.id"
+                  :label="item.dictValue"
+                  :value="item.dictKey"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
 
         <el-row>
           <el-col :span="12">
@@ -85,6 +111,7 @@
                     :controls="false"
                     :min="1"
                     :max="9999999"
+                    @change="changeTotalMoney"
                   >
                   </el-input-number>
                 </el-form-item>
@@ -105,8 +132,9 @@
                     style="width: 100%"
                     size="mini"
                     :controls="false"
-                    :min="1"
+                    :min="0"
                     :max="9999999"
+                    @change="changeTotalMoney"
                   >
                   </el-input-number>
                 </el-form-item>
@@ -120,7 +148,12 @@
               </template>
             </el-table-column>
 
-            <el-table-column label="操作" width="100" align="left">
+            <el-table-column
+              label="操作"
+              width="100"
+              align="center"
+              fixed="right"
+            >
               <template slot-scope="scope">
                 <el-button type="text" @click="deleteRow(scope.$index)"
                   >删除</el-button
@@ -129,6 +162,99 @@
             </el-table-column>
           </el-table>
         </el-form-item>
+
+        <div style="margin-top: 20px">
+          <labelTitle content="其他费用"></labelTitle>
+        </div>
+        <el-button
+          type="primary"
+          size="small"
+          style="margin: 20px 0 10px 0"
+          @click="handleAddOther"
+          >添加</el-button
+        >
+        <el-form-item>
+          <el-table :data="form.otherFeeList">
+            <el-table-column label="费用名称" prop="goodsUnit">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="'otherFeeList.' + scope.$index + '.name'"
+                  :rules="formRules.name"
+                  :inline-message="true"
+                  label-width="0px"
+                >
+                  <el-input
+                    v-model="scope.row.name"
+                    size="mini"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column label="费用金额" prop="quantityOne">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="'otherFeeList.' + scope.$index + '.price'"
+                  :rules="formRules.price"
+                  :inline-message="true"
+                  label-width="0px"
+                >
+                  <el-input-number
+                    v-model="scope.row.price"
+                    placeholder="请输入"
+                    size="mini"
+                    style="width: 100%"
+                    :controls="false"
+                    @change="changeTotalMoney"
+                  >
+                  </el-input-number>
+                </el-form-item>
+              </template>
+            </el-table-column>
+
+            <el-table-column label="备注" prop="remark">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="'otherFeeList.' + scope.$index + '.remark'"
+                  :rules="formRules.remark"
+                  :inline-message="true"
+                  size="mini"
+                  label-width="0px"
+                >
+                  <el-input
+                    v-model="scope.row.remark"
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="操作"
+              width="100"
+              align="center"
+              fixed="right"
+            >
+              <template slot-scope="scope">
+                <el-button type="text" @click="deleteOtherRow(scope.$index)"
+                  >删除</el-button
+                >
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-form-item>
+        <el-row>
+          <el-col :span="4">
+            <el-form-item label="总金额">
+              <el-input-number
+                v-model="form.totalPrice"
+                style="width: 100%"
+                disabled
+                :controls="false"
+              >
+              </el-input-number>
+            </el-form-item>
+          </el-col>
+        </el-row>
       </el-form>
     </div>
   </div>
@@ -183,31 +309,48 @@ export default {
             trigger: "blur",
           },
         ],
+        isAgreement: [
+          {
+            required: true,
+            message: "请选择是否合同",
+            trigger: "change",
+          },
+        ],
+        paymentMethod: [
+          {
+            required: true,
+            message: "请选择付款方式",
+            trigger: "change",
+          },
+        ],
+        name: [
+          {
+            required: true,
+            message: "请输入费用名称",
+            trigger: "blur",
+          },
+        ],
+        price: [
+          {
+            required: true,
+            message: "请输入费用金额",
+            trigger: "blur",
+          },
+        ],
+        // remark: [
+        //   {
+        //     required: true,
+        //     message: "请输入备注",
+        //     trigger: "blur",
+        //   },
+        // ],
       },
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        keyword: "",
-        supplierId: "",
-        materialId: "",
-        supplierName: "",
-        materialName: "",
-        materialCode: "",
-        materialType: "",
-      },
-      tableList: [],
       priceData: {},
+      otherForm: {},
+      paymentMethodList: [],
     };
   },
   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")
     );
@@ -218,10 +361,18 @@ export default {
       (item) => item.code === "supplyType"
     ).children;
 
+    this.paymentMethodList = businessDictData.find(
+      (item) => item.code === "paymentMethod"
+    ).children;
+
     supplySelect({ name: "", code: "", type: "" }).then((res) => {
       this.supplySelectList = res.data.data;
     });
   },
+  mounted() {
+    this.changeTotalMoney();
+    console.log(this.form, "wwws");
+  },
   methods: {
     // handleSubmit() {
     //   this.$refs.ruleForm.validate((valid) => {
@@ -267,6 +418,7 @@ export default {
       }
       this.form.goodsList.splice(index, 1);
       this.msgSuccess("删除成功");
+      this.changeTotalMoney();
     },
     handleChangeSupply(val) {
       const productIdList = this.form.goodsList.map((x) => {
@@ -286,8 +438,36 @@ export default {
             this.form.goodsList[i].unitPrice = "";
           }
         }
+        this.changeTotalMoney();
+      });
+    },
+    handleAddOther() {
+      this.form.otherFeeList.push({
+        name: "",
+        price: undefined,
+        remark: "",
       });
     },
+    deleteOtherRow(index) {
+      this.form.otherFeeList.splice(index, 1);
+      this.msgSuccess("删除成功");
+      this.changeTotalMoney();
+    },
+    changeTotalMoney() {
+      let productTotal = 0;
+      for (let i = 0; i < this.form.goodsList.length; i++) {
+        const e = this.form.goodsList[i];
+        let num = Number(e.quantity) * Number(e.unitPrice);
+        productTotal = productTotal + num;
+      }
+      let otherTotal = 0;
+      for (let i = 0; i < this.form.otherFeeList.length; i++) {
+        const e = this.form.otherFeeList[i];
+        otherTotal = otherTotal + Number(e.price);
+      }
+      this.form.totalPrice = productTotal + otherTotal;
+      this.$forceUpdate();
+    },
   },
 };
 </script>

+ 81 - 4
src/components/purchase/details.vue

@@ -26,16 +26,21 @@
       </div>
       <div style="padding: 0px 20px">
         <el-table :data="form.goodsList">
-          <el-table-column label="申购单号" prop="code" />
+          <el-table-column
+            label="申购单号"
+            prop="code"
+            min-width="150"
+            fixed="left"
+          />
           <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" />
+          => dictDataEcho(row.goodsType, productTypeList)" width="80" / >
+          <el-table-column label="物品编码" prop="goodsCode" min-width="150" />
+          <el-table-column label="物品名称" prop="goodsName" min-width="150" />
           <el-table-column label="物品单位" prop="goodsUnit" width="80" />
           <el-table-column label="单价" prop="unitPrice" width="100" />
           <el-table-column
@@ -43,6 +48,78 @@
             prop="purchaseQuantity"
             width="120"
           />
+          <el-table-column
+            label="已发货"
+            prop="shipmentTotalQuantity"
+            width="100"
+            fixed="right"
+          >
+            <template slot-scope="scope">
+              <el-popover
+                placement="bottom-start"
+                title="发货详情"
+                width="500"
+                trigger="hover"
+              >
+                <div slot>
+                  <el-table :data="scope.row.shipmentQuantityList">
+                    <el-table-column
+                      label="发货时间"
+                      prop="createTime"
+                      width="150"
+                    />
+                    <el-table-column label="物流单号" prop="code" />
+                    <el-table-column
+                      label="数量"
+                      prop="shipmentQuantity"
+                      width="100"
+                    />
+                  </el-table>
+                </div>
+                <span
+                  style="cursor: pointer; color: #0084ff"
+                  slot="reference"
+                  >{{ scope.row.shipmentTotalQuantity }}</span
+                >
+              </el-popover>
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="已到货"
+            prop="arrivalTotalQuantity"
+            width="100"
+            fixed="right"
+          >
+            <template slot-scope="scope">
+              <el-popover
+                placement="bottom-start"
+                title="到货详情"
+                width="500"
+                trigger="hover"
+              >
+                <div slot>
+                  <el-table :data="scope.row.arrivalQuantityList">
+                    <el-table-column
+                      label="到货时间"
+                      prop="updateTime"
+                      width="150"
+                    />
+                    <el-table-column label="物流单号" prop="code" />
+                    <el-table-column
+                      label="数量"
+                      prop="shipmentQuantity"
+                      width="100"
+                    />
+                  </el-table>
+                </div>
+                <span
+                  style="cursor: pointer; color: #0084ff"
+                  slot="reference"
+                  >{{ scope.row.arrivalTotalQuantity }}</span
+                >
+              </el-popover>
+            </template></el-table-column
+          >
         </el-table>
       </div>
       <div style="margin: 20px 0">

+ 69 - 0
src/views/inbound-outbound/abnormalManage/index.vue

@@ -6,10 +6,17 @@ import * as API from "@/api/inbound-outbound/abnormalManage.js";
 import addFollow from "./addFollow.vue";
 import { dateFormat } from "@/util/date.js";
 
+import PurchaseDetails from "@/components/purchase/details.vue";
+import JDOutboundDetails from "@/components/DetailsComponents/JDOutboundDetails.vue";
+import TransferDetails from "@/components/DetailsComponents/TransferDetails.vue";
+
 export default {
   components: {
     query,
     addFollow,
+    PurchaseDetails,
+    JDOutboundDetails,
+    TransferDetails,
   },
   data() {
     return {
@@ -49,6 +56,8 @@ export default {
         handleTime: "",
         nextHandleUser: "",
       },
+      rowData: {},
+      detailsDialog: false,
     };
   },
   created() {
@@ -123,6 +132,10 @@ export default {
       };
       this.open = true;
     },
+    openDetails(row) {
+      this.rowData = { ...row, id: row.linkId };
+      this.detailsDialog = true;
+    },
   },
 };
 </script>
@@ -150,6 +163,41 @@ export default {
           width="120"
           :formatter="(row) => dictDataEcho(row.type, abnormalSourceList)"
         />
+        <!-- <div class="show_underline" @click="openDetails(scope.row)">
+              {{ scope.row.linkCode }}
+            </div> -->
+        <!-- <el-table-column
+          label="关联单号"
+          align="left"
+          prop="linkCode"
+          width="150"
+        >
+          <template slot-scope="scope">
+         
+            <div
+              v-if="scope.row.type === 10"
+              class="show_underline"
+              @click="openDetails(scope.row)"
+            >
+              1
+            </div>
+            <div
+              v-if="scope.row.type === 20"
+              class="show_underline"
+              @click="openDetails(scope.row)"
+            >
+              2
+            </div>
+            <div
+              v-if="scope.row.type === 30"
+              class="show_underline"
+              @click="openDetails(scope.row)"
+            >
+              3
+            </div>
+          </template>
+        </el-table-column> -->
+
         <el-table-column label="异常说明" align="left" prop="title" />
         <el-table-column
           label="处理状态"
@@ -212,6 +260,27 @@ export default {
         ref="addFollow"
       ></add-follow>
     </el-dialog>
+
+    <el-dialog
+      title="异常详情"
+      v-if="detailsDialog"
+      :visible.sync="detailsDialog"
+      width="50%"
+      top="60px"
+    >
+      <PurchaseDetails
+        :rowData="rowData"
+        v-if="rowData.type === 10"
+      ></PurchaseDetails>
+      <JDOutboundDetails
+        :rowData="rowData"
+        v-if="rowData.type === 20"
+      ></JDOutboundDetails>
+      <TransferDetails
+        :rowData="rowData"
+        v-if="rowData.type === 30"
+      ></TransferDetails>
+    </el-dialog>
   </div>
 </template>
 

+ 10 - 10
src/views/inbound-outbound/arrivalInspection/addInspection.vue

@@ -172,18 +172,18 @@ export default {
       this.$refs.form.validate((valid) => {
         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].totalQuantity) > 0) {
+              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
-                ) >
+              this.form.changeProductList[i].qualifiedQuantity +
+                this.form.changeProductList[i].disqualificationQuantity >
               Number(this.form.changeProductList[i].totalQuantity)
             ) {
               return this.msgInfo("质检合格和质检不合格总合不能大于待质检数量");

+ 4 - 3
src/views/process/backlog/index.vue

@@ -46,14 +46,15 @@ export default {
         pageSize: 10,
       },
       loading: false,
-      tableList: [{}],
+      tableList: [],
       total: 0,
     };
   },
-  created() {},
-  mounted() {
+  created() {
     this.getList();
   },
+  mounted() {},
+  activated() {},
   methods: {
     getList() {
       this.loading = true;

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

@@ -148,7 +148,7 @@ export default {
       const goodsList = [
         {
           ...data,
-          unitPrice: "",
+          unitPrice: 0,
           sum: "",
           quantityOne: data.quantity,
           quantity: nowQuantity,
@@ -162,6 +162,16 @@ export default {
         code: "",
         supplierId: "",
         goodsList: goodsList,
+        isAgreement: "",
+        paymentMethod: "",
+        totalPrice: "",
+        otherFeeList: [
+          {
+            name: "",
+            price: 0,
+            remark: "",
+          },
+        ],
       };
       this.$router.push({
         path: "/process/examinationApproval/index",
@@ -181,7 +191,7 @@ export default {
       const arr = [...this.selectData];
       for (let i = 0; i < arr.length; i++) {
         const e = arr[i];
-        e.unitPrice = "";
+        e.unitPrice = 0;
         e.quantityOne = e.quantity;
         // 取出已采购数量
         let purchaseQuantity =
@@ -198,6 +208,16 @@ export default {
         code: "",
         supplierId: "",
         goodsList: arr,
+        isAgreement: "",
+        paymentMethod: "",
+        totalPrice: "",
+        otherFeeList: [
+          {
+            name: "",
+            price: 0,
+            remark: "",
+          },
+        ],
       };
       // this.titleText = "add";
       // this.open = true;