Просмотр исходного кода

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-wms into dev

liujt 8 месяцев назад
Родитель
Сommit
453413afdb

+ 187 - 174
src/views/warehouseManagement/inboundRequests/components/tgTable.vue

@@ -1,10 +1,18 @@
 <template>
   <div class="tgTable">
     <!-- 数据表格 -->
-    <ele-pro-table ref="table1" :columns="columns" height="calc(100vh-300px)" :pageSize="20" :datasource="datasource"
-      cache-key="workOrderTable">
+    <ele-pro-table
+      ref="table1"
+      :columns="columns"
+      height="calc(100vh-300px)"
+      :pageSize="20"
+      :datasource="datasource"
+      cache-key="workOrderTable"
+    >
       <template v-slot:code="{ row }">
-        <el-link type="primary" :underline="false" @click="details(row)">{{ row.code }}</el-link>
+        <el-link type="primary" :underline="false" @click="details(row)">{{
+          row.code
+        }}</el-link>
       </template>
       <template v-slot:totalCount="{ row }">
         {{ row.totalCount }} {{ row.measuringUnit }}
@@ -28,7 +36,11 @@
       </template>
 
       <template v-slot:action="{ row }">
-        <el-link type="primary" :underline="false" @click="depotInOut(row, type)">
+        <el-link
+          type="primary"
+          :underline="false"
+          @click="depotInOut(row, type)"
+        >
           {{ type == 1 ? '入库' : '出库' }}
         </el-link>
       </template>
@@ -38,192 +50,193 @@
 </template>
 
 <script>
-import { outputSceneState, sceneState } from '@/utils/dict/index';
-import storageApi from '@/api/warehouseManagement';
-import tgDetails from './tgDetails.vue';
-export default {
-  props: {
-    type: {
-      type: String,
-      default: ''
-    }
-  },
-  components: {
-    tgDetails
-  },
-  data() {
-    return {
-      outputSceneState,
-      sceneState,
-      loading: false,
-      statusOpt: [
-        { label: '待处理', value: 0 },
-        { label: '已处理', value: 1 },
-        { label: '已撤销', value: 2 }
-      ]
-    };
-  },
-  computed: {
-    // 表格列配置
-    columns() {
-      return [
-        {
-          columnKey: 'index',
-          label: '序号',
-          type: 'index',
-          width: 55,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        {
-          prop: 'code',
-          slot: 'code',
-          label: '编码',
-          showOverflowTooltip: true,
-          align: 'center',
-          minWidth: 100
-        },
-        {
-          prop: 'categoryNames',
-          label: '名称',
-          showOverflowTooltip: true,
-          align: 'center'
-        },
-        { label: '型号', prop: 'modelType', width: '150' },
-        { label: '规格', prop: 'specification', width: '150' },
-        { label: '牌号', prop: 'brandNum', width: '100' },
-        {
-          prop: 'sourceType',
-          label: '出入库类型',
-          align: 'center',
-          formatter: (row, column, cellValue) => {
-            console.log(row);
-            switch (this.type) {
-              case '1':
-                // 入库
-                return this.sceneState.filter(
-                  (item) => item.code == row.sourceType
-                )[0].label;
-              case '2':
-                // 出库
-                return this.outputSceneState.filter(
-                  (item) => item.code == row.sourceType
-                )[0].label;
-            }
-          }
-        },
-        {
-          prop: 'approvalUserName',
-          label: '审核人',
-          align: 'center'
-        },
-        {
-          prop: 'createUserName',
-          label: '申请人',
-          align: 'center'
-        },
-        {
-          prop: 'createTime',
-          label: '创建时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          slot: 'status',
-          label: '状态',
-          align: 'center'
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 120,
-          align: 'center',
-          resizable: false,
-          fixed: 'right',
-          slot: 'action',
-          showOverflowTooltip: true
-        }
-      ];
-    }
-  },
-  created() { },
-  methods: {
-    statusFormatter(status) {
-      const obj = this.statusOpt.find((i) => i.value == status);
-      return obj && obj.label;
+  import { outputSceneState, sceneState } from '@/utils/dict/index';
+  import storageApi from '@/api/warehouseManagement';
+  import tgDetails from './tgDetails.vue';
+  export default {
+    props: {
+      type: {
+        type: String,
+        default: ''
+      }
     },
-    /* 表格数据源 */
-    datasource({ page, limit, where }) {
-      return storageApi.getinboundRequestsList({
-        pageNum: page,
-        size: limit,
-        type: this.type,
-        ...where
-      });
+    components: {
+      tgDetails
     },
-    details(row) {
-      this.$refs.tgDetailsRefs.open(row);
+    data() {
+      return {
+        outputSceneState,
+        sceneState,
+        loading: false,
+        statusOpt: [
+          { label: '待处理', value: 0 },
+          { label: '已处理', value: 1 },
+          { label: '已撤销', value: 2 }
+        ]
+      };
     },
-    depotInOut(row, type) {
-      console.log(row, type);
-      if (type == 1) {
-        this.$router.push({
-          path: '/warehouseManagement/stockManagement/add',
-          query: {
-            code: row.code,
-            inId: row.id,
-            type: '1',
-            sourceType: row.sourceType,
-            name: 'inboundRequests'
+    computed: {
+      // 表格列配置
+      columns() {
+        return [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            slot: 'code',
+            label: '编码',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 100
+          },
+          {
+            prop: 'categoryNames',
+            label: '名称',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          { label: '型号', prop: 'modelType', width: '150' },
+          { label: '规格', prop: 'specification', width: '150' },
+          { label: '牌号', prop: 'brandNum', width: '100' },
+          {
+            prop: 'sourceType',
+            label: '出入库类型',
+            align: 'center',
+            formatter: (row, column, cellValue) => {
+              console.log(row);
+              switch (this.type) {
+                case '1':
+                  // 入库
+                  return this.sceneState.filter(
+                    (item) => item.code == row.sourceType
+                  )[0].label;
+                case '2':
+                  // 出库
+                  return this.outputSceneState.filter(
+                    (item) => item.code == row.sourceType
+                  )[0].label;
+              }
+            }
+          },
+          {
+            prop: 'approvalUserName',
+            label: '审核人',
+            align: 'center'
+          },
+          {
+            prop: 'createUserName',
+            label: '申请人',
+            align: 'center'
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            slot: 'status',
+            label: '状态',
+            align: 'center'
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 120,
+            align: 'center',
+            resizable: false,
+            fixed: 'right',
+            slot: 'action',
+            showOverflowTooltip: true
           }
+        ];
+      }
+    },
+    created() {},
+    methods: {
+      statusFormatter(status) {
+        const obj = this.statusOpt.find((i) => i.value == status);
+        return obj && obj.label;
+      },
+      /* 表格数据源 */
+      datasource({ page, limit, where }) {
+        return storageApi.getinboundRequestsList({
+          pageNum: page,
+          size: limit,
+          type: this.type,
+          ...where
         });
-      } else {
-        this.$router.push({
-          path: '/warehouseManagement/outgoingManagement/add',
-          query: {
-            code: row.code,
-            id: row.id,
-            type: '2',
-            sourceType: row.sourceType
+      },
+      details(row) {
+        this.$refs.tgDetailsRefs.open(row);
+      },
+      depotInOut(row, type) {
+        console.log(row, type);
+        if (type == 1) {
+          this.$router.push({
+            path: '/warehouseManagement/stockManagement/add',
+            query: {
+              code: row.code,
+              inId: row.id,
+              type: '1',
+              sourceType: row.sourceType,
+              name: 'inboundRequests'
+            }
+          });
+        } else {
+          this.$router.push({
+            path: '/warehouseManagement/outgoingManagement/add',
+            query: {
+              code: row.code,
+              id: row.id,
+              type: '2',
+              sourceType: row.sourceType,
+              fromId: row.createUserId,
+            }
+          });
+        }
+      },
+      /* 刷新表格 */
+      reload(where) {
+        console.log(where, '11111where');
+        this.$nextTick(() => {
+          if (this.$refs.table1 && this.$refs.table1.loading) {
+            this.$refs.table1.reload({ page: 1, where });
           }
         });
       }
-    },
-    /* 刷新表格 */
-    reload(where) {
-      console.log(where, '11111where')
-      this.$nextTick(() => {
-        if (this.$refs.table1 && this.$refs.table1.loading) {
-          this.$refs.table1.reload({ page: 1, where });
-        }
-      });
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss" scoped>
-.tgTable {
-  height: 100%;
-  box-sizing: border-box;
-  display: flex;
-  flex-direction: column;
-
-  .ele-pro-table {
-    flex: 1;
+  .tgTable {
+    height: 100%;
+    box-sizing: border-box;
     display: flex;
     flex-direction: column;
 
-    .el-table {
+    .ele-pro-table {
       flex: 1;
-      // display: flex;
-      // flex-direction: column;
-      // .el-table__body-wrapper {
-      //   flex: 1;
-      // }
+      display: flex;
+      flex-direction: column;
+
+      .el-table {
+        flex: 1;
+        // display: flex;
+        // flex-direction: column;
+        // .el-table__body-wrapper {
+        //   flex: 1;
+        // }
+      }
     }
   }
-}
 </style>

+ 29 - 10
src/views/warehouseManagement/outgoingManagement/add.vue

@@ -352,13 +352,19 @@
                 fixed="right"
                 label="操作"
                 align="center"
-                width="70">
+                width="70"
+              >
                 <template slot-scope="scope">
                   <el-popconfirm
                     title="确定删除吗?"
                     @confirm="handleDeleteClick(scope.row, scope.$index)"
                   >
-                    <el-link slot="reference" type="danger" :underline="false" icon="el-icon-delete">
+                    <el-link
+                      slot="reference"
+                      type="danger"
+                      :underline="false"
+                      icon="el-icon-delete"
+                    >
                       删除
                     </el-link>
                   </el-popconfirm>
@@ -732,7 +738,9 @@
       },
 
       outboundRequisitionSelection(data, dimension, query) {
-        console.log(data, dimension, query);
+        console.log(data, 'd');
+        console.log(dimension, 'sss');
+        console.log(query, 'dsd');
         this.formData.sourceBizNo = query.sourceBizNo;
         this.formData.bizType = Number(query.bizType);
         this.formData.extInfo.assetType = query.assetType.split(',');
@@ -813,9 +821,7 @@
       },
       // getDeptName() {
       //   if (this.formData?.extInfo?.createUserId) {
-      //     storageApi.getGroupById(this.formData.extInfo.createUserId).then((res) => {
-      //       this.formData.extInfo.deptName = res?.groupName
-      //     });
+
       //   }
       // },
       async _getInfo(detailId) {
@@ -1122,7 +1128,7 @@
 
         console.log(this.$route.query.detailId);
 
-        if (!this.$route.query.detailId) {
+        if (!this.$route.query.detailId && !this.$route.query?.fromId) {
           // 默认领料人部门
           this.$set(this.formData.extInfo, 'verifyDeptCode', info?.groupId);
           this.$set(this.formData.extInfo, 'verifyDeptName', info?.groupName);
@@ -1133,6 +1139,18 @@
           this.$set(this.formData, 'fromUser', info.name);
           this.$set(this.formData, 'fromUserPhone', info.phone);
         }
+        if (this.$route.query?.fromId) {
+          storageApi.getGroupById(this.$route.query?.fromId).then((res) => {
+            console.log(res, 'dsdsd');
+            this.$set(this.formData.extInfo, 'verifyDeptCode', res.groupId);
+            this.$set(this.formData.extInfo, 'verifyDeptName', res.groupName);
+            this.$set(this.formData, 'fromId', res.id);
+            this.$set(this.formData, 'fromUser', res.name);
+            this.$set(this.formData, 'fromUserPhone', res.phone);
+
+            this.getStaffList({ id: res.groupId });
+          });
+        }
       },
       // 初始化部门数据
       async initDeptData() {
@@ -1156,13 +1174,14 @@
 
         this.$refs.assetsDialogRef.open(this.productList);
       },
-      // 
+      //
       handleDeleteClick(row, index) {
         console.log('删除', row.id);
         this.productList.splice(index, 1);
         console.log('删除后', this.packingList);
-        this.packingList = this.packingList.filter((item) => item.outInDetailId !== row.id);
-        
+        this.packingList = this.packingList.filter(
+          (item) => item.outInDetailId !== row.id
+        );
       },
       handleBizSceneChange() {
         if (this.formData.extInfo.assetType == 7) {