cz il y a 2 ans
Parent
commit
4e19cba265

+ 8 - 0
src/api/inbound-outbound/abnormalManage.js

@@ -17,3 +17,11 @@ export function addFollow(data = {}) {
     data: data,
   })
 }
+
+export function getRecords(data = {}) {
+  return request({
+    url: '/api/victoriatourist/abnormalDetails/page',
+    method: 'post',
+    data: data,
+  })
+}

+ 9 - 1
src/api/inventory-management/query.js

@@ -21,7 +21,7 @@ export function byProductList(data = {}) {
 }
 
 
-// 库存查询按产品列表 
+//  转良品
 export function badToGood(data = {}) {
   return request({
     url: '/api/victoriatourist/stock/defectiveToQualified',
@@ -29,3 +29,11 @@ export function badToGood(data = {}) {
     data: data,
   })
 }
+// 转次品
+export function badToBad(data = {}) {
+  return request({
+    url: '/api/victoriatourist/stock/qualifiedToDefective',
+    method: 'post',
+    data: data,
+  })
+}

+ 46 - 1
src/views/inbound-outbound/abnormalManage/index.vue

@@ -60,6 +60,8 @@ export default {
       },
       rowData: {},
       detailsDialog: false,
+      openRecords: false,
+      activities: [],
     };
   },
   created() {
@@ -139,6 +141,16 @@ export default {
       this.rowData = { ...row, id: row.linkId };
       this.detailsDialog = true;
     },
+    async lookRecords(row) {
+      this.msgSuccess("数据请求中,请稍后!");
+      const { data } = await API.getRecords({ abnormalInfoId: row.id });
+      if (data.data.records.length > 0) {
+        this.activities = data.data.records;
+        this.openRecords = true;
+      } else {
+        this.msgInfo("暂无跟进记录");
+      }
+    },
   },
 };
 </script>
@@ -229,7 +241,7 @@ export default {
           prop="handleTime"
           width="160"
         />
-        <el-table-column label="操作" align="center" width="160">
+        <el-table-column label="操作" align="center" width="240">
           <template slot-scope="scope">
             <el-button
               type="text"
@@ -240,6 +252,9 @@ export default {
             <el-button type="text" @click="openDetails(scope.row)">
               查看关联
             </el-button>
+            <el-button type="text" @click="lookRecords(scope.row)">
+              跟进记录
+            </el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -291,6 +306,36 @@ export default {
         v-if="rowData.type === 20 || rowData.type === 30"
       ></TransferDetails>
     </el-dialog>
+
+    <el-dialog
+      title="跟进记录"
+      :visible.sync="openRecords"
+      v-if="openRecords"
+      width="40%"
+      top="50px"
+    >
+      <!-- <div style="padding-left: 40px; margin-bottom: 20px">
+        <el-button size="mini" @click="handleAddRecord">
+          添加物流记录
+        </el-button>
+      </div> -->
+      <div>
+        <el-timeline :reverse="false">
+          <el-timeline-item
+            placement="top"
+            v-for="(activity, index) in activities"
+            :key="index"
+            :timestamp="activity.handleTime"
+          >
+            <div>
+              跟进人:{{ activity.handleUserName }}
+              <span>({{ activity.status ? "已完成" : "处理中" }})</span>
+            </div>
+            <div style="margin-top: 5px">跟进记录: {{ activity.explain }}</div>
+          </el-timeline-item>
+        </el-timeline>
+      </div>
+    </el-dialog>
   </div>
 </template>
 

+ 34 - 11
src/views/inventory-management/query/index.vue

@@ -47,6 +47,7 @@ export default {
           },
         ],
       },
+      submitType: null,
     };
   },
   created() {
@@ -119,8 +120,15 @@ export default {
       };
       this.handleQuery();
     },
-    handleTurn({ row }) {
-      const arr = row.defectiveQuantity.split(".");
+    handleTurn({ row }, type) {
+      this.submitType = type;
+      let arr = [];
+      if (type == 1) {
+        arr = row.defectiveQuantity.split(".");
+      } else {
+        arr = row.quantity.split(".");
+      }
+
       this.form = { id: row.stockId, canSum: arr[0], quantity: "" };
       this.open = true;
     },
@@ -128,14 +136,23 @@ export default {
       this.$refs.form.validate((valid) => {
         if (valid) {
           if (Number(this.form.quantity) > this.form.canSum) {
-            return this.msgInfo("数量不可大于次品数量");
+            return this.msgInfo("数量不可大于可转数量");
+          }
+          if (this.submitType == 1) {
+            const data = { ...this.form };
+            API.badToGood(data).then((res) => {
+              this.msgSuccess("操作成功!");
+              this.getList();
+              this.open = false;
+            });
+          } else {
+            const data = { ...this.form };
+            API.badToBad(data).then((res) => {
+              this.msgSuccess("操作成功!");
+              this.getList();
+              this.open = false;
+            });
           }
-          const data = { ...this.form };
-          API.badToGood(data).then((res) => {
-            this.msgSuccess("操作成功!");
-            this.getList();
-            this.open = false;
-          });
         }
       });
     },
@@ -187,14 +204,20 @@ export default {
             align="left"
             prop="defectiveQuantity"
           />
-          <el-table-column label="操作" align="center" width="100">
+          <el-table-column label="操作" align="center" width="180">
             <template slot-scope="scope">
               <el-button
                 type="text"
                 v-if="scope.row.defectiveQuantity !== '0.00'"
-                @click="handleTurn(scope)"
+                @click="handleTurn(scope, 1)"
                 >次品转良品</el-button
               >
+              <el-button
+                type="text"
+                v-if="scope.row.quantity !== '0.00'"
+                @click="handleTurn(scope, 2)"
+                >良品转次品</el-button
+              >
             </template>
           </el-table-column>
         </el-table>