2213980799@qq.com před 1 rokem
rodič
revize
fb741bbc43

+ 14 - 0
src/api/produce/job.js

@@ -0,0 +1,14 @@
+import request from '@/utils/request';
+
+
+
+// 报工-pad获取工单信息
+export async function listByIdsReport(data) {
+    const res = await request.post(`/mes/workorder/listByIdsReport`, data);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  }
+  
+ 

+ 1 - 1
src/config/setting.js

@@ -2,7 +2,7 @@
 export const API_BASE_URL = process.env.VUE_APP_API_BASE_URL;
 
 // 项目名称
-export const PROJECT_NAME = process.env.VUE_APP_NAME;
+export const PROJECT_NAME = '';
 
 // 不显示侧栏的路由
 export const HIDE_SIDEBARS = [];

+ 3 - 2
src/views/oneClickWorkReporting/index.vue

@@ -2143,6 +2143,7 @@ export default {
       if (obj.taskList.length == 0) {
         return this.$alert('请选择至少一条数据和模数!');
       }
+      
 
       // 判断addModelsObj里addModulus(输入的模数)是否>cuttingMargin(切割余量)
       let flag = false;
@@ -2150,7 +2151,7 @@ export default {
         for (let j = 0; j < this.addModelsList.length; j++) {
           if (
             this.addModelsList[j].addModulus >
-            Number(this.cuttingTaskTableData[i].addModulus)
+            Number(this.cuttingTaskTableData[i].qgSum)
           ) {
             flag = true;
             break;
@@ -2160,7 +2161,7 @@ export default {
       if (flag) {
         return this.$alert('报工模数不能大于切割余量!');
       }
-
+    
       this.tempModelsList = this.addModelsList;
       try {
         this.pageLoading = true;

+ 8 - 0
src/views/produce/components/feeding/index.vue

@@ -461,6 +461,10 @@
           width: 80px !important;
           font-size: 12px;
         }
+        .lable100{
+          width: 100px !important;
+        }
+
 
         .ww60 {
           width: 60px;
@@ -512,6 +516,10 @@
       .ww45 {
         width: 45%;
       }
+      .ww40 {
+        width: 40%;
+      }
+
 
       .ww30 {
         width: 30%;

+ 292 - 0
src/views/produce/components/jobBooking/components/jobBom.vue

@@ -0,0 +1,292 @@
+<template>
+  <div>
+    <div class="title_box rx-bc mt6">
+      <div class="name">报工信息 </div>
+
+      <div class="rx-bc"> </div>
+    </div>
+
+    <div class="material">
+      <div class="content_table">
+        <div class="item rx-sc">
+          <div
+            class="rx ww33"
+            v-if="Object.prototype.hasOwnProperty.call(item, 'product')"
+          >
+            <div class="lable rx-cc">投料数量</div>
+            <div class="content">
+              {{ item.product[0] && item.product[0].feedQuantity }}
+            </div>
+          </div>
+
+          <div class="rx ww33">
+            <div class="lable lable100 rx-cc">要求生产数量</div>
+            <div class="content">{{ item.formingNum }} {{ item.unit }}</div>
+          </div>
+
+          <div class="rx ww33">
+            <div class="lable rx-cc">重量</div>
+            <div class="content"
+              >{{ item.formingWeight }}{{ item.weightUnit }}</div
+            >
+          </div>
+        </div>
+
+        <div class="item rx-sc">
+          <div class="rx ww40">
+            <div class="lable lable100 rx-cc">合格品数量</div>
+            <div class="content content_num rx-sc">
+              <el-input
+                size="mini"
+                v-model="item.workReportInfo.formedNum"
+                placeholder="请输入合格品数量"
+                @input="blurNum"
+              >
+                <template slot="append">{{ item.unit }}</template>
+              </el-input>
+            </div>
+          </div>
+
+          <div class="rx ww40">
+            <div class="lable rx-cc">重量</div>
+            <div class="content content_num rx-sc">
+              <el-input
+                size="mini"
+                v-model="item.workReportInfo.formedWeight"
+                placeholder="请输入合格品重量"
+              >
+                <template slot="append">{{ item.weightUnit }}</template>
+              </el-input>
+            </div>
+          </div>
+        </div>
+
+        <div
+          class="item rx-sc"
+          v-for="(not, notIndex) in notFormedList"
+          :key="notIndex"
+        >
+          <div class="rx ww40">
+            <div class="lable lable100 rx-cc">不合格数量</div>
+            <div class="content content_num rx-sc">
+              <el-input
+                size="mini"
+                v-model="not.notFormedNum"
+                placeholder="请输入不合格数量"
+                @input="changeNum"
+              >
+                <template slot="append">{{ item.unit }}</template>
+              </el-input>
+            </div>
+          </div>
+
+          <div class="rx ww40">
+            <div class="lable rx-cc">重量</div>
+            <div class="content content_num rx-sc">
+              <el-input
+                size="mini"
+                v-model="not.notFormedWeight"
+                placeholder="请输入不合格品重量"
+              >
+                <template slot="append">{{ item.weightUnit }}</template>
+              </el-input>
+            </div>
+          </div>
+
+          <div class="rw ww20 rx-cc">
+            <div
+              class="penalize"
+              v-if="!isDetails"
+              :style="{ background: not.warehouseId ? '#FFA07A' : '' }"
+              @click="penalize"
+            >
+              处置</div
+            >
+            <div
+              class="penalize"
+              v-if="isDetails"
+              :style="{ background: not.warehouseId ? '#FFA07A' : '' }"
+              @click="
+                handleView(isDetails ? not.warehouseName : item.warehouseName)
+              "
+            >
+              查看</div
+            >
+          </div>
+        </div>
+      </div>
+    </div>
+
+    <el-dialog
+      title="仓库处置"
+      :visible.sync="visible"
+      :before-close="handleClose"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      append-to-body
+      width="500px"
+    >
+      <el-form
+        size="mini"
+        :model="form"
+        label-width="96px"
+      
+      >
+        <el-form-item
+          label="仓库"
+          prop="warehouseList"
+        >
+          <el-select v-model="form.warehouseId" placeholder="请选择仓库">
+            <el-option
+              v-for="item in warehouseList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+
+      <template slot="footer">
+        <el-button size="mini" @click="visible = false">取 消</el-button>
+        <el-button size="mini" type="primary" @click="warehouseSave">保 存</el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+<script>
+  export default {
+    props: {
+      item: {
+        type: Object,
+        default: () => {}
+      },
+      notFormed: {
+        type: Array,
+        default: () => []
+      },
+      isDetails: {
+        type: Boolean,
+        default: false
+      },
+      warehouseList: {
+        type: Array,
+        default: () => []
+      }
+    },
+
+    watch: {
+      notFormed: {
+        immediate: true,
+        deep: true,
+        handler(newVal) {
+          this.notFormedList = newVal;
+        }
+      }
+    },
+
+    data() {
+      return {
+        notFormedList: [],
+
+        form: {
+          warehouseId: null
+        },
+
+        visible: false
+      };
+    },
+
+    created() {
+      if (this.isDetails) {
+        this.notFormedList = this.notFormedList.map((m) => {
+          return {
+            notFormedNum: Number(m.quantity),
+            notFormedWeight: m.weight,
+            ...m
+          };
+        });
+      }
+    },
+
+    methods: {
+      penalize() {
+        this.visible = true;
+      },
+
+      handleClose() {
+        this.visible = true;
+      },
+
+      warehouseSave() {
+        console.log(this.form);
+      },
+
+      handleView(name) {
+        this.$message.info(name || '未设置');
+      },
+
+      getDelete(index) {
+        this.list.splice(index, 1);
+      },
+
+      blurNum() {
+        let total =
+          Number(this.item.workReportInfo.formedNum) +
+          Number(this.notFormedList[0].notFormedNum);
+        this.$emit('modeNum', total);
+
+        if (
+          this.item.product[0] &&
+          this.item.product[0].feedQuantity > 0 &&
+          Number(this.item.workReportInfo.formedNum)
+        ) {
+          this.$set(
+            this.notFormedList[0],
+            'notFormedNum',
+            this.item.product[0].feedQuantity -
+              Number(this.item.workReportInfo.formedNum)
+          );
+          this.notForme();
+        }
+
+        let weight =
+          Number(this.item.workReportInfo.formedNum) *
+          Number(this.item.singleWeight) *
+          Number(this.item.weightMultiple);
+
+        if (['G', 'g', '克'].includes(this.item.singleWeightUnit)) {
+          weight = parseFloat((weight / 1000).toFixed(2));
+        } else {
+          weight = parseFloat(weight.toFixed(2));
+        }
+
+        this.$set(this.item.workReportInfo, 'formedWeight', weight);
+
+        this.$forceUpdate();
+      },
+
+      changeNum() {
+        this.notForme();
+        // this.blurNum()
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .lable {
+    width: 200px;
+  }
+
+  .penalize {
+    width: 80px;
+    line-height: 30px;
+    background: #157a2c;
+    font-size: 12px;
+    text-align: center;
+    color: #fff;
+    cursor: pointer;
+  }
+</style>

+ 264 - 0
src/views/produce/components/jobBooking/index.vue

@@ -0,0 +1,264 @@
+<template>
+  <div>
+    <div class="top_fixed">
+      <el-button type="primary" size="mini" @click="save(2, 'all')"
+        >一键报工</el-button
+      >
+      <el-button type="primary" size="mini" @click="removeCacheFn('all')"
+        >清空缓存</el-button
+      >
+      <el-button type="primary" size="mini" @click="save(1, 'all')"
+        >缓存</el-button
+      >
+    </div>
+
+    <div class="job_box">
+      <div
+        v-for="(item, index) in List"
+        :key="index"
+        class="card_box"
+        v-if="isLoad"
+      >
+        <div class="title_box rx-bc">
+          <div class="name">工单信息 </div>
+
+          <div class="rx-bc">
+            <el-button
+              type="text"
+              size="mini"
+              @click="openPicking(item.id, item)"
+              >添加物料</el-button
+            >
+            <el-button type="text" size="mini" @click="removeCacheFn(item.id)"
+              >清空缓存</el-button
+            >
+            <el-button type="text" size="mini" @click="save(1, index)"
+              >缓存</el-button
+            >
+          </div>
+        </div>
+
+        <workOrderBom :item="item"></workOrderBom>
+        <jobBom :item="item" :notFormed="item.notFormedList" :warehouseList="warehouseList"></jobBom>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+  import { listByIdsReport } from '@/api/produce/job';
+  import { getWarehouseList } from '@/api/produce/index'
+
+  import workOrderBom from '../feeding/components/workOrderBom.vue';
+  import jobBom from './components/jobBom.vue';
+  export default {
+    components: {
+      workOrderBom,
+      jobBom
+    },
+    props: {
+      workListIds: {
+        type: Array,
+        default() {
+          return [];
+        }
+      }
+    },
+    data() {
+      return {
+        List: [],
+        idsList: [],
+        isLoad: false,
+
+        warehouseList: [],
+      };
+    },
+
+    computed: {
+      taskObj() {
+        return this.$store.state.user.taskObj;
+      },
+
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
+
+    watch: {
+      workListIds: {
+        handler(val) {
+          this.getList(val);
+        },
+        deep: true,
+        immediate: true
+      }
+    },
+
+    created() {
+      this.getWarehouseListFn() 
+    },
+
+    methods: {
+      getList(ids) {
+        this.idsList = ids || [];
+        let param = {
+          ids: ids,
+          taskId: this.taskObj.id,
+          type: 0
+        };
+        this.isLoad = false;
+        listByIdsReport(param)
+          .then((res) => {
+            this.List = res.map((obj) => {
+              if (!Object.prototype.hasOwnProperty.call(obj, 'turnover')) {
+                obj['turnover'] = [];
+              }
+              if (
+                !Object.prototype.hasOwnProperty.call(obj, 'aridRegionList')
+              ) {
+                obj['aridRegionList'] = [];
+              }
+
+              if (!Object.prototype.hasOwnProperty.call(obj, 'instanceList')) {
+                obj['instanceList'] = [];
+              }
+
+              if (!Object.prototype.hasOwnProperty.call(obj, 'palletList')) {
+                obj['palletList'] = [];
+              }
+
+              if (
+                !Object.prototype.hasOwnProperty.call(obj, 'revolvingDiskList')
+              ) {
+                obj['revolvingDiskList'] = [];
+              }
+
+              if (obj.palletList.length > 0) {
+                obj.palletList = obj.palletList.map((m) => {
+                  return {
+                    hideKc: true, // 不显示库存
+                    quantity: m.feedQuantity,
+                    ...m
+                  };
+                });
+              }
+
+              if (this.taskObj.type == 6 && this.clientEnvironmentId == 3) {
+                obj.semiProductList = obj.pickOutInList;
+              }
+
+              obj.workReportInfo = {
+                formingNum: null,
+                formingWeight: null,
+                formedNum: null,
+                formedWeight: null,
+                taskId: this.taskObj.id
+              };
+
+              obj.notFormedList = [
+                {
+                  notFormedNum: null,
+                  notFormedWeight: null,
+                  weightUnit: obj.weightUnit,
+                  unit: obj.unit,
+                  warehouseId: null // 处置 仓库id
+                }
+              ];
+
+              if (obj.semiProductList.length > 0) {
+                // 预制体报工
+                obj.workReportInfo.formedNum = obj.semiProductList.length;
+              }
+
+              obj.workReportInfo.formingNum = obj.formingNum;
+              obj.workReportInfo.formingWeight = obj.formingWeight;
+              obj.workReportInfo.unit = obj.unit;
+              obj.workReportInfo.weightUnit = obj.weightUnit;
+              obj.workReportInfo.workOrderId = obj.workOrderId;
+
+              obj.paramDetailList.map((m) => {
+                if (m.extInfo.textType == 5) {
+                  m.remainingTime = m.extInfo.remainingTime;
+                }
+                return {
+                  ...m.extInfo
+                };
+              });
+
+              return {
+                ...obj
+              };
+            });
+          })
+          .finally(() => {
+            this.isLoad = true;
+
+            if (this.taskObj.id == 1) {
+              this.getCacheFn();
+            }
+          });
+      },
+      async save(type, index) {},
+
+      getCacheFn() {},
+
+      removeCacheFn(type) {},
+
+
+      getWarehouseListFn() {
+        getWarehouseList().then(res => {
+ 
+          this.warehouseList = res.data
+        })
+      },
+    }
+  };
+</script>
+
+<style scoped lang="scss">
+  .top_fixed {
+    width: 100%;
+    height: 40px;
+    background: #fff;
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+  }
+
+  .title_box {
+    .name {
+      font-size: 14px;
+      font-style: normal;
+      font-weight: 400;
+      color: #157a2c;
+      padding-left: 5px;
+      position: relative;
+
+      &:before {
+        position: absolute;
+        content: '';
+        left: 0px;
+        top: 0px;
+        bottom: 0px;
+        width: 2px;
+        height: 14px;
+        background: #157a2c;
+        margin: auto;
+      }
+    }
+  }
+
+  .job_box {
+    margin-top: 6px;
+    width: 100%;
+    height: calc(100vh - 70px - 50px - 80px - 60px);
+    overflow-y: scroll;
+    overflow-x: hidden;
+  }
+
+  .card_box {
+    background: #fff;
+    padding: 8px;
+    border-radius: 2px;
+  }
+</style>

+ 15 - 8
src/views/produce/components/produceOrder.vue

@@ -14,6 +14,10 @@
     <template v-slot:toolbar>
       <div class="c_title">工单列表 </div>
     </template>
+
+    <template v-slot:code="{ row }">
+      <el-link type="primary" :underline="false">{{ row.code }}</el-link>
+    </template>
   </ele-pro-table>
 </template>
 
@@ -36,7 +40,8 @@
             width: 45,
             type: 'selection',
             columnKey: 'selection',
-            align: 'center'
+            align: 'center',
+            fixed: true
           },
           {
             columnKey: 'index',
@@ -54,8 +59,9 @@
 
           {
             prop: 'code',
+            slot: 'code',
             label: '生产工单号',
-            align: 'center'
+            align: 'center',
           },
           {
             prop: '',
@@ -77,12 +83,13 @@
           {
             prop: 'productCode',
             label: '产品编码',
-            align: 'center'
+            align: 'center',
+
           },
           {
             prop: 'productName',
             label: '产品名称',
-            align: 'center'
+            align: 'center',
           },
 
           {
@@ -119,7 +126,7 @@
         return workorderPage({
           pageNum: page,
           size: 200,
-          taskId:  this.taskObj&& this.taskObj.id,
+          taskId: this.taskObj && this.taskObj.id,
           ...where
         });
       },
@@ -131,11 +138,11 @@
         });
       },
       handleSelectionChange(val) {
-        let ids = []
-        ids = val.map(item => {
+        let ids = [];
+        ids = val.map((item) => {
           return item.id;
         });
-        console.log(ids)
+        console.log(ids);
         this.$emit('workSelect', ids);
       },
 

+ 10 - 2
src/views/produce/index.vue

@@ -20,6 +20,10 @@
           <div v-if="operationType == 'feed'">
             <feeding :workListIds="workListIds"></feeding>
           </div>
+
+          <div v-if="operationType == 'job'">
+            <jobBooking :workListIds="workListIds" ref="jobRef"></jobBooking>
+          </div>
         </div>
       </div>
       <footBtn @footBtn="footBtn"></footBtn>
@@ -44,6 +48,8 @@
   import pickDetails from './components/picking/details.vue';
 
   import feeding from './components/feeding/index.vue';
+
+  import jobBooking from './components/jobBooking/index.vue';
   export default {
     components: {
       Search,
@@ -54,7 +60,9 @@
       picking,
       pickDetails,
 
-      feeding
+      feeding,
+
+      jobBooking
     },
     data() {
       return {
@@ -85,7 +93,7 @@
           this.$message.warning('请选择工序');
           return false;
         }
-        if (['pick', 'feed'].includes(t)) {
+        if (['pick', 'feed', 'job'].includes(t)) {
           if (this.workListIds.length == 0) {
             this.$message.warning('请选择工单列表');
             return false;

+ 1 - 0
src/views/produceOrder/components/carDialog.vue

@@ -18,6 +18,7 @@
       cache-key="materialDialogtable"
       :datasource="datasource"
       :selection.sync="selection"
+  
       height="45vh"
     >
     </ele-pro-table>

+ 1 - 1
src/views/produceOrder/detail.vue

@@ -34,7 +34,7 @@
         <el-descriptions-item label="计划类型">{{
           typeList[infoData.planType]
         }}</el-descriptions-item>
-        <el-descriptions-item label="物料编码">{{
+        <el-descriptions-item label="产品编码">{{
           infoData.productCode
         }}</el-descriptions-item>
         <el-descriptions-item label="产品名称">{{

+ 27 - 16
src/views/produceOrder/index.vue

@@ -23,11 +23,10 @@
         row-key="code"
         :cache-key="`${activeName}produceOrderTable`"
         :selection.sync="selection"
-
         @sort-change="onSortChange"
         autoAmendPage
-      >        
-      <!-- :parse-data="parseData" -->
+      >
+        <!-- :parse-data="parseData" -->
         <template v-slot:toolbar>
           <el-button type="success">新建</el-button>
           <el-button type="success">暂停</el-button>
@@ -71,13 +70,26 @@
             trigger="hover"
             content="数值越大优先级越高(0-3普通, 4-6优先, 7-10紧急)"
           >
-            <div class="sort-wrap"  slot="reference">
+            <div class="sort-wrap" slot="reference">
               <i class="el-icon-caret-top" @click="sortTop(row)"></i>
               <i class="el-icon-caret-bottom" @click="sortBottom(row)"></i>
             </div>
           </el-popover>
         </template>
 
+        <template v-slot:formingNum="{ row }">
+          <span >
+            {{ row.formingNum }}  {{ row.unit }}
+          </span>
+        </template>
+
+        <template v-slot:formingWeight="{ row }">
+          <span >
+            {{ row.formingNum }}  {{ row.weightUnit }}
+          </span>
+        </template>
+
+
         <template v-slot:status="{ row }">
           <span :class="{ 'ele-text-danger': row.status == 3 }">
             {{ statusFormatter(row.status) }}
@@ -307,24 +319,26 @@
 
           {
             prop: 'formingNum',
-            label: '要求生产数量(方)',
+            label: '要求生产数量',
             align: 'center',
+            slot: 'formingNum',
             showOverflowTooltip: true,
-            minWidth: 150
+            minWidth: 110
           },
           {
             prop: 'formingWeight',
             label: '要求生产重量',
+            slot: 'formingWeight',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
             prop: 'formedNum',
-            label: '已生产数量(方)',
+            label: '已生产数量',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 150
+            minWidth: 110
           },
           {
             prop: 'formedWeight',
@@ -428,15 +442,13 @@
         return res;
       },
 
-
       onSortChange(e) {
         let sort = {
           orderBy: e.order,
-          sortName:  e.prop,
-        }
-        this.sort = sort
-        this.reload()
-       
+          sortName: e.prop
+        };
+        this.sort = sort;
+        this.reload();
       },
       flattenArray(arr) {
         var result = []; // 存放结果的数组
@@ -457,12 +469,11 @@
 
       /* 数据转为树形结构 */
       parseData(data) {
-        console.log(99,data);
+        console.log(99, data);
         return this.$util.toTreeData({
           data: data.list,
           count: data.total,
 
-
           idField: 'code',
           parentIdField: 'originalCode'
         });

+ 2 - 2
src/views/unacceptedProduct/components/edit.vue

@@ -230,8 +230,8 @@ export default {
     // 输入块数计算规格体积是否超出原规格体积
     inputNumber(row) {
       if (
-        !row.productName.includes('板材') &&
-        !row.productName.includes('砌块')
+        !row.productNameNew.includes('板材') &&
+        !row.productNameNew.includes('砌块')
       ) {
         return;
       }

+ 2 - 2
src/views/warehousing/components/search.vue

@@ -1,9 +1,9 @@
 <!-- 搜索表单 -->
 <template>
-    <el-form label-width="90px" class="ele-form-search" @keyup.enter.native="search" @submit.native.prevent>
+    <el-form label-width="100px" class="ele-form-search" @keyup.enter.native="search" @submit.native.prevent>
         <el-row :gutter="15">
             <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-                <el-form-item label="工单编码:">
+                <el-form-item label="关联单据编码:">
                     <el-input clearable v-model="where.workOrderCode" placeholder="请输入" />
                 </el-form-item>
             </el-col>

+ 8 - 2
src/views/warehousing/index.vue

@@ -4,7 +4,7 @@
             <search @search="reload" ref="searchRef"> </search>
 
             <!-- 数据表格 -->
-            <ele-pro-table ref="table" :columns="columns" :datasource="datasource" cache-key="workOrderTable">
+            <ele-pro-table ref="table" :columns="columns" :datasource="datasource" >
 
 
 
@@ -88,9 +88,15 @@ export default {
                     showOverflowTooltip: true,
                     fixed: 'left'
                 },
+                {
+                    prop: 'code',
+                    label: '入库申请单编码',
+                    align: 'center',
+                    minWidth: 110
+                },
                 {
                     prop: 'workOrderCode',
-                    label: '工单编码',
+                    label: '关联单据编码',
                     align: 'center',
                     minWidth: 110
                 },