Răsfoiți Sursa

修改任务派单班次的接口

695593266@qq.com 6 luni în urmă
părinte
comite
4c67c5be0e

+ 21 - 14
src/api/mainData/index.js

@@ -1,7 +1,7 @@
 import request from '@/utils/request';
 
 // 根据工艺路线编码获取工序
-export async function getProcessByRoute (data) {
+export async function getProcessByRoute(data) {
   const res = await request.post(
     '/main/producerouting/taskinstance/page',
     data
@@ -12,7 +12,7 @@ export async function getProcessByRoute (data) {
   return Promise.reject(new Error(res.data.message));
 }
 // 根据生产版本获取工序
-export async function getTaskListById (id) {
+export async function getTaskListById(id) {
   const res = await request.get(`/main/produceversion/getTaskListById/${id}`);
   if (res.data.code == 0) {
     return res.data.data;
@@ -20,7 +20,7 @@ export async function getTaskListById (id) {
   return Promise.reject(new Error(res.data.message));
 }
 // SAP-查询库存
-export async function realTimeStorage (params) {
+export async function realTimeStorage(params) {
   const res = await request.get(`/sap/sync/realTimeStorage`, { params });
   if (res.data.code == 0) {
     return res.data.data;
@@ -28,7 +28,7 @@ export async function realTimeStorage (params) {
   return Promise.reject(new Error(res.data.message));
 }
 // 根据生产版本ID查询bom子项列表
-export async function bomSubListByVersionId (params) {
+export async function bomSubListByVersionId(params) {
   const res = await request.get(
     `/main/produceversion/resource/bomSubListByVersionId/${params.versionId}/${params.taskInstanceId}`
   );
@@ -38,7 +38,7 @@ export async function bomSubListByVersionId (params) {
   return Promise.reject(new Error(res.data.message));
 }
 // 工位
-export async function factoryworkstation (params) {
+export async function factoryworkstation(params) {
   const res = await request.get(`/main/factoryworkstation/page`, { params });
   if (res.data.code == 0) {
     return res.data.data;
@@ -132,7 +132,10 @@ export async function checkAssignConfirm(params) {
 
 // 获取工序的工作中心和班组列表
 export async function listByRoutingIds(data) {
-  const res = await request.post(`/main/producerouting/taskinstance/listByRoutingIds`, data);
+  const res = await request.post(
+    `/main/producerouting/taskinstance/listByRoutingIds`,
+    data
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -160,9 +163,7 @@ export async function listWorkCenter(firstProduceTaskId) {
 
 // 查询工序列表 已派单
 export async function listByMesWorkOrder(params) {
-  const res = await request.get(
-    `/aps/assign/listByMesWorkOrder`,{params}
-  );
+  const res = await request.get(`/aps/assign/listByMesWorkOrder`, { params });
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -171,9 +172,7 @@ export async function listByMesWorkOrder(params) {
 
 // 下达
 export async function releaseWorkOrder(data) {
-  const res = await request.post(
-    `/aps/workorder/releaseWorkOrder`, data
-  );
+  const res = await request.post(`/aps/workorder/releaseWorkOrder`, data);
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -182,9 +181,17 @@ export async function releaseWorkOrder(data) {
 
 // 根据工厂查询班次
 export async function listByFactoryId(factoryId) {
-  const res = await request.get(`main/teamtime/listByFactoryId/${factoryId}`);
+  // const res = await request.get(`main/teamtime/listByFactoryId/${factoryId}`);
+  // if (res.data.code == 0) {
+  //   return res.data.data;
+  // }
+  // return Promise.reject(new Error(res.data.message));
+
+  const res = await request.get(
+    `/aps/tapsproductionshift/listByFactoryId/${factoryId}`
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
-}
+}

+ 46 - 0
src/api/outsourcing/index.js

@@ -33,3 +33,49 @@ export async function batchOutsourcing(params) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+//发货列表
+export async function sendGoodsList(params) {
+  const res = await request.post('/mes/applyoutsource/listDetail', params);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//物品清单列表
+export async function itemsList(params) {
+  const res = await request.post('/mes/applyoutsource/preDetail', params);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//保存发货
+export async function saveSend(params) {
+  const res = await request.post('/mes/applyoutsource/saveDetail', params);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//保存收货
+export async function receivingGoodsList(params) {
+  console.log(params, '保存的数据');
+  const res = await request.post('/mes/applyoutsource/receiveDetail', params);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//收货详情
+export async function receivingGoodsDetailList(params) {
+  const res = await request.post('/mes/applyoutsource/beReceiveDetail', params);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 1 - 0
src/utils/request.js

@@ -58,6 +58,7 @@ service.interceptors.response.use(
     return res;
   },
   (error) => {
+    console.log(error, '错误信息error');
     // 登录过期处理
     if (error?.response?.status === 401) {
       const currentPath = router.currentRoute.path;

+ 195 - 0
src/views/outsourcing/components/addInvoice.vue

@@ -0,0 +1,195 @@
+<template>
+  <ele-modal
+    :visible.sync="visible"
+    title="在制品列表"
+    v-if="visible"
+    width="65vw"
+    append-to-body
+    :maxable="true"
+  >
+    <ele-pro-table
+      ref="entrustCreateTable"
+      :columns="columns"
+      :datasource="workinProgress"
+      :selection.sync="selection"
+      :current.sync="current"
+      highlight-current-row
+      row-key="id"
+      height="40vh"
+      :row-click-checked="true"
+      :row-click-checked-intelligent="false"
+      @update:selection="handleSelectionChange"
+    >
+      <template v-slot:totalCount="{ row }">
+        <span>{{ row.totalCount }}{{ row.measuringUnit }}</span>
+      </template>
+
+      <template v-slot:totalWeight="{ row }">
+        <span>{{ row.totalWeight }}{{ row.weightUnit }}</span>
+      </template>
+
+      <template v-slot:rootCategoryLevelId="{ row }">
+        <el-tag>{{ typeName[Number(row.rootCategoryLevelId)] }}</el-tag>
+      </template>
+    </ele-pro-table>
+
+    <template v-slot:footer>
+      <el-button @click="cancel">取消</el-button>
+      <el-button type="primary" @click="save"> 确定 </el-button>
+    </template>
+  </ele-modal>
+</template>
+
+<script>
+  import { itemsList } from '@/api/outsourcing';
+
+  import { typeName } from '@/views/produce/components/common.js';
+  export default {
+    data() {
+      return {
+        visible: false,
+        workinProgress: [],
+        selection: [],
+        current: null,
+        id: '',
+        typeName,
+        columns: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center',
+            reserveSelection: true
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'categoryName',
+            label: '名称',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'brandNum',
+            label: '牌号',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'totalCount',
+            slot: 'totalCount',
+            label: '数量',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'workOrderCode',
+            label: '生产工单号',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'modelType',
+            label: '型号',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'categoryCode',
+            label: '编码',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'totalWeight',
+            slot: 'totalWeight',
+            label: '重量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'rootCategoryLevelId',
+            slot: 'rootCategoryLevelId',
+            label: '类型',
+            align: 'center',
+            showOverflowTooltip: true
+          }
+        ],
+        allSelection: []
+      };
+    },
+
+    methods: {
+      open(id, list) {
+        this.visible = true;
+        this.getDetail(id);
+
+        console.log('list', list);
+
+        this.allSelection = list || [];
+        this.$nextTick(() => {
+          this.allSelection.forEach((item) => {
+            this.$refs.entrustCreateTable.toggleRowSelection(item, true);
+          });
+        });
+      },
+
+      async getDetail(id) {
+        await itemsList({
+          applyOutsourcedId: id
+        }).then((res) => {
+          this.workinProgress = res;
+        });
+      },
+
+      handleSelectionChange(data) {
+        this.allSelection = data;
+      },
+
+      save() {
+        if (this.allSelection.length == 0) {
+          return this.$message.warning('请至少选择一条在制品数据');
+        }
+
+        this.$emit('chooseData', this.allSelection);
+        this.visible = false;
+      },
+
+      cancel() {
+        this.visible = false;
+      }
+    }
+  };
+</script>
+
+<style></style>

+ 162 - 135
src/views/outsourcing/components/details.vue

@@ -8,131 +8,176 @@
     append-to-body
     width="80%"
   >
-    <el-form ref="form" label-width="100px" class="create-form">
-      <headerTitle title="基本信息" style="margin-top: 15px"></headerTitle>
-
-      <el-row :gutter="15">
-        <el-col :span="6">
-          <el-form-item label="委外单编码:" prop="code">
-            <el-input v-model="row.code" disabled />
-          </el-form-item>
-        </el-col>
-        <el-col :span="6">
-          <el-form-item label="委外单名称:" prop="name">
-            <el-input v-model="row.name" disabled />
-          </el-form-item>
-        </el-col>
-
-        <el-col :span="6">
-          <el-form-item label="委外发起工序:" prop="taskName">
-            <el-input v-model="row.taskName" disabled />
-          </el-form-item>
-        </el-col>
-
-        <el-col :span="6">
-          <el-form-item label="委外工序:" prop="taskNames">
-            <el-input v-model="row.taskNames" disabled />
-          </el-form-item>
-        </el-col>
-
-        <el-col :span="6">
-          <el-form-item label="工单编码:" prop="factoriesName">
-            <el-input v-model="row.workOrderCode" style="width: 100%" disabled>
-            </el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="6">
-          <el-form-item label="预计到货日期:" prop="factoriesName">
-            <el-input
-              v-model="row.requireDeliveryTime"
-              style="width: 100%"
-              disabled
-            >
-            </el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="6">
-          <el-form-item label="创建时间:" prop="factoriesName">
-            <el-input v-model="row.createTime" style="width: 100%" disabled>
-            </el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="6">
-          <el-form-item label="状态:" prop="status">
-            <el-tag>{{
-              row.status == 0 ? '未提交' : row.status == 1 ? '已提交' : '已发布'
-            }}</el-tag>
-          </el-form-item>
-        </el-col>
-      </el-row>
-    </el-form>
-
-    <!-- 数据表格 -->
-    <ele-pro-table
-      ref="table"
-      v-if="detailType == 1"
-      :columns="columns"
-      :datasource="row.detailList"
-      cache-key="detailsTable"
-      height="calc(100vh - 350px)"
-    >
-      <template v-slot:totalCount="{ row }">
-        {{ row.totalCount }}{{ row.measuringUnit }}
-      </template>
-
-      <template v-slot:sourceType="{ row }">
-        <el-tag v-if="row.sourceType == 1" size="mini" type="success"
-          >物品清单</el-tag
-        >
-        <el-tag v-if="row.sourceType == 2" size="mini" type="warning"
-          >带料清单</el-tag
-        >
-        <el-tag v-if="row.sourceType == 3" size="mini" type="danger"
-          >产出清单</el-tag
-        >
-      </template>
-    </ele-pro-table>
-
-    <ele-pro-table
-      ref="table2"
-      v-if="detailType == 2"
-      :datasource="row.detailList"
-      :columns="columns2"
-      cache-key="detailsTable2"
-      height="calc(100vh - 350px)"
-    >
-      <template v-slot:totalCount="{ row }">
-        {{ row.totalCount }}{{ row.measuringUnit }}
-      </template>
-
-      <template v-slot:totalWeight="{ row }">
-        {{ row.totalWeight }}{{ row.weightUnit }}
-      </template>
-
-      <template v-slot:sourceType="{ row }">
-        <el-tag v-if="row.sourceType == 1" size="mini" type="success"
-          >物品清单</el-tag
-        >
-        <el-tag v-if="row.sourceType == 2" size="mini" type="warning"
-          >带料清单</el-tag
-        >
-        <el-tag v-if="row.sourceType == 3" size="mini" type="danger"
-          >产出清单</el-tag
-        >
-      </template>
-    </ele-pro-table>
+    <div class="switch" v-if="type == 'detail'" :maxable="true">
+      <div class="switch_left">
+        <ul>
+          <li
+            v-for="item in tabOptions"
+            :key="item.key"
+            :class="{ active: activeComp == item.key }"
+            @click="activeComp = item.key"
+          >
+            {{ item.name }}
+          </li>
+        </ul>
+      </div>
+    </div>
+
+    <div v-if="activeComp == 'detail'">
+      <el-form ref="form" label-width="100px" class="create-form">
+        <headerTitle title="基本信息" style="margin-top: 15px"></headerTitle>
+
+        <el-row :gutter="15">
+          <el-col :span="6">
+            <el-form-item label="委外单编码:" prop="code">
+              <el-input v-model="row.code" disabled />
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="委外单名称:" prop="name">
+              <el-input v-model="row.name" disabled />
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="6">
+            <el-form-item label="委外发起工序:" prop="taskName">
+              <el-input v-model="row.taskName" disabled />
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="6">
+            <el-form-item label="委外工序:" prop="taskNames">
+              <el-input v-model="row.taskNames" disabled />
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="6">
+            <el-form-item label="工单编码:" prop="factoriesName">
+              <el-input
+                v-model="row.workOrderCode"
+                style="width: 100%"
+                disabled
+              >
+              </el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="预计到货日期:" prop="factoriesName">
+              <el-input
+                v-model="row.requireDeliveryTime"
+                style="width: 100%"
+                disabled
+              >
+              </el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="创建时间:" prop="factoriesName">
+              <el-input v-model="row.createTime" style="width: 100%" disabled>
+              </el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="状态:" prop="status">
+              <el-tag>{{
+                row.status == 0
+                  ? '未提交'
+                  : row.status == 1
+                  ? '已提交'
+                  : '已发布'
+              }}</el-tag>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+
+      <ele-pro-table
+        ref="table"
+        v-if="detailType == 1"
+        :columns="columns"
+        :datasource="row.detailList"
+        cache-key="detailsTable"
+        height="calc(100vh - 350px)"
+      >
+        <template v-slot:totalCount="{ row }">
+          {{ row.totalCount }}{{ row.measuringUnit }}
+        </template>
+
+        <template v-slot:sourceType="{ row }">
+          <el-tag v-if="row.sourceType == 1" size="mini" type="success"
+            >物品清单</el-tag
+          >
+          <el-tag v-if="row.sourceType == 2" size="mini" type="warning"
+            >带料清单</el-tag
+          >
+          <el-tag v-if="row.sourceType == 3" size="mini" type="danger"
+            >产出清单</el-tag
+          >
+        </template>
+      </ele-pro-table>
+
+      <ele-pro-table
+        ref="table2"
+        v-if="detailType == 2"
+        :datasource="row.detailList"
+        :columns="columns2"
+        cache-key="detailsTable2"
+        height="calc(100vh - 350px)"
+      >
+        <template v-slot:totalCount="{ row }">
+          {{ row.totalCount }}{{ row.measuringUnit }}
+        </template>
+
+        <template v-slot:totalWeight="{ row }">
+          {{ row.totalWeight }}{{ row.weightUnit }}
+        </template>
+
+        <template v-slot:sourceType="{ row }">
+          <el-tag v-if="row.sourceType == 1" size="mini" type="success"
+            >物品清单</el-tag
+          >
+          <el-tag v-if="row.sourceType == 2" size="mini" type="warning"
+            >带料清单</el-tag
+          >
+          <el-tag v-if="row.sourceType == 3" size="mini" type="danger"
+            >产出清单</el-tag
+          >
+        </template>
+      </ele-pro-table>
+    </div>
+
+    <send-receiving-detail
+      v-if="activeComp == 'send'"
+      :item="row"
+      :type="activeComp"
+    ></send-receiving-detail>
+
+    <send-receiving-detail
+      v-if="activeComp == 'receiving'"
+      :item="row"
+      :type="activeComp"
+    ></send-receiving-detail>
   </el-dialog>
 </template>
 
 <script>
+  import sendReceivingDetail from './sendReceivingDetail.vue';
   export default {
-    components: {},
+    components: { sendReceivingDetail },
+
     data() {
       return {
         visible: false,
         detailTitle: null,
         row: {},
-        detailType: ''
+        detailType: '',
+        activeComp: 'detail',
+        tabOptions: [
+          { key: 'detail', name: '委外详情' },
+          { key: 'send', name: '收货详情' },
+          { key: 'receiving', name: '发货详情' }
+        ],
+        type: ''
       };
     },
 
@@ -299,32 +344,14 @@
 
     watch: {},
     methods: {
-      open(row) {
+      open(row, type) {
         this.visible = true;
-        // if (row.detailTitle == 1) {
-        //   this.detailType = 1;
-        //   this.$nextTick(() => {
-        //     this.$refs.table.setData([...row.detailList]);
-        //   });
-        // } else if (row.detailTitle == 2) {
-        //   this.detailType = 2;
-        //   this.$nextTick(() => {
-        //     this.$refs.table2.setData([...row.detailList]);
-        //   });
-        // }
-
+        this.type = type;
         if (row.detailType == 1) {
           this.detailType = 1;
-          // this.$nextTick(() => {
-          //   this.$refs.table.setData([...row.detailList]);
-          // });
         } else if (row.detailType == 2) {
           this.detailType = 2;
-          // this.$nextTick(() => {
-          //   this.$refs.table2.setData([...row.detailList]);
-          // });
         }
-        console.log(row, 'row 123');
         this.row = row;
       },
 

+ 319 - 0
src/views/outsourcing/components/goodsDetail.vue

@@ -0,0 +1,319 @@
+<template>
+  <ele-modal
+    :visible.sync="visible"
+    :title="title"
+    v-if="visible"
+    width="65vw"
+    append-to-body
+    :maxable="true"
+  >
+    <el-button
+      size="small"
+      type="primary"
+      icon="el-icon-plus"
+      class="ele-btn-icon"
+      @click="addGoods"
+      style="margin-bottom: 10px"
+      v-if="type != 'detail' && type != 'receiving'"
+    >
+      新增在制品
+    </el-button>
+
+    <ele-pro-table
+      ref="entrustCreateTable"
+      :columns="columns"
+      :datasource="goodsList"
+      :selection.sync="selection"
+      :current.sync="current"
+      highlight-current-row
+      row-key="id"
+      height="40vh"
+    >
+      <template v-slot:totalCount="{ row }">
+        <span>{{ row.totalCount }}{{ row.measuringUnit }}</span>
+      </template>
+
+      <template v-slot:totalWeight="{ row }">
+        <span>{{ row.totalWeight }}{{ row.weightUnit }}</span>
+      </template>
+
+      <template v-slot:receiveQuantity="{ row }">
+        <el-input
+          placeholder=""
+          v-model="row.receiveQuantity"
+          :disabled="type == 'receipt' && itemData.sendStatus == 4"
+        >
+          <template slot="append">{{ row.measuringUnit }}</template>
+        </el-input>
+      </template>
+
+      <template v-slot:rootCategoryLevelId="{ row }">
+        <el-tag>{{ typeName[Number(row.rootCategoryLevelId)] }}</el-tag>
+      </template>
+    </ele-pro-table>
+
+    <template v-slot:footer v-if="type != 'detail' && itemData.sendStatus != 4">
+      <el-button @click="cancel">取消</el-button>
+      <el-button type="primary" @click="save"> 确定 </el-button>
+    </template>
+
+    <add-invoice ref="addInvoiceRef" @chooseData="chooseData"></add-invoice>
+  </ele-modal>
+</template>
+
+<script>
+  // import {
+  //   pleaseEntrustGoodsDetail,
+  //   pleaseEntrustSaveDetail,
+  //   pleaseTReceiveGoods
+  // } from '@/api/entrust';
+  import {
+    sendGoodsList,
+    saveSend,
+    receivingGoodsDetailList,
+    receivingGoodsList
+  } from '@/api/outsourcing';
+  import { typeName } from '@/views/produce/components/common.js';
+
+  import addInvoice from './addInvoice.vue';
+  export default {
+    components: {
+      addInvoice
+    },
+
+    data() {
+      return {
+        visible: false,
+        goodsList: [],
+        selection: [],
+        current: null,
+        typeName,
+        id: '',
+        title: '',
+        type: '',
+        itemData: {},
+        loading: null
+      };
+    },
+
+    computed: {
+      columns() {
+        return [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'categoryName',
+            label: '名称',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'brandNum',
+            label: '牌号',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'totalCount',
+            slot: 'totalCount',
+            label: '数量',
+            align: 'center',
+            minWidth: 140,
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'workOrderCode',
+            label: '生产工单号',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'receiveQuantity',
+            slot: 'receiveQuantity',
+            label: '接收数量',
+            align: 'center',
+            minWidth: 150,
+            showOverflowTooltip: true,
+            show: this.type == 'receipt' ? true : false
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'modelType',
+            label: '型号',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+
+          // {
+          //   prop: 'taskName',
+          //   label: '工序',
+          //   align: 'center',
+          //   minWidth: 150,
+          //   showOverflowTooltip: true
+          // },
+          {
+            prop: 'categoryCode',
+            label: '编码',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'totalWeight',
+            slot: 'totalWeight',
+            label: '重量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'rootCategoryLevelId',
+            slot: 'rootCategoryLevelId',
+            label: '类型',
+            align: 'center',
+            showOverflowTooltip: true
+          }
+        ];
+      }
+    },
+
+    methods: {
+      open(item, type) {
+        this.visible = true;
+        this.type = type;
+        this.title = this.type != 'receipt' ? '发货单' : '收货单';
+        this.itemData = item;
+        this.id = item.id;
+        this.getDetail(item.id);
+      },
+
+      async getDetail(id) {
+        const URL =
+          this.type == 'receiving' ? receivingGoodsDetailList : sendGoodsList;
+
+        await URL({
+          applyOutsourcedId: id
+        }).then((res) => {
+          this.goodsList = res.map((item) => {
+            return item;
+          });
+        });
+      },
+
+      save() {
+        if (this.type != 'receipt') {
+          if (this.goodsList.length == 0) {
+            return this.$message.warning('请先新增一条在制品数据!');
+          }
+
+          this.loading = this.$loading({
+            lock: true,
+            text: '加载中',
+            background: 'rgba(0, 0, 0, 0.7)'
+          });
+
+          if (this.type == 'receiving') {
+            receivingGoodsList(JSON.parse(JSON.stringify(this.goodsList)))
+              .then((res) => {
+                this.loading.close();
+                this.$message.success('发货成功');
+                this.$emit('done');
+                this.visible = false;
+              })
+              .catch(() => {
+                this.loading.close();
+              });
+          } else {
+            saveSend(this.goodsList)
+              .then((res) => {
+                this.loading.close();
+                this.$message.success('发货成功');
+                this.$emit('done');
+                this.visible = false;
+              })
+              .catch(() => {
+                this.loading.close();
+              });
+          }
+        } else if (this.type == 'receipt') {
+          this.loading = this.$loading({
+            lock: true,
+            text: '加载中',
+            background: 'rgba(0, 0, 0, 0.7)'
+          });
+          pleaseTReceiveGoods(this.goodsList)
+            .then((res) => {
+              this.loading.close();
+              this.$message.success('收货成功');
+              this.$emit('done');
+              this.visible = false;
+            })
+            .catch(() => {
+              this.loading.close();
+            });
+        }
+      },
+
+      cancel() {
+        this.visible = false;
+      },
+
+      chooseData(dataList) {
+        this.goodsList = [];
+
+        dataList.forEach((item) => {
+          this.goodsList.push(this.deepCopy(item));
+        });
+      },
+
+      rejectReason() {},
+
+      deepCopy(obj, hash = new WeakMap()) {
+        if (obj === null) return null;
+        if (obj instanceof Date) return new Date(obj);
+        if (obj instanceof RegExp) return new RegExp(obj);
+        if (typeof obj !== 'object' && typeof obj !== 'function') return obj;
+        if (hash.has(obj)) return hash.get(obj);
+
+        const result = Array.isArray(obj) ? [] : {};
+        hash.set(obj, result);
+
+        return Object.keys(obj).reduce((acc, key) => {
+          acc[key] = this.deepCopy(obj[key], hash);
+          return acc;
+        }, result);
+      },
+
+      addGoods() {
+        this.$refs.addInvoiceRef.open(this.id, this.goodsList);
+      }
+    }
+  };
+</script>
+
+<style></style>

+ 297 - 0
src/views/outsourcing/components/sendReceivingDetail.vue

@@ -0,0 +1,297 @@
+<template>
+  <div>
+    <ele-pro-table
+      ref="entrustCreateTable"
+      :columns="columns"
+      :datasource="goodsList"
+      :selection.sync="selection"
+      :current.sync="current"
+      highlight-current-row
+      row-key="id"
+      height="40vh"
+    >
+      <template v-slot:totalCount="{ row }">
+        <span>{{ row.totalCount }}{{ row.measuringUnit }}</span>
+      </template>
+
+      <template v-slot:totalWeight="{ row }">
+        <span>{{ row.totalWeight }}{{ row.weightUnit }}</span>
+      </template>
+
+      <template v-slot:receiveQuantity="{ row }">
+        <el-input
+          placeholder=""
+          v-model="row.receiveQuantity"
+          :disabled="type == 'receipt' && itemData.sendStatus == 4"
+        >
+          <template slot="append">{{ row.measuringUnit }}</template>
+        </el-input>
+      </template>
+
+      <template v-slot:rootCategoryLevelId="{ row }">
+        <el-tag>{{ typeName[Number(row.rootCategoryLevelId)] }}</el-tag>
+      </template>
+    </ele-pro-table>
+  </div>
+</template>
+
+<script>
+  import {
+    sendGoodsList,
+    saveSend,
+    receivingGoodsDetailList,
+    receivingGoodsList
+  } from '@/api/outsourcing';
+  import { typeName } from '@/views/produce/components/common.js';
+
+  import addInvoice from './addInvoice.vue';
+  export default {
+    components: {
+      addInvoice
+    },
+
+    props: {
+      item: {
+        type: Object,
+        default: () => {}
+      },
+      type: {
+        type: String,
+        default: ''
+      }
+    },
+
+    data() {
+      return {
+        visible: false,
+        goodsList: [],
+        selection: [],
+        current: null,
+        typeName,
+        itemData: {},
+        loading: null
+      };
+    },
+
+    watch: {
+      type: {
+        immediate: true,
+        deep: true,
+        handler(newVal) {
+          this.getDetail(this.item.id);
+        }
+      }
+    },
+
+    computed: {
+      columns() {
+        return [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'categoryName',
+            label: '名称',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'brandNum',
+            label: '牌号',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'totalCount',
+            slot: 'totalCount',
+            label: '数量',
+            align: 'center',
+            minWidth: 140,
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'workOrderCode',
+            label: '生产工单号',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'receiveQuantity',
+            slot: 'receiveQuantity',
+            label: '接收数量',
+            align: 'center',
+            minWidth: 150,
+            showOverflowTooltip: true,
+            show: this.type == 'receipt' ? true : false
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'modelType',
+            label: '型号',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+
+          // {
+          //   prop: 'taskName',
+          //   label: '工序',
+          //   align: 'center',
+          //   minWidth: 150,
+          //   showOverflowTooltip: true
+          // },
+          {
+            prop: 'categoryCode',
+            label: '编码',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'totalWeight',
+            slot: 'totalWeight',
+            label: '重量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'rootCategoryLevelId',
+            slot: 'rootCategoryLevelId',
+            label: '类型',
+            align: 'center',
+            showOverflowTooltip: true
+          }
+        ];
+      }
+    },
+
+    methods: {
+      async getDetail(id) {
+        const URL =
+          this.type == 'receiving' ? receivingGoodsDetailList : sendGoodsList;
+
+        await URL({
+          applyOutsourcedId: id
+        }).then((res) => {
+          this.goodsList = res.map((item) => {
+            return item;
+          });
+        });
+      },
+
+      save() {
+        if (this.type != 'receipt') {
+          if (this.goodsList.length == 0) {
+            return this.$message.warning('请先新增一条在制品数据!');
+          }
+
+          this.loading = this.$loading({
+            lock: true,
+            text: '加载中',
+            background: 'rgba(0, 0, 0, 0.7)'
+          });
+
+          if (this.type == 'receiving') {
+            receivingGoodsList(JSON.parse(JSON.stringify(this.goodsList)))
+              .then((res) => {
+                this.loading.close();
+                this.$message.success('发货成功');
+                this.$emit('done');
+                this.visible = false;
+              })
+              .catch(() => {
+                this.loading.close();
+              });
+          } else {
+            saveSend(this.goodsList)
+              .then((res) => {
+                this.loading.close();
+                this.$message.success('发货成功');
+                this.$emit('done');
+                this.visible = false;
+              })
+              .catch(() => {
+                this.loading.close();
+              });
+          }
+        } else if (this.type == 'receipt') {
+          this.loading = this.$loading({
+            lock: true,
+            text: '加载中',
+            background: 'rgba(0, 0, 0, 0.7)'
+          });
+          pleaseTReceiveGoods(this.goodsList)
+            .then((res) => {
+              this.loading.close();
+              this.$message.success('收货成功');
+              this.$emit('done');
+              this.visible = false;
+            })
+            .catch(() => {
+              this.loading.close();
+            });
+        }
+      },
+
+      cancel() {
+        this.visible = false;
+      },
+
+      chooseData(dataList) {
+        this.goodsList = [];
+
+        dataList.forEach((item) => {
+          this.goodsList.push(this.deepCopy(item));
+        });
+      },
+
+      rejectReason() {},
+
+      deepCopy(obj, hash = new WeakMap()) {
+        if (obj === null) return null;
+        if (obj instanceof Date) return new Date(obj);
+        if (obj instanceof RegExp) return new RegExp(obj);
+        if (typeof obj !== 'object' && typeof obj !== 'function') return obj;
+        if (hash.has(obj)) return hash.get(obj);
+
+        const result = Array.isArray(obj) ? [] : {};
+        hash.set(obj, result);
+
+        return Object.keys(obj).reduce((acc, key) => {
+          acc[key] = this.deepCopy(obj[key], hash);
+          return acc;
+        }, result);
+      },
+
+      addGoods() {
+        this.$refs.addInvoiceRef.open(this.id, this.goodsList);
+      }
+    }
+  };
+</script>
+
+<style></style>

+ 67 - 7
src/views/outsourcing/index.vue

@@ -35,6 +35,18 @@
           <div v-else>无</div>
         </template>
 
+        <template v-slot:sendStatus="{ row }">
+          <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:requireDeliveryTime="{ row }">
           <span v-if="row.deliveryMethod == 1">{{
             row.requireDeliveryTime
@@ -86,9 +98,9 @@
           <el-tag v-if="row.purchaseStatus == 1" type="warning"
             >原料入库</el-tag
           >
-          <!-- <el-tag v-if="row.purchaseStatus == 2" type="success"
-            >审核通过</el-tag
-          > -->
+          <el-tag v-if="row.purchaseStatus == 2" type="success"
+            >原料出库</el-tag
+          >
           <el-tag v-if="row.purchaseStatus == 3" type="success"
             >委外完成</el-tag
           >
@@ -152,6 +164,27 @@
           >
             提交
           </el-link>
+
+          <!-- <el-link
+            type="primary"
+            :underline="false"
+            @click="sendGoods(row, 'add')"
+            v-if="
+              row.approvalStatus == 2 &&
+              (row.sendStatus == 0 || !row.sendStatus)
+            "
+          >
+            发货
+          </el-link>
+
+          <el-link
+            type="primary"
+            :underline="false"
+            @click="receivingGoods(row, 'receiving')"
+            v-if="row.approvalStatus == 2 && row.sendStatus == 1"
+          >
+            收货
+          </el-link> -->
         </template>
       </ele-pro-table>
     </el-card>
@@ -161,6 +194,8 @@
     <detail ref="detailsRef"></detail>
 
     <timeDialog ref="timeDialogRef"></timeDialog>
+
+    <goodsDetail ref="goodsDetailRef" @done="refresh"></goodsDetail>
   </div>
 </template>
 
@@ -172,13 +207,16 @@
   import Detail from './components/details.vue';
   import timeDialog from './components/timeDialog.vue';
   import { getFile } from '@/api/system/file';
+  import goodsDetail from './components/goodsDetail.vue';
+
   export default {
     components: {
       search,
       flow,
       release,
       Detail,
-      timeDialog
+      timeDialog,
+      goodsDetail
     },
     data() {
       return {
@@ -228,12 +266,14 @@
             prop: 'code',
             label: '委外单编码',
             align: 'center',
+            minWidth: 120,
             showOverflowTooltip: true
           },
           {
             prop: 'name',
             label: '委外单名称',
             align: 'center',
+            minWidth: 120,
             showOverflowTooltip: true
           },
 
@@ -248,6 +288,7 @@
             prop: 'taskName',
             label: '委外发起工序',
             align: 'center',
+            minWidth: 120,
             showOverflowTooltip: true
           },
           {
@@ -314,7 +355,7 @@
             slot: 'requireDeliveryTime',
             label: '预计到货日期',
             align: 'center',
-            width: 100,
+            minWidth: 120,
             showOverflowTooltip: true
           },
 
@@ -367,7 +408,14 @@
             showOverflowTooltip: true,
             width: 110
           },
-
+          {
+            prop: 'sendStatus',
+            slot: 'sendStatus',
+            label: '发货状态',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
           {
             label: '图片附件',
             slot: 'technicalDrawings',
@@ -438,7 +486,7 @@
       },
 
       handleDetails(row) {
-        this.$refs.detailsRef.open(row);
+        this.$refs.detailsRef.open(row, 'detail');
       },
 
       handleMethod(row) {
@@ -460,12 +508,24 @@
         this.$refs.table.reload();
       },
 
+      sendGoods(item, type) {
+        this.$refs.goodsDetailRef.open(item, type);
+      },
+
+      receivingGoods(item, type) {
+        this.$refs.goodsDetailRef.open(item, type);
+      },
+
       fullscreenChange(fullscreen) {
         if (fullscreen) {
           this.tableHeight = 'calc(100vh - 120px)';
         } else {
           this.tableHeight = 'calc(100vh - 300px)';
         }
+      },
+
+      refresh() {
+        this.$refs.table.reload();
       }
     }
   };

+ 0 - 7
src/views/produce/components/outsourcing/new_outsourceList.vue

@@ -377,13 +377,6 @@
                     v-if="item.isDemandQuantity && clientEnvironmentId != 2"
                     style="width: 15%"
                   >
-                    <!-- <span>数量</span
-                    >{{
-                      checkListLen == 0
-                        ? item.demandQuantity
-                        : item.count * (checkListLen || 1)
-                    }}
-                    {{ item.unit }} -->
                     <span>数量</span>
                     <input
                       style="width: 90% !important"

+ 20 - 2
src/views/produceOrder/components/details/index.vue

@@ -149,7 +149,7 @@
       },
 
       open(row) {
-        this.workOrderInfo = row;
+        this.workOrderInfo = this.deepCopy(row);
         this.routeObj.id = this.workOrderInfo.id;
         console.log(this.workOrderInfo.id, 'workOrderInfo.id');
         console.log('workOrderInfo', this.workOrderInfo);
@@ -161,9 +161,11 @@
         getTaskInstanceList(this.workOrderInfo.id).then((res) => {
           this.routeList = res;
 
+          console.log(this.routeList, '9999999');
+
           // 使用findIndex方法查找
           const index = this.routeList.findIndex(
-            (item) => Number(item.taskId) == Number(this.workOrderInfo.taskId)
+            (item) => item.taskId == this.workOrderInfo.taskId
           );
 
           console.log('index', index);
@@ -185,6 +187,22 @@
         });
       },
 
+      deepCopy(obj, hash = new WeakMap()) {
+        if (obj === null) return null;
+        if (obj instanceof Date) return new Date(obj);
+        if (obj instanceof RegExp) return new RegExp(obj);
+        if (typeof obj !== 'object' && typeof obj !== 'function') return obj;
+        if (hash.has(obj)) return hash.get(obj);
+
+        const result = Array.isArray(obj) ? [] : {};
+        hash.set(obj, result);
+
+        return Object.keys(obj).reduce((acc, key) => {
+          acc[key] = this.deepCopy(obj[key], hash);
+          return acc;
+        }, result);
+      },
+
       handIdx(index, item) {
         this.curTaskObj = JSON.parse(JSON.stringify(item));
 

+ 24 - 20
src/views/produceOrder/components/releaseDialog/index.vue

@@ -221,7 +221,7 @@
                   <el-option
                     v-for="item in shiftList"
                     :key="item.id"
-                    :label="item.name"
+                    :label="item.dutyName"
                     :value="item.id"
                   >
                   </el-option>
@@ -1044,6 +1044,8 @@
         try {
           const res = await listAssign(params);
           this.tabLoading = false;
+
+          console.log(res, '数据11445');
           // 如果 res 没有数据 说明未对数据进行操作 直接赋值
           if (res.length == 0) {
             this.$set(dataRow, 'list', list);
@@ -1119,25 +1121,25 @@
 
         if (listArr.length == 0) return;
 
-        listArr.forEach((it) => {
-          if (it.disposalStatus || it.disposalStatus == 0) {
-            arrList.map((item) => {
-              if (item.assigneeType.code == dataRow.assignType) {
-                let idx = listMap[item.assigneeId]; 
-                listArr[idx].disposalStatus = item.disposalStatus;
-                listArr[idx].status = item.status;
-                listArr[idx].startTime = item.startTime;
-                listArr[idx].endTime = item.endTime;
-                listArr[idx].quantity = item.quantity;
-                listArr[idx].weight = item.weight;
-                listArr[idx].changeId = item.id;
-                listArr[idx].teamTimeIds = item.teamTimeIds;
-                this.compareAndSetTime(listArr[idx], dataRow);
-                this.compareEndSetTime(listArr[idx], dataRow);
-              }
-            });
+        // listArr.forEach((it) => {
+        //   if (it.disposalStatus || it.disposalStatus == 0) {
+        arrList.map((item) => {
+          if (item.assigneeType.code == dataRow.assignType) {
+            let idx = listMap[item.assigneeId];
+            listArr[idx].disposalStatus = item.disposalStatus;
+            listArr[idx].status = item.status;
+            listArr[idx].startTime = item.startTime;
+            listArr[idx].endTime = item.endTime;
+            listArr[idx].quantity = item.quantity;
+            listArr[idx].weight = item.weight;
+            listArr[idx].changeId = item.id;
+            listArr[idx].teamTimeIds = item.teamTimeIds;
+            this.compareAndSetTime(listArr[idx], dataRow);
+            this.compareEndSetTime(listArr[idx], dataRow);
           }
         });
+        //   }
+        // });
 
         // console.log(listArr,'listArr')
         this.$set(dataRow, 'list', listArr);
@@ -1260,8 +1262,10 @@
         // this.selectedListData(row, item);
         let data = this.shifTimeData(e, row);
         // let data = this.shiftList.find((item) => item.id == e);
-        let startTime = `${this.dateValue} ${data.startTime}`;
-        let endTime = `${this.dateValue} ${data.endTime}`;
+        // let startTime = `${this.dateValue} ${data.startTime}`;
+        // let endTime = `${this.dateValue} ${data.endTime}`;
+        let startTime = `${this.dateValue} ${data.startTime}` + `:00`;
+        let endTime = `${this.dateValue} ${data.endTime}` + `:00`;
         this.$set(row, 'startTime', startTime);
         this.$set(row, 'endTime', endTime);
         this.handleStartTimeChange(row, item);

+ 0 - 4
src/views/warehousing/index.vue

@@ -58,10 +58,6 @@
           >
             流程
           </el-link>
-
-          <!-- <el-link type="primary" :underline="false" @click="sendGoods(row)">
-            发货
-          </el-link> -->
           <!-- <el-link type="primary" :underline="false" @click="details(row)">
             详情
           </el-link> -->

+ 2 - 2
vue.config.js

@@ -35,7 +35,7 @@ module.exports = {
         // target: 'http://192.168.1.125:18086',
         // 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.125: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
@@ -47,7 +47,7 @@ module.exports = {
         // target: 'http://192.168.1.251:18087',
         // target: 'http://116.163.22.90:86/api', // 嘉实生产
         // target: 'http://aiot.zoomwin.com.cn:51001/api',
-        target: 'http://f222326r53.imwork.net',
+        // target: 'http://f222326r53.imwork.net',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''