695593266@qq.com 7 месяцев назад
Родитель
Сommit
9d382eba36

+ 5 - 4
src/views/entrust/components/create.vue

@@ -153,7 +153,7 @@
         icon="el-icon-plus"
         class="ele-btn-icon"
         @click="addOder"
-        v-if="type != 'detail'"
+        v-if="type != 'detail' && type != 'edit'"
         style="margin-bottom: 10px"
       >
         新建
@@ -165,7 +165,7 @@
         icon="el-icon-delete"
         class="ele-btn-icon"
         @click="removeOder"
-        v-if="type != 'detail'"
+        v-if="type != 'detail' && type != 'edit'"
         plain
         style="margin-bottom: 10px"
       >
@@ -438,7 +438,7 @@
             }
           },
           {
-            prop: 'code',
+            prop: 'workOrderCode',
             label: '生产工单号',
             align: 'center',
             minWidth: 110,
@@ -595,7 +595,7 @@
             this.form.factoriesId = data[0].factoryId;
             this.form.factoriesName = data[0].factoryName;
           }
-        } else if (type == 'edit' || type == 'detail') {
+        } else if (type == 'edit' || type == 'detail' || type == 'wordEdit') {
           this.getDetail(row.id);
         }
 
@@ -743,6 +743,7 @@
             modelType: copy.model,
             name: '',
             type: '',
+            workOrderCode: copy.code,
             planDeliveryTime: copy.startTime,
             applyDeptId: this.form.pleaseEntrustDeptId,
             applyDeptName: this.form.pleaseEntrustDeptName,

+ 76 - 7
src/views/produce/components/outsourcing/details.vue

@@ -170,6 +170,10 @@
         <span> {{ getDictValue('请托类型', row.type + '') }}</span>
       </template>
 
+      <template v-slot:totalCount="{ row }">
+        <span> {{ row.totalCount }}{{ row.measuringUnit }}</span>
+      </template>
+
       <template v-slot:status="{ row }">
         <el-tag>{{
           row.status == 0 ? '未提交' : row.status == 1 ? '已提交' : '已发布'
@@ -177,10 +181,15 @@
       </template>
 
       <template v-slot:sendStatus="{ row }">
-        <el-tag v-if="row.sendStatus == 0">{{ '未发货' }}</el-tag>
-        <el-tag v-else-if="row.sendStatus == 1">{{ '已发货' }}</el-tag>
-        <el-tag v-else-if="row.sendStatus == 2">{{ '已收货' }}</el-tag>
-        <span v-else>无</span>
+        <el-tag v-if="row.sendStatus == 0 || !row.sendStatus">{{
+          '未发货'
+        }}</el-tag>
+        <el-tag v-else-if="row.sendStatus == 1" type="success">{{
+          '已发货'
+        }}</el-tag>
+        <el-tag v-else-if="row.sendStatus == 2" type="success">{{
+          '已收货'
+        }}</el-tag>
       </template>
 
       <template v-slot:approvalStatus="{ row }">
@@ -240,7 +249,7 @@
         <el-link
           type="primary"
           :underline="false"
-          @click="sendGoods(row)"
+          @click="sendGoods(row, 'add')"
           v-if="
             row.approvalStatus == 2 && (row.sendStatus == 0 || !row.sendStatus)
           "
@@ -248,6 +257,18 @@
           发货
         </el-link>
 
+        <el-link
+          type="primary"
+          :underline="false"
+          @click="sendGoods(row, 'detail')"
+          v-if="
+            row.approvalStatus == 2 &&
+            (row.sendStatus == 1 || row.sendStatus == 2)
+          "
+        >
+          发货详情
+        </el-link>
+
         <el-link
           type="primary"
           :underline="false"
@@ -265,6 +286,9 @@
     <detail ref="detailsRef"></detail>
 
     <timeDialog ref="timeDialogRef"></timeDialog>
+    <goodsDetail ref="goodsDetailRef" @done="reloads"></goodsDetail>
+
+    <Create ref="create" @refresh="reloads" />
   </div>
 </template>
 
@@ -279,13 +303,18 @@
   import { getFile } from '@/api/system/file';
   import { getList as getPleaseListData } from '@/api/entrust/index';
   import { getByCode } from '@/api/system/dictionary-data';
+  import Create from '@/views/entrust/components/create.vue';
+  import goodsDetail from '@/views/entrust/components/goodsDetail.vue';
+  import { remove, submit, warehouseEntry } from '@/api/entrust/index.js';
   export default {
     components: {
       search,
       flow,
       release,
       Detail,
-      timeDialog
+      timeDialog,
+      Create,
+      goodsDetail
     },
 
     props: {
@@ -568,6 +597,7 @@
           },
           {
             prop: 'totalCount',
+            slot: 'totalCount',
             label: '请托数量',
             align: 'center',
             width: 130,
@@ -778,12 +808,46 @@
         }
       },
 
+      remove(id) {
+        let ids = id || this.selection.map((item) => item.id);
+        remove(ids).then((res) => {
+          this.$message.success('删除' + res);
+          this.reloads();
+        });
+      },
+
+      submit(item) {
+        this.$confirm('是否提交该请托单的审核流程?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+          .then(() => {
+            submit({
+              businessId: item.id,
+              beEntrustedDeptId: item.beEntrustedDeptId
+            }).then((res) => {
+              this.$message.success('提交' + res.message);
+              this.reloads();
+            });
+          })
+          .catch(() => {});
+      },
+
       getPleaseType(item) {
         const data = this.pleaseTypeList.filter((it) => it.value == item.type);
 
         return data.length != 0 ? data[0].label : '';
       },
 
+      sendGoods(item, type) {
+        this.$refs.goodsDetailRef.open(item, type);
+      },
+
+      open(type, row) {
+        this.$refs.create.open(type, row);
+      },
+
       async getDataList(code) {
         this.workOrderCode = code;
         await getList({
@@ -798,7 +862,6 @@
       },
 
       async getPleaseData(code) {
-        console.log(code, '22000');
         this.workOrderCode = code;
         await getPleaseListData({
           pageNum: 1,
@@ -828,6 +891,12 @@
         this.$refs.timeDialogRef.open(row, 'details');
       },
 
+      reloads() {
+        this.$nextTick(() => {
+          this.getPleaseData(this.workOrderCode);
+        });
+      },
+
       handleRelease(row) {
         this.$refs.releaseRef.open(row);
       },

+ 13 - 10
src/views/produce/components/outsourcing/index.vue

@@ -477,7 +477,9 @@
           pleaseEntrustDeptId: '',
           pleaseEntrustUserId: '',
           factoriesId: '',
-          factoriesName: ''
+          factoriesName: '',
+          status: '',
+          approvalStatus: ''
         },
 
         loading: false,
@@ -563,6 +565,10 @@
       }
 
       if (this.chooseType == '2') {
+        this.form.pleaseEntrustDeptName = this.$store.state.user.info.groupName;
+        this.form.pleaseEntrustDeptId = this.$store.state.user.info.groupId;
+        this.form.pleaseEntrustUserName = this.$store.state.user.info.name;
+        this.form.pleaseEntrustUserId = this.$store.state.user.info.userId;
         const newList = this.workData.list.map((item) => {
           const copy = this.deepCopy(item);
 
@@ -598,10 +604,6 @@
 
         const data = Object.assign(this.form, newList[0]);
         this.form = this.deepCopy(data);
-        this.form.pleaseEntrustDeptName = this.$store.state.user.info.groupName;
-        this.form.pleaseEntrustDeptId = this.$store.state.user.info.groupId;
-        this.form.pleaseEntrustUserName = this.$store.state.user.info.name;
-        this.form.pleaseEntrustUserId = this.$store.state.user.info.userId;
         this.form.name = this.taskObj.name
           ? this.taskObj.name + '请托'
           : this.taskObj.taskTypeName + '请托';
@@ -837,13 +839,11 @@
           let URL;
 
           const clearOrderIds = () => {
-            this.orderList.forEach((it) => (it.id = ''));
+            // this.orderList.forEach((it) => (it.id = ''));
+            this.form.id = '';
           };
 
-          if (type === 1 && this.form.id) {
-            // 编辑
-            URL = update;
-          } else if (type === 1) {
+          if (type === 1) {
             // 新增
             URL = save;
             clearOrderIds();
@@ -859,6 +859,9 @@
             background: 'rgba(0, 0, 0, 0.7)'
           });
 
+          this.form.status = type == 1 ? 0 : 1;
+          this.form.approvalStatus = type == 1 ? 0 : 1;
+
           console.log(this.form, 'this.form');
 
           const list = [];

+ 1 - 1
vue.config.js

@@ -37,7 +37,7 @@ module.exports = {
         // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.125:18086',
-        target: 'http://192.168.1.116:18086', // 赵沙金
+        // target: 'http://192.168.1.116:18086', // 赵沙金
         // target: 'http://192.168.1.251:18086', // 开发环境
         // target: 'http://192.168.1.103:18086',192.168.1.116
         // target: 'http://192.168.1.144:18086',