cz 2 лет назад
Родитель
Сommit
135bfd3c9d

+ 75 - 11
src/components/select-product/index.vue

@@ -1,26 +1,37 @@
 <template>
   <div v-loading="loading">
+    <query
+      :selectConfig="selectConfig"
+      :req="req"
+      :isShowMore="false"
+      @handleQuery="handleQuery"
+    ></query>
     <el-table :data="tableList">
       <el-table-column
         label="产品类型"
-        align="center"
+        align="left"
         prop="type"
         :formatter="(row) => dictDataEcho(row.type, productTypeList)"
       />
-      <el-table-column label="产品编码" align="center" prop="code" />
-      <el-table-column label="产品名称" align="center" prop="name" />
-      <el-table-column label="产品单位" align="center" prop="unit" />
-      <el-table-column label="部门" align="center" prop="deptName" />
-      <el-table-column label="生命周期" align="center" prop="lifeCycle" />
+      <el-table-column label="产品编码" align="left" prop="code" />
+      <el-table-column label="产品名称" align="left" prop="name" />
+      <el-table-column label="产品单位" align="left" prop="unit" />
+      <el-table-column label="部门" align="left" prop="deptName" />
+      <el-table-column
+        label="生命周期"
+        align="left"
+        prop="lifeCycle"
+        :formatter="(row) => dictDataEcho(row.lifeCycle, lifeCycleList)"
+      />
       <el-table-column
         label="当前周期销量"
-        align="center"
+        align="left"
         prop="cycleSales"
         width="120"
       />
-      <el-table-column label="京东供价" align="center" prop="jdPurchasePrice" />
-      <el-table-column label="标准售价" align="center" prop="sellingPrice" />
-      <el-table-column label="标准采购价" align="center" prop="purchasePrice" />
+      <el-table-column label="京东供价" align="left" prop="jdPurchasePrice" />
+      <el-table-column label="标准售价" align="left" prop="sellingPrice" />
+      <el-table-column label="标准采购价" align="left" prop="purchasePrice" />
 
       <el-table-column label="操作" align="center" width="80">
         <template slot-scope="scope">
@@ -30,18 +41,56 @@
         </template>
       </el-table-column>
     </el-table>
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="req.pageNum"
+      :limit.sync="req.pageSize"
+      @pagination="getList"
+    />
   </div>
 </template>
 
 <script>
 import { productList } from "@/api/product-material/product/index.js";
+import query from "@/components/query/index.vue";
 
 export default {
+  name: "SelectProduct",
+  components: {
+    query,
+  },
   data() {
     return {
       loading: false,
+      req: {
+        pageNum: 1,
+        pageSize: 10,
+        type: "",
+        lifeCycle: "",
+        definition: "2",
+      },
       tableList: [],
+      total: 0,
       productTypeList: [],
+      lifeCycleList: [],
+      selectConfig: [
+        {
+          label: "产品类型",
+          prop: "type",
+          data: [],
+        },
+        // {
+        //   label: this.$t("product_material.product.deptId"),
+        //   prop: "deptId",
+        //   data: [],
+        // },
+        {
+          label: "生命周期",
+          prop: "lifeCycle",
+          data: [],
+        },
+      ],
     };
   },
   created() {
@@ -51,12 +100,23 @@ export default {
     this.productTypeList = businessDictData.find(
       (item) => item.code === "productType"
     ).children;
+    this.selectConfig[0].data = this.productTypeList.map((item) => ({
+      label: item.dictValue,
+      value: item.dictKey,
+    }));
+    this.lifeCycleList = businessDictData.find(
+      (item) => item.code === "lifeCycle"
+    ).children;
+    this.selectConfig[1].data = this.lifeCycleList.map((item) => ({
+      label: item.dictValue,
+      value: item.dictKey,
+    }));
     this.getList();
   },
   methods: {
     getList() {
       this.loading = true;
-      productList({ pageNum: 1, pageSize: 999 }).then(
+      productList(this.req).then(
         (res) => {
           this.tableList = res.data.data.records;
           this.total = res.data.data.total;
@@ -71,6 +131,10 @@ export default {
     handleSelect(row) {
       this.$emit("select", row);
     },
+    handleQuery() {
+      console.log(this.req, "sss");
+      this.getList();
+    },
   },
 };
 </script>

+ 11 - 3
src/views/inbound-outbound/inbound/cgInbound/purchaseInbound.vue

@@ -57,12 +57,14 @@
                   :inline-message="true"
                   label-width="0"
                 >
-                  <el-input
+                  <el-input-number
                     v-model="scope.row.changeQuantity"
+                    :controls="false"
                     placeholder="请输入"
                     size="mini"
+                    style="width: 100%"
                   >
-                  </el-input>
+                  </el-input-number>
                 </el-form-item>
               </template>
             </el-table-column>
@@ -142,7 +144,7 @@ export default {
     };
   },
   created() {
-    this.getSelectList();
+    // this.getSelectList();
   },
   methods: {
     getSelectList() {
@@ -161,6 +163,12 @@ export default {
     handleSubmit() {
       this.$refs.form.validate((valid) => {
         if (valid) {
+          const sum = this.form.changeDetailsList.reduce((sum, x) => {
+            return sum + Number(x.changeQuantity);
+          }, 0);
+          if (sum < 1) {
+            return this.msgInfo("入库总数量不能为0");
+          }
           this.loading = true;
           this.form.changeDetailsList = this.form.changeDetailsList.map(
             (x) => ({

+ 31 - 29
src/views/purchase-management/deliver-goods/index.vue

@@ -28,14 +28,14 @@ export default {
       selectConfig: [
         {
           label: "发货状态",
-          prop: "type",
-          data: [],
-        },
-        {
-          label: "付款状态",
-          prop: "type",
+          prop: "status",
           data: [],
         },
+        // {
+        //   label: "付款状态",
+        //   prop: "type",
+        //   data: [],
+        // },
       ],
       tableList: [],
       total: 0,
@@ -75,10 +75,10 @@ export default {
       window.localStorage.getItem("businessDict")
     );
     this.purchaseStatusList = businessDictData.find(
-      (item) => item.code === "purchaseStatus"
+      (item) => item.code === "sendGoodsStatus"
     ).children;
     this.selectConfig[0].data = this.purchaseStatusList
-      .filter((x) => Number(x.dictKey) > 2)
+      .filter((x) => Number(x.dictKey) > 20)
       .map((item) => ({
         label: item.dictValue,
         value: item.dictKey,
@@ -185,21 +185,21 @@ export default {
       );
     },
     handleArrive(row) {
-      API.logisticsSelectData({ id: row.id }).then(
+      this.openArrive = true;
+      this.titleText = "到货通知";
+      API.logisticsSelectData({ businessId: row.id }).then(
         (res) => {
           this.logisticsData = res.data.data;
+          this.arriveForm = {
+            code: row.code,
+            supplierName: row.supplierName,
+            id: "",
+          };
         },
         (err) => {
           console.log("logisticsSelectData: " + err);
         }
       );
-      this.titleText = "到货通知";
-      this.openArrive = true;
-      this.arriveForm = {
-        code: row.code,
-        supplierName: row.supplierName,
-        id: "",
-      };
     },
     handlePurchaseEnd(row) {
       this.$confirm("是否确定此操作 ?", {
@@ -228,7 +228,7 @@ export default {
     handleSubmit1() {
       this.$refs.arriveForm.validate((valid) => {
         if (valid) {
-          API.arrivalNotice({ id: row.id }).then(() => {
+          API.arrivalNotice({ id: this.arriveForm.id }).then(() => {
             this.msgSuccess("操作成功");
             this.getList();
             this.handleCancel1();
@@ -319,18 +319,20 @@ export default {
         /> -->
         <el-table-column label="操作" align="center" width="240">
           <template slot-scope="scope">
-            <el-button type="text" @click="handleSend(scope.row)">
-              发货通知
-            </el-button>
-            <el-button type="text" @click="handleArrive(scope.row)"
-              >到货通知
-            </el-button>
-            <el-button type="text" @click="handlePurchaseEnd(scope.row)"
-              >结束
-            </el-button>
-            <el-button type="text" @click="handlePurchaseCancel(scope.row)"
-              >取消
-            </el-button>
+            <div v-if="scope.row.status !== 99 && scope.row.status !== 50">
+              <el-button type="text" @click="handleSend(scope.row)">
+                发货通知
+              </el-button>
+              <el-button type="text" @click="handleArrive(scope.row)"
+                >到货通知
+              </el-button>
+              <el-button type="text" @click="handlePurchaseEnd(scope.row)"
+                >结束
+              </el-button>
+              <el-button type="text" @click="handlePurchaseCancel(scope.row)"
+                >取消
+              </el-button>
+            </div>
           </template>
         </el-table-column>
       </el-table>