Преглед изворни кода

生产+工序撤销+产品报损

koushanshan пре 3 година
родитељ
комит
5fc0eab13e

+ 4 - 0
src/api/pages/pdm/collect.js

@@ -21,6 +21,10 @@ export default {
     getBlameNode:'/get_blame_node',
     getBlameNode:'/get_blame_node',
     //查询缺陷位置
     //查询缺陷位置
     placeListBy:'/place_list_by',
     placeListBy:'/place_list_by',
+    //撤销验证条码
+    checkBarCodeNodeUndo:'/check_bar_code_node_undo',
+    //保存产品报损
+    scrap:'/scrap',
 
 
   }
   }
 }
 }

+ 12 - 0
src/api/pages/pdm/produce.js

@@ -47,6 +47,18 @@ export const routeUrl = {
   recover:{
   recover:{
     add:{key:'add',url:'/pdm/data-collection/recover-add',flgSameRoute: true},
     add:{key:'add',url:'/pdm/data-collection/recover-add',flgSameRoute: true},
   },
   },
+  //工序撤销
+  processNodeReverse:{
+    add:{key:'add',url:'/pdm/process-node-reverse/add'},
+  },
+  //产品报损
+  prodDefect:{
+    //新建
+    add:{key:'add',url:'/pdm/prod-defect/add'},
+    //撤销
+    reverse:{key:'reverse',url:'/pdm/prod-defect/reverse'},
+  },
+
 
 
 }
 }
 
 

+ 1 - 0
src/config/index.js

@@ -274,6 +274,7 @@ export default {
   gradeKindType:{
   gradeKindType:{
     flaw:'产品等级-瑕',
     flaw:'产品等级-瑕',
     inferior:'产品等级-劣',
     inferior:'产品等级-劣',
+    decrease:'产品等级-损',
     goodProduct:'产品等级-良',
     goodProduct:'产品等级-良',
     excellent:'产品等级-优',
     excellent:'产品等级-优',
   },
   },

+ 11 - 1
src/locale/lang/zh-CN.js

@@ -341,6 +341,7 @@ export const columns = {
   busobjCategory: '对象类别',
   busobjCategory: '对象类别',
   ftyId: '工厂',
   ftyId: '工厂',
   parentModelCategory: '上级分类',
   parentModelCategory: '上级分类',
+  LossReportingInformation: '报损信息',
 
 
   categoryCode: '分类编码',
   categoryCode: '分类编码',
   categoryName: '分类名称',
   categoryName: '分类名称',
@@ -740,7 +741,14 @@ export const columns = {
   blameUserCode:'工号编码',
   blameUserCode:'工号编码',
   blameUserName:'工号名称',
   blameUserName:'工号名称',
   blameJobCode:'工种编码',
   blameJobCode:'工种编码',
-  blameJobName:'工种名称',
+  //撤销
+  reasonPdtFlowNodeName:'完成工序',
+  reasonCarrierCode:'所在载具',
+  reasonCause:'撤销原因',
+  //产品报损
+  damageReason:'损柸原因',
+  gradeClassification:'产品分级',
+
   //工位打卡
   //工位打卡
   replaceStaffName:'替班员工',
   replaceStaffName:'替班员工',
   saveOffWork:'下班(F)',
   saveOffWork:'下班(F)',
@@ -880,6 +888,7 @@ export const messages = {
   W_117: '此工序无此用户',
   W_117: '此工序无此用户',
   W_118: '存在相同窑车窑炉位置',
   W_118: '存在相同窑车窑炉位置',
   W_119: '当前暂无选中节点,请选中后重新删除',
   W_119: '当前暂无选中节点,请选中后重新删除',
+  W_120: '当前明细已存在相同产品',
   E_001: '系统出现异常,请联系管理员。',
   E_001: '系统出现异常,请联系管理员。',
   Q_001: '当前页面的数据有过更改,请确认需要保存吗?',
   Q_001: '当前页面的数据有过更改,请确认需要保存吗?',
   Q_002: '确定要进行{param}操作吗?',
   Q_002: '确定要进行{param}操作吗?',
@@ -892,6 +901,7 @@ export const messages = {
   Q_009: '窑车序号不可为空',
   Q_009: '窑车序号不可为空',
   Q_010: '是否保存,保存后周期次数清零!',
   Q_010: '是否保存,保存后周期次数清零!',
   Q_011: '载具型号不可为空',
   Q_011: '载具型号不可为空',
+  Q_012: '撤销原因需保持一致,确定后清空明细数据,是否继续?',
 }
 }
 
 
 /**
 /**

+ 0 - 1
src/mixins/index.js

@@ -737,7 +737,6 @@ export const indexMixin = {
       }
       }
       // 给dk-table列表注册cellMenu事件
       // 给dk-table列表注册cellMenu事件
       if (_this.$refs) {
       if (_this.$refs) {
-        // console.log('34343',_this.$refs)
         let arr = Object.keys(_this.$refs);
         let arr = Object.keys(_this.$refs);
         if (arr && arr.length > 0) {
         if (arr && arr.length > 0) {
           arr.forEach(it => {
           arr.forEach(it => {

+ 1 - 1
src/view/mst/product-view/form.vue

@@ -583,7 +583,7 @@
                   return
                   return
                 }
                 }
                 //判断每个图片列表是否填写位置名称
                 //判断每个图片列表是否填写位置名称
-                // this.loading = true
+                this.loading = true
                 //参数赋值
                 //参数赋值
                 this.setParams()
                 this.setParams()
                 //调用后台保存或编辑
                 //调用后台保存或编辑

+ 0 - 25
src/view/pdm/data-collection/halfCheck-add.vue

@@ -237,26 +237,6 @@
             searchDetailFlag: false
             searchDetailFlag: false
           },
           },
         ],
         ],
-        //责任员工
-        staffColumn: [
-          // 责任员工
-          {
-            field: 'staffName',
-            controlId: 'staffId',
-            title: self.$t('blameStaffId'),
-            width: 'auto',
-            sortBoolean: false,
-            type: 'tableSelect',
-            param: () => {
-              return {
-                jobId: self.jobId ? parseInt(self.jobId) : null,
-              }
-            },
-            dataType: self.$config.tableSelectType.staff,
-            fieldUpdate: self.$updateColumns.halfCheckStaff,
-            searchDetailFlag: false
-          },
-        ],
         //用来展示的明细列表
         //用来展示的明细列表
         editDetailColumns: [
         editDetailColumns: [
           // 缺陷编码
           // 缺陷编码
@@ -933,11 +913,6 @@
       //根据节点id查询工序节点
       //根据节点id查询工序节点
       this.selectProcessNode()
       this.selectProcessNode()
     },
     },
-    watch: {
-      staffList(){
-        console.log('staffList', this.staffList)
-      }
-    }
   }
   }
 </script>
 </script>
 
 

+ 294 - 4
src/view/pdm/process-node-reverse/add.vue

@@ -1,11 +1,301 @@
+<!-- @desc:工序撤销  @auth:寇珊珊  @time:2023年3月21日15:21:08 -->
 <template>
 <template>
-
+  <div class="main-div">
+    <DkPaxeButton :total="editKeys?editKeys.length:0"
+                  :current="editIndex"
+                  v-if="editKeys && editKeys.length > 1"
+                  @pageChange="editPageChange"></DkPaxeButton>
+    <DkCollapse>
+      <DkPanel prop="essentialInformation">
+        <!--添加行按钮-->
+        <DkButton slot="content" type="success" @click="addRow" size="small"
+                  style="float: left;position: absolute; top: 9px;left: 120px;">{{ $v('add') }}
+        </DkButton>
+        <div style="clear:both"></div>
+        <!--  下拉区域  -->
+        <DkForm slot="content" ref="formInline" v-model="formData" style="width: 95%">
+          <!--产品条码-->
+          <DkFormItem :required="true" prop="barCode">
+            <InputPop ref="barCode" v-model="formData.barCode" @on-enter="onBarCode"
+                      @on-blur="onBarCode"/>
+          </DkFormItem>
+          <!--产品型号-->
+          <DkFormItem prop="modelCode">
+            <InputPop ref="modelCode" v-model="formData.modelCode" :readonly="true"/>
+          </DkFormItem>
+          <!--注浆日期-->
+          <DkFormItem prop="moldingDate">
+            <InputPop ref="moldingDate" v-model="formData.moldingDate" :readonly="true"/>
+          </DkFormItem>
+          <!--完成工序-->
+          <DkFormItem prop="pdtFlowNodeName" :label="$t('reasonPdtFlowNodeName')">
+            <InputPop ref="pdtFlowNodeName" v-model="formData.pdtFlowNodeName" :readonly="true"/>
+          </DkFormItem>
+          <!--完成时间-->
+          <DkFormItem prop="finishTime">
+            <InputPop ref="finishTime" v-model="formData.finishTime" :readonly="true"/>
+          </DkFormItem>
+          <!--所在载具-->
+          <DkFormItem prop="carrierCode" :label="$t('reasonCarrierCode')">
+            <InputPop ref="carrierCode" v-model="formData.carrierCode" :readonly="true"/>
+          </DkFormItem>
+          <!--商标-->
+          <DkFormItem :required="true" prop="logoName">
+            <InputPop ref="logoName" v-model="formData.logoName" :readonly="true"/>
+          </DkFormItem>
+          <!--釉色-->
+          <DkFormItem :required="true" prop="colourName">
+            <InputPop ref="colourName" v-model="formData.colourName" :readonly="true"/>
+          </DkFormItem>
+          <!--编码-->
+          <DkFormItem :required="true" prop="productCode">
+            <InputPop ref="productCode" v-model="formData.productCode" :readonly="true"/>
+          </DkFormItem>
+          <!--名称-->
+          <DkFormItem :required="true" prop="productName">
+            <InputPop ref="productName" v-model="formData.productName" :readonly="true"/>
+          </DkFormItem>
+          <!--撤销原因-->
+          <DkFormItem :required="true" prop="reasonCause">
+            <InputPop ref="reasonCause" v-model="formData.reasonCause" @on-blur="changeReasonCause"/>
+          </DkFormItem>
+        </DkForm>
+      </DkPanel>
+      <div>
+        <!--明细-->
+        <DkPanel prop="details">
+          <div slot="content" :style="'height: ' + tableHeight + 'px'">
+            <!--撤销信息-->
+            <EditTable slot="left" ref="submitTable" :data="detailList"
+                       :columns="detailColumns"
+                       :height="tableHeight-120"
+                       :freeze="false"
+                       :add-flag="false"
+                       @delRow="delSubmitTable"
+            ></EditTable>
+          </div>
+        </DkPanel>
+      </div>
+    </DkCollapse>
+    <!--      下部分按钮区域-->
+    <DkSaveButton ref="saveButton" :loading="loading" @save="save" @close="close"></DkSaveButton>
+  </div>
 </template>
 </template>
 
 
 <script>
 <script>
-export default {
-  name: "process-node-reverse-add"
-}
+  import { formMixin } from '@/mixins/form'
+
+  export default {
+    name: 'process-node-reverse-add',
+    mixins: [formMixin],
+    data() {
+      let self = this
+      return {
+        tableData: [],
+        loading: false,
+        tableHeight: 620,
+        // 画面表单数据
+        formData: {
+          barCode: '',
+          ftyId: this.$store.state.user.ftyId,
+          reasonCause: null,//撤销原因
+          productId: null,
+          productCode: null,
+          productName: null,
+          logoName: null,//商标
+          colourName: null,//釉色
+          moldingDate: null,//成型日期
+          modelCode: null,//产品型号
+          finishTime: null,//完成时间
+          pdtFlowNodeName: null,//完成工序
+          carrierCode: null,//所在载具
+        },
+        oldReasonCause: null,//撤销原因-判断上次和本次是否一致
+        flowNodeId: self.$route.meta.menuUuid,
+        // 明细列表
+        detailColumns: [
+          // 产品条码
+          { field: 'barCode', type: 'disabled', width: 'auto' },
+          //产品型号
+          { field: 'modelCode', type: 'disabled', width: 'auto' },
+          // 成型日期
+          { field: 'moldingDate', type: 'disabled', width: 'auto' },
+          //完成时间
+          { field: 'finishTime', type: 'disabled', width: 'auto' },
+          //完成工序
+          { field: 'pdtFlowNodeName', title: self.$t('reasonPdtFlowNodeName'), type: 'disabled', width: 'auto' },
+          //所在载具
+          { field: 'carrierCode', title: self.$t('reasonCarrierCode'), type: 'disabled', width: 'auto' },
+          //商标
+          { field: 'logoName', type: 'disabled', width: 'auto' },
+          //釉色
+          { field: 'colourName', type: 'disabled', width: 'auto' },
+          //产品编码
+          { field: 'productCode', type: 'disabled', width: 'auto' },
+          //产品名称
+          { field: 'productName', type: 'disabled', width: 'auto' },
+          //撤销原因
+          { field: 'reasonCause', type: 'disabled', width: 'auto' },
+        ],
+        detailList: [],
+        rowIndex: 0,
+      }
+    },
+    methods: {
+      /**
+       *   @desc   : 产品条码失焦事件
+       *   @date   : 2023/2/28 9:28
+       *   @author : 寇珊珊
+       */
+      onBarCode() {
+        if (this.formData.barCode) {
+          this.excuteNoParam(this.$service.collectService, this.$service.collectService.checkBarCodeNodeUndo, [this.formData.barCode]).then(res => {
+            if (res.code === this.$config.SUCCESS_CODE) {
+              this.formData.productId = res.data.uniqueId
+              this.formData.productCode = res.data.modelCode
+              this.formData.productName = res.data.modelName
+              this.formData.logoName = res.data.logoName
+              this.formData.colourName = res.data.colourName
+              this.formData.moldingDate = res.data.moldingDate
+              this.formData.modelCode = res.data.modelMouldCode
+              this.formData.finishTime = res.data.finishTime
+              this.formData.pdtFlowNodeName = res.data.pdtFlowNodeName
+              this.formData.carrierCode = res.data.carrierCode
+            } else {
+              this.$Message.error(res.message)
+            }
+          })
+        }
+      },
+      /**
+       *   @desc   :  撤销原因修改
+       *   @date   : 2023/3/21 11:28
+       *   @author : 寇珊珊
+       */
+      changeReasonCause() {
+        if (this.formData.reasonCause && this.oldReasonCause) {
+          if (this.formData.reasonCause == this.oldReasonCause) {
+            return
+          } else {
+            this.$IBMessage({
+                content: this.$t('Q_012'),
+                title: this.$t('systemQuestion'),
+              },
+              {
+                ok: () => {
+                  this.detailList = []
+                  this.oldReasonCause = this.formData.reasonCause
+                },
+                cancel: () => {
+                  return
+                }
+              })
+          }
+        } else {
+          this.oldReasonCause = this.formData.reasonCause
+        }
+      },
+      /**
+       *   @desc   : 删除提交行数据
+       *   @date   : 2023/3/10 11:26
+       *   @author : 寇珊珊
+       */
+      delSubmitTable(row, rowIndex) {
+        this.detailList.splice(rowIndex, 1)
+      },
+      /**
+       *   @desc   : 添加行
+       *   @date   : 2023/3/10 8:54
+       *   @author : 寇珊珊
+       */
+      addRow() {
+        this.$refs['formInline'].validate().then(validFlag => {
+          if (validFlag) {
+            //校验名称是否重复
+            if (!this.validData()) {
+              return
+            }
+            let list =[]
+            list.splice(0,0, {})
+            list[0].barCode = this.formData.barCode
+            list[0].productId = this.formData.productId
+            list[0].productCode = this.formData.productCode
+            list[0].productName = this.formData.productName
+            list[0].logoName = this.formData.logoName
+            list[0].colourName = this.formData.colourName
+            list[0].reasonCause = this.formData.reasonCause
+            list[0].moldingDate = this.formData.moldingDate
+            list[0].modelCode = this.formData.modelCode
+            list[0].finishTime = this.formData.finishTime
+            list[0].pdtFlowNodeName = this.formData.pdtFlowNodeName
+            list[0].carrierCode = this.formData.carrierCode
+            this.detailList.push(list[0])
+            //清空表单
+            this.clear(true)
+          } else {
+          }
+        })
+      },
+      /**
+       *   @desc   : 设置传参
+       *   @date   : 2023/2/28 11:29
+       *   @author : 寇珊珊
+       */
+      setParams() {
+        this.params = JSON.parse(JSON.stringify(this.formData))
+        this.params.barCodeList = [this.params.barCode]
+        delete this.params.barCode
+        this.params.detailLiet = this.detailLiet
+        this.params.flowNodeId = this.flowNodeId
+      },
+      /**
+       *   @desc   : 校验重复数据
+       *   @date   : 2023/3/8 8:45
+       *   @author : 寇珊珊
+       */
+      validData() {
+        if (this.detailList.length > 0) {
+          if (this.detailList.filter(it => it.barCode == this.formData.barCode).length > 0) {
+            this.$Message.error(this.$t('W_120'))
+            return false
+          }
+        }
+        return true
+      },
+      /**
+       *   @desc   : 保存数据
+       *   @date   : 2023/3/16 13:28
+       *   @author : 寇珊珊
+       */
+      saveData() {
+        return this.excute(this.$service.collectService, '/', this.params)
+      },
+      /**
+       *   @desc   : 清空
+       *   @date   : 2023/3/8 10:48
+       *   @author : 寇珊珊
+       */
+      clear(value) {
+        if (!value) {
+          this.detailList = []
+          this.formData.reasonCause = null
+        }
+        this.formData.barCode = null
+        this.formData.productId = null
+        this.formData.productCode = null
+        this.formData.productName = null
+        this.formData.logoName = null
+        this.formData.colourName = null
+        this.formData.moldingDate = null
+        this.formData.modelCode = null
+        this.formData.finishTime = null
+        this.formData.pdtFlowNodeName = null
+        this.formData.carrierCode = null
+      },
+    },
+    created() {
+    },
+  }
 </script>
 </script>
 
 
 <style scoped>
 <style scoped>

+ 130 - 3
src/view/pdm/process-node-reverse/index.vue

@@ -1,11 +1,138 @@
+<!-- @desc:工序撤销  @auth:寇珊珊  @time:2023年3月21日10:14:37 -->
 <template>
 <template>
+  <div class="main-div">
+    <!--按钮区-->
+    <BaseIndexButtonGroup id="BaseIndexButtonGroup">
+      <template #left>
+        <!--    查询    -->
+        <BaseIndexButton right-button="process-node-reverse-select" ref="search" name="search"></BaseIndexButton>
+        <!--    清空条件    -->
+        <BaseIndexButton right-button="process-node-reverse-clear" ref="clear" name="clear"></BaseIndexButton>
+      </template>
+      <template #right>
+        <!--   新建     -->
+        <BaseIndexButton right-button="process-node-reverse-reverse" ref="add" name="add"></BaseIndexButton>
+      </template>
+    </BaseIndexButtonGroup>
+
+    <!--  查询条件区域  -->
+    <div id="search-cond-div" ref="search-cond-div" style="margin-top: 1px;padding: 0">
+      <SearchCond ref="searchCond" v-model="searchCond"
+                  @collapse-change="collapseChange" :set-flag="false"
+                  :search-content="searchContent"></SearchCond>
+    </div>
+    <!--  列表区  -->
+    <div :style="'height: ' + tableHeight + 'px'" class="split-div-class">
+      <!--     工序撤销     -->
+      <DkTable slot="content" :id="'table-'+$options.name" ref="table-select" :data="tableData"
+               :pageFlag="true"
+               @pageChange="pageSizeChange"
+               :page-total="pageInfo.total"
+               :current-page="pageInfo.currentPage"
+               :height="this.tableHeight" primaryKey="prodId"
+               :choose-flag="false">
+        <!--产品条码-->
+        <DkTableColumn field="uniqueCode" :title="$t('appProductCode')" width="auto"></DkTableColumn>
+        <!--产品编码-->
+        <DkTableColumn field="modelCode" width="auto"></DkTableColumn>
+        <!--产品名称-->
+        <DkTableColumn field="modelName" width="auto"></DkTableColumn>
+        <!--生产工号-->
+        <DkTableColumn field="prodUserCode" width="auto"></DkTableColumn>
+        <!--模具名称-->
+        <DkTableColumn field="modelMouldCode" :title="$t('produceModelCode')" width="auto"></DkTableColumn>
+        <!--注浆日期-->
+        <DkTableColumn field="moldingDate" width="auto"></DkTableColumn>
+        <!--成型工号-->
+        <DkTableColumn field="moldingUserCode" :title="$t('moldingUser')" width="auto"></DkTableColumn>
+        <!--回收标识-->
+        <DkTableColumn field="flgRecycled" type="switch" :switch-disabled="true"></DkTableColumn>
+        <!--商标-->
+        <DkTableColumn field="logoName" width="auto"></DkTableColumn>
+
+        <!--注浆日期-->
+        <DkTableColumn field="moldingDate" width="auto"></DkTableColumn>
+        <!--注浆次数-->
+        <DkTableColumn field="moldedNum" :title="$t('slipCastingNum')" width="auto"></DkTableColumn>
+        <!--载具条码-->
+        <DkTableColumn field="carrierCode"  :title="$t('vehicleBarcode')" width="auto"></DkTableColumn>
+        <DkTableColumn field="opnTime" width="auto"></DkTableColumn>
+        <DkTableColumn field="createUserName" width="auto"></DkTableColumn>
+      </DkTable>
+    </div>
+  </div>
 
 
 </template>
 </template>
 
 
 <script>
 <script>
-export default {
-  name: "process-node-reverse"
-}
+  import { indexMixin } from '@/mixins'
+
+  export default {
+    name: 'process-node-reverse',
+    mixins: [indexMixin],
+    data() {
+      let self = this
+      return {
+        searchContent: [
+          {
+            //产品条码
+            itemCode: 'uniqueCode',
+            itemName: 'barCode',
+          },
+          {
+            //产品编码
+            itemCode: 'modelCode',
+          },
+          {
+            //产品名称
+            itemCode: 'modelName',
+          },
+          {
+            //产品类别
+            itemCode: 'modelCategory',
+            valueFormat: { code: 'categoryId' },
+            valueKind: 'S-SEARCH',
+            magnifierType: self.$config.MagnifierType.modelCategoryReport
+          },
+          {
+            //生产工号
+            itemCode: 'prodUserCode',
+          },
+          {
+            //组织机构
+            itemCode: 'orgName',
+            valueFormat: { code: 'orgName' },
+            valueKind: 'S-SEARCH',
+            magnifierType: self.$config.MagnifierType.organization
+          },
+          {
+            //操作时间
+            itemCode: 'opnTime',
+            valueFormat: {code: 'opnTime', default: [new Date().toDateStr(), new Date().toDateStr()]},
+            valueKind: 'DATE_RANGE'
+          },
+        ],
+        flowNodeId: self.$route.meta.exMenuUuid,
+        ftyId: self.$store.state.user.ftyId,
+      }
+    },
+    methods: {
+
+      /**
+       *   @desc   : 获取数据
+       *   @date   : 2023/2/27 14:11
+       *   @author : 寇珊珊
+       */
+      getData(params) {
+        params.flowNodeId = this.flowNodeId
+        return this.excute(this.$service.produceService, this.$service.produceService.search.url, params)
+      },
+
+    },
+    created() {
+      this.routeObjName = 'processNodeReverse'  // 设置路由名称
+    }
+  }
 </script>
 </script>
 
 
 <style scoped>
 <style scoped>

+ 439 - 3
src/view/pdm/prod-defect/add.vue

@@ -1,11 +1,447 @@
+<!-- @desc:产品报损  @auth:寇珊珊  @time:2023年3月21日15:21:08 -->
 <template>
 <template>
+  <div class="main-div">
+    <DkPaxeButton :total="editKeys?editKeys.length:0"
+                  :current="editIndex"
+                  v-if="editKeys && editKeys.length > 1"
+                  @pageChange="editPageChange"></DkPaxeButton>
+    <DkCollapse>
+      <!--基本信息-->
+      <DkPanel prop="essentialInformation">
+        <!--添加行按钮-->
+        <DkButton slot="content" type="success" @click="addRow" size="small"
+                  style="float: left;position: absolute; top: 9px;left: 120px;">{{ $v('add') }}
+        </DkButton>
+        <div style="clear:both"></div>
+        <!--  下拉区域  -->
+        <DkForm slot="content" ref="formInline" v-model="formData" style="width: 95%">
+          <!--产品条码-->
+          <DkFormItem :required="true" prop="barCode">
+            <InputPop ref="barCode" v-model="formData.barCode" @on-enter="onBarCode"
+                      @on-blur="onBarCode"/>
+          </DkFormItem>
+          <!--产品型号-->
+          <DkFormItem prop="modelCode">
+            <InputPop ref="modelCode" v-model="formData.modelCode" :readonly="true"/>
+          </DkFormItem>
+          <!--成型线-->
+          <DkFormItem prop="moldlineName">
+            <InputPop ref="moldlineName" v-model="formData.moldlineName" :readonly="true"/>
+          </DkFormItem>
+          <!--完成工序-->
+          <DkFormItem prop="pdtFlowNodeName" :label="$t('reasonPdtFlowNodeName')">
+            <InputPop ref="pdtFlowNodeName" v-model="formData.pdtFlowNodeName" :readonly="true"/>
+          </DkFormItem>
+          <!--完成时间-->
+          <DkFormItem prop="finishTime">
+            <InputPop ref="finishTime" v-model="formData.finishTime" :readonly="true"/>
+          </DkFormItem>
+          <!--所在载具-->
+          <DkFormItem prop="carrierCode" :label="$t('reasonCarrierCode')">
+            <InputPop ref="carrierCode" v-model="formData.carrierCode" :readonly="true"/>
+          </DkFormItem>
+          <!--编码-->
+          <DkFormItem prop="productCode">
+            <InputPop ref="productCode" v-model="formData.productCode" :readonly="true"/>
+          </DkFormItem>
+          <!--商标-->
+          <DkFormItem prop="logoName">
+            <InputPop ref="logoName" v-model="formData.logoName" :readonly="true"/>
+          </DkFormItem>
+          <!--釉色-->
+          <DkFormItem prop="colourName">
+            <InputPop ref="colourName" v-model="formData.colourName" :readonly="true"/>
+          </DkFormItem>
+          <!--编码-->
+          <DkFormItem prop="productCode">
+            <InputPop ref="productCode" v-model="formData.productCode" :readonly="true"/>
+          </DkFormItem>
+          <!--名称-->
+          <DkFormItem prop="productName">
+            <InputPop ref="productName" v-model="formData.productName" :readonly="true"/>
+          </DkFormItem>
+        </DkForm>
+      </DkPanel>
+      <!--报损信息-->
+      <DkPanel prop="LossReportingInformation">
+        <!--  下拉区域  -->
+        <DkForm slot="content" ref="formInline" v-model="LossReportingFormData" style="width: 95%">
+          <!--产品分级-->
+          <DkFormItem prop="opnGradeId" :required="true" :label="$t('gradeClassification')" data-type="number">
+            <SelectPop v-model="LossReportingFormData.opnGradeId" ref="gradeName" :multiple="false"
+                       :options="gradeList"
+                       @on-select="chooseGrade"
+                       labelKey="gradeName"
+                       valueKey="gradeId">
+            </SelectPop>
+          </DkFormItem>
+          <!--损柸原因-->
+          <DkFormItem prop="pdtDefectId" :required="true" :label="$t('damageReason')" data-type="number">
+            <SelectPop v-model="LossReportingFormData.pdtDefectId" ref="defectName" :multiple="false"
+                       :options="damageList"
+                       @on-select="chooseDamage"
+                       labelKey="defectName"
+                       valueKey="defectId">
+            </SelectPop>
+          </DkFormItem>
+          <!--责任工号-->
+          <DkFormItem :required="true" prop="blameUserId"
+                      :data-type="$config.dataType.number" :label="$t('blameUserId')">
+            <SelectMagnifier v-model="LossReportingFormData.blameUserId" :display-text="LossReportingFormData.userName"
+                             :type="$config.MagnifierType.user"
+                             :multiple="false"
+                             :search-info="{userType:2}"
+                             @ok="chooseBlameUser"></SelectMagnifier>
+          </DkFormItem>
+          <!--   备注     -->
+          <DkFormItem prop="remarks">
+            <InputPop v-model="LossReportingFormData.remarks"/>
+          </DkFormItem>
+        </DkForm>
+      </DkPanel>
+      <!--责任员工-->
+      <DkPanel prop="chooseDetails">
+        <div slot="content">
+          <!--责任员工-->
+          <DkTable slot="right" ref="staff-table-select" :data="staffList" multiple
+                   :height="tableHeight-400" primaryKey="staffId"
+                   :pageFlag="false"
+                   :pageTotalFlag="false"
+                   :linkClickChecked="true"
+                   name="table">
+            <DkTableColumn field="jobName" :title="$t('jobName')" width="auto"></DkTableColumn>
+            <DkTableColumn field="staffName" :title="$t('staffName')" width="auto"></DkTableColumn>
+            <DkTableColumn field="staffCode" :title="$t('staffCode')" width="auto"></DkTableColumn>
+          </DkTable>
+        </div>
+      </DkPanel>
+      <!--明细-->
+      <DkPanel prop="details">
+        <div slot="content" :style="'height: ' + tableHeight-320 + 'px'">
+          <!--产品报损信息-->
+          <EditTable slot="left" ref="submitTable" :data="detailList"
+                     :columns="detailColumns"
+                     :height="tableHeight-120"
+                     :freeze="false"
+                     :add-flag="false"
+                     @delRow="delSubmitTable"
+          ></EditTable>
+        </div>
+      </DkPanel>
+    </DkCollapse>
+    <!--      下部分按钮区域-->
+    <DkSaveButton ref="saveButton" :loading="loading" @save="save" @close="close"></DkSaveButton>
 
 
+  </div>
 </template>
 </template>
 
 
 <script>
 <script>
-export default {
-  name: "prod-defect-add"
-}
+  import { formMixin } from '@/mixins/form'
+
+  export default {
+    name: 'prod-defect-add',
+    mixins: [formMixin],
+    data() {
+      let self = this
+      return {
+        loading: false,
+        tableHeight: 620,
+        barCodeList: [],//产品条码集合
+        // 画面表单数据
+        formData: {
+          barCode: '',
+          ftyId: this.$store.state.user.ftyId,
+          productId: null,
+          productCode: null,
+          productName: null,
+          logoName: null,//商标
+          colourName: null,//釉色
+          moldingDate: null,//成型日期
+          modelCode: null,//产品型号
+          finishTime: null,//完成时间
+          pdtFlowNodeName: null,//完成工序
+          carrierCode: null,//所在载具
+          moldlineName: null,//成型线
+        },
+        //报损表单
+        LossReportingFormData: {
+          blameUserId: null,//责任工号
+          userName: null,//责任工号
+          opnGradeId: null,//产品分级
+          gradeName: null,//产品分级
+          pdtDefectId: null,//损柸原因
+          defectName: null,//损柸原因
+          remarks: null,
+        },
+        flowNodeId: self.$route.meta.menuUuid,
+        gradeList: [],//产品分级
+        damageList: [],//损柸原因
+        detailList: [],// 明细信息
+        // 明细列表
+        detailColumns: [
+          // 产品条码
+          { field: 'barCode', type: 'disabled', width: 'auto' },
+          //产品型号
+          { field: 'modelCode', type: 'disabled', width: 'auto' },
+          // 成型日期
+          { field: 'moldingDate', type: 'disabled', width: 'auto' },
+          //完成时间
+          { field: 'finishTime', type: 'disabled', width: 'auto' },
+          //完成工序
+          { field: 'pdtFlowNodeName', title: self.$t('reasonPdtFlowNodeName'), type: 'disabled', width: 'auto' },
+          //所在载具
+          { field: 'carrierCode', title: self.$t('reasonCarrierCode'), type: 'disabled', width: 'auto' },
+          //商标
+          { field: 'logoName', type: 'disabled', width: 'auto' },
+          //釉色
+          { field: 'colourName', type: 'disabled', width: 'auto' },
+          //产品编码
+          { field: 'productCode', type: 'disabled', width: 'auto' },
+          //产品名称
+          { field: 'productName', type: 'disabled', width: 'auto' },
+        ],
+        staffList: [],//责任员工
+      }
+    },
+    methods: {
+      /**
+       *   @desc   : 产品条码失焦事件
+       *   @date   : 2023/2/28 9:28
+       *   @author : 寇珊珊
+       */
+      onBarCode() {
+        if (this.formData.barCode) {
+          this.excuteNoParam(this.$service.collectService, this.$service.collectService.checkBarCodeNodeUndo, [this.formData.barCode]).then(res => {
+            if (res.code === this.$config.SUCCESS_CODE) {
+              this.barCodeList.push(this.formData.barCode)
+              this.formData.productId = res.data.uniqueId
+              this.formData.productCode = res.data.modelCode
+              this.formData.productName = res.data.modelName
+              this.formData.logoName = res.data.logoName
+              this.formData.colourName = res.data.colourName
+              this.formData.moldingDate = res.data.moldingDate
+              this.formData.modelCode = res.data.modelMouldCode
+              this.formData.finishTime = res.data.finishTime
+              this.formData.pdtFlowNodeName = res.data.pdtFlowNodeName
+              this.formData.carrierCode = res.data.carrierCode
+              this.formData.moldlineName = res.data.moldlineName
+            } else {
+              this.$Message.error(res.message)
+            }
+          })
+        }
+      },
+      /**
+       *   @desc   : 选择责任工号
+       *   @date   : 2023/3/21 16:06
+       *   @author : 寇珊珊
+       */
+      chooseBlameUser(row) {
+        if (row && row[0]) {
+          this.LossReportingFormData.blameUserId = row[0].userId
+          this.LossReportingFormData.userName = row[0].userName
+          this.getStaff(this.LossReportingFormData.blameUserId)
+        }
+      },
+      /**
+       *   @desc   : 查询员工
+       *   @date   : 2023/3/20 13:18
+       *   @author : 寇珊珊
+       */
+      getStaff(userId) {
+        let params = {
+          ftyId: this.formData.ftyId,
+          userId: userId,
+        }
+        this.excute(this.$service.commonService, this.$service.commonService.getTeamStaff, params).then(res => {
+          if (res.code === this.$config.SUCCESS_CODE) {
+            this.staffList = res.data.list
+            for (let i  of this.staffList) {
+              i.blameStaffId = i.staffId
+              i.blameWsJobId = i.jobId
+            }
+          } else {
+            this.$Message.error(res.message)
+          }
+        })
+      },
+      /**
+       *   @desc   : 选择产品等级
+       *   @date   : 2023/3/3 9:17
+       *   @author : 寇珊珊
+       */
+      chooseGrade(row) {
+        if (row) {
+          this.LossReportingFormData.opnGradeId = row
+          let list = this.gradeList.filter(it => it.gradeId == row)
+          if (list.length > 0) {
+            this.LossReportingFormData.gradeName = list[0].gradeName
+          }
+        }
+      },
+      /**
+       *   @desc   : 选择损柸原因
+       *   @date   : 2023/3/3 9:17
+       *   @author : 寇珊珊
+       */
+      chooseDamage(row) {
+        if (row) {
+          this.formData.pdtDefectId = row
+          let list = this.detailList.filter(it => it.defectId == row)
+          if (list.length > 0) {
+            this.formData.defectName = list[0].defectName
+          }
+        }
+      },
+      /**
+       *   @desc   : 删除提交行数据
+       *   @date   : 2023/3/10 11:26
+       *   @author : 寇珊珊
+       */
+      delSubmitTable(row, rowIndex) {
+        this.detailList.splice(rowIndex, 1)
+      },
+      /**
+       *   @desc   : 添加行
+       *   @date   : 2023/3/10 8:54
+       *   @author : 寇珊珊
+       */
+      addRow() {
+        this.$refs['formInline'].validate().then(validFlag => {
+          if (validFlag) {
+            //校验名称是否重复
+            if (!this.validData()) {
+              return
+            }
+            let list = []
+            list.splice(0, 0, {})
+            list[0].barCode = this.formData.barCode//产品条码
+            list[0].productId = this.formData.productId
+            list[0].productCode = this.formData.productCode//产品编码
+            list[0].productName = this.formData.productName//产品名称
+            list[0].logoName = this.formData.logoName//商标
+            list[0].colourName = this.formData.colourName//釉色
+            list[0].moldingDate = this.formData.moldingDate//成型时间
+            list[0].modelCode = this.formData.modelCode//型号编码
+            list[0].finishTime = this.formData.finishTime//完成时间
+            list[0].pdtFlowNodeName = this.formData.pdtFlowNodeName//完成工序
+            list[0].carrierCode = this.formData.carrierCode//所在载具
+            list[0].moldlineName = this.formData.moldlineName//成型线
+            list[0].blameStaffName = this.$refs['staff-table-select'].$refs.table.getCheckboxRecords().map(map => map.staffName).toString()
+            list[0].prodDefectStaffList = this.$refs['staff-table-select'].$refs.table.getCheckboxRecords()
+            this.detailList.push(list[0])
+            //清空表单
+            this.clear(true)
+          } else {
+          }
+        })
+      },
+      /**
+       *   @desc   : 设置传参
+       *   @date   : 2023/2/28 11:29
+       *   @author : 寇珊珊
+       */
+      setParams() {
+        this.params = {
+          opnGradeId: this.LossReportingFormData.opnGradeId,
+          remarks: this.formData.remarks,
+          barCodeList: this.barCodeList,
+          productionDefect: this.detailLiet.map(map => map.prodDefectStaffList),
+        }
+      },
+      /**
+       *   @desc   : 校验重复数据
+       *   @date   : 2023/3/8 8:45
+       *   @author : 寇珊珊
+       */
+      validData() {
+        if (this.detailList.length > 0) {
+          if (this.detailList.filter(it => it.barCode == this.formData.barCode).length > 0) {
+            this.$Message.error(this.$t('W_120'))
+            return false
+          }
+        }
+        return true
+      },
+      /**
+       *   @desc   : 保存数据
+       *   @date   : 2023/3/16 13:28
+       *   @author : 寇珊珊
+       */
+      saveData() {
+        return this.excute(this.$service.collectService, this.$service.collectService.scrap, this.params)
+      },
+      /**
+       *   @desc   : 清空
+       *   @date   : 2023/3/8 10:48
+       *   @author : 寇珊珊
+       */
+      clear(value) {
+        if (!value) {
+          this.detailList = []
+          this.LossReportingFormData.blameUserId = null
+          this.LossReportingFormData.userName = null
+          this.LossReportingFormData.opnGradeId = null
+          this.LossReportingFormData.gradeName = null
+          this.LossReportingFormData.pdtDefectId = null
+          this.LossReportingFormData.defectName = null
+          this.LossReportingFormData.remarks = null
+        }
+        this.staffList = null
+        this.formData.barCode = null
+        this.formData.productId = null
+        this.formData.productCode = null
+        this.formData.productName = null
+        this.formData.logoName = null
+        this.formData.colourName = null
+        this.formData.moldingDate = null
+        this.formData.moldlineName = null
+        this.formData.modelCode = null
+        this.formData.finishTime = null
+        this.formData.pdtFlowNodeName = null
+        this.formData.carrierCode = null
+
+      },
+      /**
+       *   @desc   : 查询产品分级
+       *   @date   : 2023/3/21 16:11
+       *   @author : 寇珊珊
+       */
+      getGrade() {
+        let params = {
+          ftyId: this.formData.ftyId,
+          gradeKind: this.$config.gradeKindType.decrease,
+        }
+        this.excute(this.$service.commonService, this.$service.commonService.getProductGrade, params).then(res => {
+          if (res.code === this.$config.SUCCESS_CODE) {
+            this.gradeList = res.data
+          }
+        })
+      },
+      /**
+       *   @desc   : 查询损柸原因
+       *   @date   : 2023/3/3 10:09
+       *   @author : 寇珊珊
+       */
+      getReasonForBlankLoss() {
+        let params = {
+          ftyId: this.$store.state.user.ftyId,
+          defectKind: this.$config.defectKind.moldDamageReason
+        }
+        this.excute(this.$service.commonService, this.$service.commonService.getProductDefect, params).then(res => {
+          if (res.code === this.$config.SUCCESS_CODE) {
+            this.damageList = res.data
+          }
+        })
+      },
+    },
+    created() {
+      //查询产品分级
+      this.getGrade()
+      //查询损柸原因
+      this.getReasonForBlankLoss()
+    },
+  }
 </script>
 </script>
 
 
 <style scoped>
 <style scoped>

+ 131 - 3
src/view/pdm/prod-defect/index.vue

@@ -1,11 +1,139 @@
+<!-- @desc:产品报损  @auth:寇珊珊  @time:2023年3月21日10:14:37 -->
 <template>
 <template>
+  <div class="main-div">
+    <!--按钮区-->
+    <BaseIndexButtonGroup id="BaseIndexButtonGroup">
+      <template #left>
+        <!--    查询    -->
+        <BaseIndexButton right-button="prod-defect-select" ref="search" name="search"></BaseIndexButton>
+        <!--    清空条件    -->
+        <BaseIndexButton right-button="prod-defect-clear" ref="clear" name="clear"></BaseIndexButton>
+        <!--    撤销    -->
+        <BaseIndexButton right-button="prod-defect-reverse" ref="reverse" name="reverse" :isMustChooseFlag="false"></BaseIndexButton>
+      </template>
+      <template #right>
+        <!--   新建     -->
+        <BaseIndexButton right-button="prod-defect-add" ref="add" name="add"></BaseIndexButton>
+      </template>
+    </BaseIndexButtonGroup>
+
+    <!--  查询条件区域  -->
+    <div id="search-cond-div" ref="search-cond-div" style="margin-top: 1px;padding: 0">
+      <SearchCond ref="searchCond" v-model="searchCond"
+                  @collapse-change="collapseChange" :set-flag="false"
+                  :search-content="searchContent"></SearchCond>
+    </div>
+    <!--  列表区  -->
+    <div :style="'height: ' + tableHeight + 'px'" class="split-div-class">
+      <!--     产品报损     -->
+      <DkTable slot="content" :id="'table-'+$options.name" ref="table-select" :data="tableData"
+               :pageFlag="true"
+               @pageChange="pageSizeChange"
+               :page-total="pageInfo.total"
+               :current-page="pageInfo.currentPage"
+               :height="this.tableHeight" primaryKey="prodId"
+               :choose-flag="false">
+        <!--产品条码-->
+        <DkTableColumn field="uniqueCode" :title="$t('appProductCode')" width="auto"></DkTableColumn>
+        <!--产品编码-->
+        <DkTableColumn field="modelCode" width="auto"></DkTableColumn>
+        <!--产品名称-->
+        <DkTableColumn field="modelName" width="auto"></DkTableColumn>
+        <!--生产工号-->
+        <DkTableColumn field="prodUserCode" width="auto"></DkTableColumn>
+        <!--模具名称-->
+        <DkTableColumn field="modelMouldCode" :title="$t('produceModelCode')" width="auto"></DkTableColumn>
+        <!--注浆日期-->
+        <DkTableColumn field="moldingDate" width="auto"></DkTableColumn>
+        <!--成型工号-->
+        <DkTableColumn field="moldingUserCode" :title="$t('moldingUser')" width="auto"></DkTableColumn>
+        <!--回收标识-->
+        <DkTableColumn field="flgRecycled" type="switch" :switch-disabled="true"></DkTableColumn>
+        <!--商标-->
+        <DkTableColumn field="logoName" width="auto"></DkTableColumn>
+        <!--注浆日期-->
+        <DkTableColumn field="moldingDate" width="auto"></DkTableColumn>
+        <!--注浆次数-->
+        <DkTableColumn field="moldedNum" :title="$t('slipCastingNum')" width="auto"></DkTableColumn>
+        <!--载具条码-->
+        <DkTableColumn field="carrierCode"  :title="$t('vehicleBarcode')" width="auto"></DkTableColumn>
+        <DkTableColumn field="opnTime" width="auto"></DkTableColumn>
+        <DkTableColumn field="createUserName" width="auto"></DkTableColumn>
+      </DkTable>
+    </div>
+  </div>
 
 
 </template>
 </template>
 
 
 <script>
 <script>
-export default {
-name: "prod-defect"
-}
+  import { indexMixin } from '@/mixins'
+
+  export default {
+    name: 'prod-defect',
+    mixins: [indexMixin],
+    data() {
+      let self = this
+      return {
+        searchContent: [
+          {
+            //产品条码
+            itemCode: 'uniqueCode',
+            itemName: 'barCode',
+          },
+          {
+            //产品编码
+            itemCode: 'modelCode',
+          },
+          {
+            //产品名称
+            itemCode: 'modelName',
+          },
+          {
+            //产品类别
+            itemCode: 'modelCategory',
+            valueFormat: { code: 'categoryId' },
+            valueKind: 'S-SEARCH',
+            magnifierType: self.$config.MagnifierType.modelCategoryReport
+          },
+          {
+            //生产工号
+            itemCode: 'prodUserCode',
+          },
+          {
+            //组织机构
+            itemCode: 'orgName',
+            valueFormat: { code: 'orgName' },
+            valueKind: 'S-SEARCH',
+            magnifierType: self.$config.MagnifierType.organization
+          },
+          {
+            //操作时间
+            itemCode: 'opnTime',
+            valueFormat: {code: 'opnTime', default: [new Date().toDateStr(), new Date().toDateStr()]},
+            valueKind: 'DATE_RANGE'
+          },
+        ],
+        flowNodeId: self.$route.meta.exMenuUuid,
+        ftyId: self.$store.state.user.ftyId,
+      }
+    },
+    methods: {
+
+      /**
+       *   @desc   : 获取数据
+       *   @date   : 2023/2/27 14:11
+       *   @author : 寇珊珊
+       */
+      getData(params) {
+        params.flowNodeId = this.flowNodeId
+        return this.excute(this.$service.produceService, this.$service.produceService.search.url, params)
+      },
+
+    },
+    created() {
+      this.routeObjName = 'prodDefect'  // 设置路由名称
+    }
+  }
 </script>
 </script>
 
 
 <style scoped>
 <style scoped>