huang_an hace 2 años
padre
commit
53ebd7189e

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

@@ -1271,14 +1271,16 @@
         console.log('res=====', res);
         const info = JSON.parse(localStorage.getItem('info'));
         console.log('info=====', info);
-        let obj = res.find(
-          (item) => item.id === info.deptId[info.deptId.length - 1]
-        );
-        console.log('obj=====', obj);
-        this.formData.extInfo.deptName = obj?.name;
-        this.formData.extInfo.deptCode = obj?.id;
-        this.formData.extInfo.createUserName = info.name;
-        this.formData.createUserId = info.userId;
+        if (info && info.deptId?.length > 0) {
+          let obj = res.find(
+            (item) => item.id === info.deptId[info.deptId.length - 1]
+          );
+          console.log('obj=====', obj);
+          this.formData.extInfo.deptName = obj?.name;
+          this.formData.extInfo.deptCode = obj?.id;
+          this.formData.extInfo.createUserName = info.name;
+          this.formData.createUserId = info.userId;
+        }
       },
       addStock() {
         // this.title = this.formData.extInfo.assetTypeName;

+ 25 - 1
src/views/warehouseManagement/outgoingManagement/index.vue

@@ -153,6 +153,15 @@
           >
             详情
           </el-link>
+          <el-link
+            type="primary"
+            v-if="row.verifyStatus == 0 || row.verifyStatus == 3"
+            :underline="false"
+            icon="el-icon-delete"
+            @click="deleted(row)"
+          >
+            删除
+          </el-link>
         </template>
       </ele-pro-table>
     </el-card>
@@ -263,7 +272,7 @@
           {
             columnKey: 'action',
             label: '操作',
-            width: 200,
+            width: 300,
             align: 'center',
             slot: 'action',
             showOverflowTooltip: true
@@ -338,6 +347,21 @@
       getList() {
         this.$refs.table.reload();
       },
+      async deleted(row) {
+        this.$confirm('是否确定删除?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+          .then(async () => {
+            const data = await outin.delete([row.id]);
+            if (data.code == '0') {
+              this.$message.success('删除成功!');
+              this.getList();
+            }
+          })
+          .catch(() => {});
+      },
       add() {
         this.$router.push({
           path: '/warehouseManagement/outgoingManagement/add'

+ 1 - 1
vue.config.js

@@ -34,7 +34,7 @@ module.exports = {
         // target: 'http://124.71.68.31:50001', // 测试环境
         // target: 'http://124.71.68.31:50001',
         // target: 'http://192.168.1.132:18086',
-        target: 'http://192.168.1.110:18086',
+        target: 'http://192.168.1.119:18086',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''