于继渤 3 년 전
부모
커밋
5223c14593

+ 12 - 0
src/api/pages/common/common.js

@@ -134,6 +134,18 @@ export default {
     getDataKind: 'get_model_mould', // 获取模具型号
     getDataBasic: 'get_data_basic', // 获取基础数据
     selectUser: 'select_userid',//根据输入的usercode 查询 userid
+    /**
+     * @desc : 验证工序可检缺陷《PDA用) 检验工序输入缺陷代码时调用,返回此缺陷对应扣罚信息
+     * @author : 于继渤
+     * @date : 2023/3/13 17:07
+     */
+    getCheckNodeDefectCode:'get_check_node_defect_code',
+    /**
+     * @desc : 验证产品缺陷位置《PDA用) 检验工序输入缺陷位置时调用
+     * @author : 于继渤
+     * @date : 2023/3/13 17:07
+     */
+    getCheckPlaceCode:'get_check_place_code'
   }
 }
 

+ 33 - 1
src/components-app/business/dk-app-single-dropdown/dk-app-single-dropdown.vue

@@ -111,6 +111,7 @@ export default {
     dataList(value) {
       this.dataList_p = value
       this.dataInItList = value
+      console.log('dataList', value)
     },
     //是否显示监听
     show(value) {
@@ -146,6 +147,23 @@ export default {
         let finalList = [...dataList_Temp]
         this.dataList_p = dataList_Temp
         this.finalList = finalList
+      } else if (this.dataSourceCode === 'defectDeduction') {
+
+        let dataList_Temp = []
+        let list = this.dataListDef
+        list.forEach(item2 => {
+          let item = {}
+          item = {
+            id: item2.fineId,
+            name: item2.fineName,
+            deductNum: item2.deductNum,
+            checked: false
+          }
+          dataList_Temp.push(item)
+        })
+        let finalList = [...dataList_Temp]
+        this.dataList_p = dataList_Temp
+        this.finalList = finalList
       } else {
         if (this.apiType === 'web') {
           let dataList_Temp = []
@@ -358,6 +376,7 @@ export default {
       let dataList = this.finalList
       if (dataList == null || dataList.length === 0) return
       let ids = []
+      let deductNum = []
       let names = []
       let clockId = []
       let userCode = []
@@ -372,6 +391,7 @@ export default {
           ids.push(item.id)
           names.push(item.name)
           qvUserids.push(item.qvUserid)
+          deductNum.push(item.deductNum)
           stdNum = item.stdNum
           outputQty = item.outputQty
           outputStdSum = item.outputStdSum
@@ -405,6 +425,13 @@ export default {
           userCode: userCode.join(',')
         }
 
+      } else if (this.typeName === 'defectDeduction') {
+        returnValue = {
+          ids: ids.join(','),
+          names: names.join(','),
+          deductNum: deductNum.join(',')
+        }
+
       } else {
         returnValue = {
           ids: ids.join(','),
@@ -527,9 +554,14 @@ export default {
     } else if (this.typeName === 'scrapReason') {
       this.dataSourceCode = 'scrapReason'
       this.name = '损坯原因'
+    } else if (this.typeName === 'productClassification') {
+      this.dataSourceCode = 'productClassification'
+      this.name = '产品分级'
+    } else if (this.typeName === 'defectDeduction') {
+      this.dataSourceCode = 'defectDeduction'
+      this.name = '缺陷扣罚'
     }
 
-
     if (this.getDataInItFlag) {
       this.getDataInIt()
     }

+ 2 - 0
src/locale/lang/zh-CN.js

@@ -1184,6 +1184,7 @@ export const appColumns = {
   appResponsibleJobNumber: '责任工号',
   appJobName: '工种',
   appPersonLiable: '责任人',
+  appPersonLiableMan: '责任员工',
   appDefectDeduction: '缺陷扣罚',
   appDeduction: '扣除数',
   appProductInformation: '产品信息',
@@ -1225,6 +1226,7 @@ export const appColumns = {
   appScrapUserName: '报废工号',
   appBindBarcode:'绑定条码',
   appHisPdtCodes:'历史条码',
+  appDefectCode:'缺陷编码',
 }
 /**
  * @desc   : app按钮

+ 147 - 36
src/view-app/app/piecework-procedure/half-check/index.vue

@@ -1,34 +1,86 @@
 <template>
   <!--  半检      功能(functionCode) index : 预干(0101)  -->
-  <div class="main-app-form">
+  <div class="main-app">
     <!-- 顶部导航栏 -->
     <dk-app-nav-bar title="半检"
                     @click-left="onClickLeft" :rightIcon="true" @click-right="onClickRight"></dk-app-nav-bar>
+    <!-- 粘性布局   -->
+    <dk-app-sticky>
+      <!--  生产工号-->
+      <dk-app-field
+        v-model="formData.prodUserName"
+        formatter-flg
+        is-once-hide-keyboard
+        ref="prodUser"
+        :label="$t('appProductionJobNumber')"
+        placeholderType="scan"
+        @changeBarCode="queryUser"/>
+      <!--    产品条码-->
+      <dk-app-field
+        :label="$t('appProductCode')"
+        ref="barCode"
+        v-model="formData.barCode"
+        @changeBarCode="queryBarCode"
+        :readonly="(formData.prodUserName.length == 0)"
+        placeholderType="scan"></dk-app-field>
+    </dk-app-sticky>
+
+    <div class="app-form">
+      <div class="app-form-main">
+        <!--    产品编码-->
+        <dk-app-field
+          v-model="formData.uniqueCode"
+          :label="$t('appProductCodeB')"
+
+          :readonly="true"
+          :placeholderFlag="false"
+        />
+        <!--    产品名称-->
+        <dk-app-field
+          v-model="formData.modelName"
+          :label="$t('appProductName')"
+
+          :readonly="true"
+          :placeholderFlag="false"
+        />
+        <!--    商标名称-->
+        <dk-app-field
+          v-model="formData.logoName"
+          :label="$t('appLogoName')"
+
+          :readonly="true"
+          :placeholderFlag="false"
+        />
+        <!--    产品分级-->
+        <dk-app-field
+          v-model="formData.gradeKindName"
+          :label="$t('appProductClassification')"
+          :readonly="true"
+          @click="openDropdown({key:'productClassification'})"
+          placeholderType="choose" is-link arrow-direction="down"
+        />
+        <!--    缺陷号-->
+        <dk-app-field
+          v-model="formData.defectNo"
+          ref="defectNo"
+          :label="$t('appDefectCode')"
+          :readonly="readonlyFlag"
+          @changeBarCode="getCheckNodeDefectCode"
+
+        />
+        <!--    缺陷名称-->
+        <dk-app-field
+          v-model="formData.defectNoName"
+          :label="$t('appDefectNoName')"
+
+          :readonly="true"
+          :placeholderFlag="false"
+        />
+
+      </div>
+    </div>
+
 
-    <!--  生产工号-->
-    <dk-app-field
-      v-model="formData.prodUserName"
-      formatter-flg
-      is-once-hide-keyboard
-      ref="prodUser"
-      :label="$t('appProductionJobNumber')"
-      placeholderType="scan"
-      @changeBarCode="queryUser"/>
-    <!--    产品条码-->
-    <dk-app-field
-      :label="$t('appProductCode')"
-      ref="barCode"
-      v-model="formData.barCode"
-      @changeBarCode="queryBarCode"
-      :readonly="(formData.prodUserName.length == 0)"
-      placeholderType="scan"></dk-app-field>
-
-    <!--    列表 -->
-    <dk-app-table :rows="rows"
-                  :tableRowData="tableRowData"
-                  disabled-swipe
-                  @openDropdown="openDropdown">
-    </dk-app-table>
     <!--    缺陷信息  标头-->
     <div ref="scrollTable" class="main-app-table">
       <div v-if="defectInformationTableRowData.length>0" style="margin: 10px">{{ $t('appDefectInformation') }}</div>
@@ -80,6 +132,7 @@ export default {
     let self = this
     return {
       showPopup: false,//点击 三个小点 弹出popup
+      readonlyFlag: false,
       gridItemList: [  //右上角功能菜单
         {
           gridName: "扫一扫", //扫一扫
@@ -135,7 +188,16 @@ export default {
         prodUserId: '',//生产工号id
         barCode: '',//产品条码
         flgValid: '',//有效标识
-        ftyId: 1,//工厂ID
+        ftyId: this.$store.state.user.ftyId,//工厂ID
+        gradeKindName: '',//产品等级
+        gradeKindId: '',//产品等级
+
+        uniqueCode: '',//产品编码
+        modelName: '',//产品名称
+        logoName: '', //商标名称
+        productClassification: '',//产品分级
+        defectNo: '',//缺陷号
+       defectNoName: '' ,//缺陷名称
       },
       sideProductClassificationFlag: false,   //产品分级选择框
     }
@@ -166,7 +228,8 @@ export default {
      */
     singleCommit(e, typeName) {
       if (typeName === 'productClassification') { //产品分级
-
+        this.formData.gradeKindId = e.ids ? Number(e.ids) : null
+        this.formData.gradeKindName = e.names
       }
     },
 
@@ -214,13 +277,41 @@ export default {
       }
       this.excute(this.$service.appCollectService, this.$service.appCollectService.checkBarCode, params, "queryBarCode").then(res => {
         if (res.code === this.$config.SUCCESS_CODE) {
-          this.tableRowData = [res.data]
-          console.log("res.data", res.data)
-          //todo  赋值缺陷信息  显示条码信息
+          this.formData.uniqueCode = res.data.uniqueCode//产品编码
+          this.formData.modelName = res.data.modelName//产品名称
+          this.formData.modelId = res.data.modelId//产品名称
+          this.formData.logoName = res.data.logoName //商标名称
+          this.formData.productClassification = res.data.productClassification//产品分级
+          this.formData.defectNo = res.data.defectNo//缺陷号
+          this.formData.defectNoName = res.data.defectNoName //缺陷名称
+          this.readonlyFlag = false
+          //焦点缺陷号
+          this.$refs.defectNo.$refs.input.focus()
         }
       })
     },
+    /**
+     * @desc : 验证工序可检缺陷《PDA用) 检验工序输入缺陷代码时调用,返回此缺陷对应扣罚信息
+     * @author : 于继渤
+     * @date : 2023/3/13 17:07
+     */
+    getCheckNodeDefectCode(){
+
+      let params = {
+        ftyId: this.$store.state.user.ftyId,
+        code: this.formData.defectNo,//缺陷编码
+        nodeId: this.formData.flowNodeId,//节点id
+      }
+      this.excute(this.$service.appCommonService, this.$service.appCommonService.getCheckNodeDefectCode, params).then(res => {
+        if (res.code === this.$config.SUCCESS_CODE) {
+          this.formData.defectNoName =  res.data.defectName //缺陷名称
+          this.formData.defectFines =  res.data.defectFines //赏罚
 
+          //焦点缺陷号
+          //this.$refs.defectNo.$refs.input.focus()
+        }
+      })
+    },
     /**
      * @desc   : 点击标题右侧事件
      * @author : 王英杰
@@ -235,7 +326,7 @@ export default {
      * @date : 2022/5/24 12:16
      */
     onRouterRecordProcess() {
-      this.$router.push({name: 'app-record-process'})
+      this.$router.push({name: 'app-record-process',params: {item: this.formData}})
     },
     /**
      * @desc   : 类别侧拉打开事件
@@ -304,8 +395,10 @@ export default {
     // endregion
 
 
-    onClose(){},
-    onClick(){},
+    onClose() {
+    },
+    onClick() {
+    },
 
 
   },
@@ -321,12 +414,30 @@ export default {
   created(e) {
     //接收参数
     this.focusItem = "prodUser"
-    let objson = JSON.parse(decodeURIComponent(this.$route.params.pageobj))
-    this.formData.flowNodeId = objson.id   //工序id
-    this.appActiveTitle = objson.title
+    if (this.$route.params.pageobj){
+      let objson = JSON.parse(decodeURIComponent(this.$route.params.pageobj))
+      if(objson){
+        this.formData.flowNodeId = objson.id   //工序id
+        this.appActiveTitle = objson.title
+      }
+    }
+
+
+
   },
 }
 </script>
 
 <style scoped>
+app-form {
+  background: rgb(255, 255, 255);
+  margin: 10px;
+  border-radius: 7px;
+  box-shadow: rgb(229, 229, 230) 2px 2px 5px;
+}
+
+app-form-main {
+  padding: 10px;
+}
+
 </style>

+ 120 - 51
src/view-app/app/piecework-procedure/half-check/record-process.vue

@@ -2,9 +2,45 @@
   <!--  半检      功能(functionCode) index : 预干(0101)  -->
   <div class="main-app-form">
     <!-- 顶部导航栏 -->
-    <dk-app-nav-bar :title="$t('appMoldManagemenAddTitle')"
-                    @click-left="onClickLeft" ></dk-app-nav-bar>
+    <dk-app-nav-bar :title="$t('appRecordProcess')"
+                    @click-left="onClickLeft"></dk-app-nav-bar>
+    <!-- 缺陷编码 -->
+    <dk-app-field
 
+      v-model="item.defectNo"
+      :label="$t('appDefectCode')"
+      :readonly="true"
+      :placeholderFlag="false"
+    />
+    <!--    缺陷名称-->
+    <dk-app-field
+      v-model="item.defectNoName"
+      :label="$t('appDefectNoName')"
+      :readonly="true"
+      :placeholderFlag="false"
+    />
+    <!-- 缺陷扣罚 -->
+    <dk-app-field
+      v-model="formData.defectDeductionName"
+      :label="$t('appDefectDeduction')"
+      :readonly="true"
+      @click="openDropdown({key:'defectDeduction'})"
+      placeholderType="choose" is-link arrow-direction="down"
+    />
+    <!-- 扣除数 -->
+    <dk-app-field
+      v-model="formData.deductNum"
+      :label="$t('appDeduction')"
+      :readonly="true"
+      :placeholderFlag="false"
+    />
+    <!-- 缺陷位置 -->
+    <dk-app-field
+      v-model="formData.placeCode"
+      :label="$t('appDefectName')"
+      placeholderType="input"
+      @changeBarCode="getCheckPlaceCode"
+    />
 
     <!-- 责任工序 -->
     <dk-app-field
@@ -20,7 +56,7 @@
       :label="$t('appResponsibleJobNumber')"
       placeholderType="input"
     />
-    <!-- 工种 -->
+    <!-- 责任工种 -->
     <dk-app-field
       v-model="formData.jobName"
       :label="$t('appJobName')"
@@ -28,38 +64,24 @@
       @click="unMoldedReasonFlag = true"
       placeholderType="choose" is-link arrow-direction="down"
     />
-    <!-- 责任 -->
+    <!-- 责任员工 -->
     <dk-app-field
       v-model="formData.personLiable"
-      :label="$t('appPersonLiable')"
-      :readonly="true"
-      @click="unMoldedReasonFlag = true"
-      placeholderType="choose" is-link arrow-direction="down"
-    />
-    <!-- 缺陷扣罚 -->
-    <dk-app-field
-      v-model="formData.defectDeduction"
-      :label="$t('appDefectDeduction')"
-      :readonly="true"
-      @click="unMoldedReasonFlag = true"
-      placeholderType="choose" is-link arrow-direction="down"
-    />
-    <!-- 扣除数 -->
-    <dk-app-field
-      v-model="formData.deduction"
-      :label="$t('appDeduction')"
+      :label="$t('appPersonLiableMan')"
       :readonly="true"
       @click="unMoldedReasonFlag = true"
       placeholderType="choose" is-link arrow-direction="down"
     />
-    <dk-app-cell
-      clickable
-      title="特殊缺陷">
-      <template #right-icon>
-        <van-checkbox  v-model="checked" ref="checkboxes" shape="square"/>
-      </template>
-    </dk-app-cell>
-    <van-uploader :after-read="afterRead" />
+
+
+    <!--    <dk-app-cell-->
+    <!--      clickable-->
+    <!--      title="特殊缺陷">-->
+    <!--      <template #right-icon>-->
+    <!--        <van-checkbox v-model="checked" ref="checkboxes" shape="square"/>-->
+    <!--      </template>-->
+    <!--    </dk-app-cell>-->
+    <!--    <van-uploader :after-read="afterRead"/>-->
     <!--  保存按钮-->
     <div class="app_save_bottom-class" style="display: flex">
 
@@ -68,10 +90,13 @@
     </div>
     <!--    所有的 漂浮窗-->
     <div style="height: 0">
-      <!--    未成型原因-->
-      <dk-app-single-dropdown typeName="unMoldedReason" :show="unMoldedReasonFlag"
-                              @mutiClose="singleClose('unMoldedReason')"
-                              @mutiCommit="singleCommit($event,'unMoldedReason')"></dk-app-single-dropdown>
+
+
+      <!--    惩罚-->
+      <dk-app-single-dropdown typeName="defectDeduction" :show="defectDeductionFlag" :dataListDef="item.defectFines"
+                              :getDataInItFlag="false"
+                              @mutiClose="singleClose('defectDeduction')"
+                              @mutiCommit="singleCommit($event,'defectDeduction')"></dk-app-single-dropdown>
 
     </div>
     <!-- 加载页面   -->
@@ -87,26 +112,42 @@ export default {
   name: "app-record-process",
   mixins: [appFormMixin],
   data() {
-    let self = this
     return {
-
-      checked:false,
+      defectDeductionFlag: false, //缺陷扣罚标识
+      item: {},
       moldingMoldManagementActiveTitle: '', //标题
       formData: {
-        responsibleProcess: '',//责任工序
-        responsibleJobNumber: '',//责任工号
-        jobName: '',//工种
-        personLiable: '',//责任人
-        defectDeduction: '',//缺陷扣罚
-        deduction: '',//扣除数
-        flgValid: '',//有效标识
-        ftyId: 1,//工厂ID
+        defectDeductionName: '',//缺陷扣罚
+        defectDeductionId: null,//缺陷扣罚
+        deductNum: null,//扣除数
+        placeCode: '',//缺陷位置编码
+
       },
       unMoldedReasonFlag: false //
     }
   },
   methods: {
 
+
+    /**
+     * @desc   : 验证产品缺陷位置《PDA用) 检验工序输入缺陷位置时调用
+     * @author : 于继渤
+     * @date   : 2023/3/14 10:23
+     */
+    getCheckPlaceCode() {
+      let params = {}
+      params.ftyId = this.$store.state.user.ftyId
+      params.code = this.formData.placeCode//位置编码
+      params.modelId = this.item.modelId
+      this.excute(this.$service.appCommonService, this.$service.appCommonService.getCheckPlaceCode, params).then(res => {
+        if (res.code === this.$config.SUCCESS_CODE) {
+
+
+        }
+      })
+    },
+
+
     afterRead(file) {
       // 此时可以自行将文件上传至服务器
       console.log(file);
@@ -114,22 +155,43 @@ export default {
     // region 基础数据源
 
 
-
-
     // endregion
 
     // region 控件 回调
 
+    /**
+     * @desc   : 单选侧拉确定
+     * @author : 于继渤
+     * @date   : 2023/2/7 17:26
+     */
+    singleCommit(e, typeName) {
+      if (typeName === 'defectDeduction') {  //惩罚
+        console.log(e)
+        this.formData.defectDeductionId = Number(e.ids)
+        this.formData.defectDeductionName = e.names
+        this.formData.deductNum = Number(e.deductNum)
+      }
+    },
+    /**
+     * @desc   : 单选侧拉关闭
+     * @author : 于继渤
+     * @date   : 2023/2/7 17:26
+     */
+    singleClose(e) {
+      if (e === 'defectDeduction') {
+        this.defectDeductionFlag = false
+      }
+    },
 
     /**
      * @desc   : 类别侧拉打开事件
-     * @author : 王英杰
+     * @author : 于继渤
      * @date   : 2023/2/13 13:25
      */
     openDropdown(e) {
       //列表下拉
-      if (e.key === 'modelMould') {
-        this.unMoldedReasonFlag = true
+      if (e.key === 'defectDeduction') {
+        this.defectDeductionFlag = true
       }
     },
 
@@ -171,15 +233,22 @@ export default {
   },
   mounted() {
     // 设置滚动的位置和高度
-    this.setAppTableHeight()
+    // this.setAppTableHeight()
   },
   /**
    * 初始生命周期
    * @param e
    */
   created(e) {
+
     //接收参数
-    this.focusItem = "moldCode"
+    //判断传递数据是否成功
+    console.log('this.$route.params.item', this.$route.params.item)
+    if (this.$route.params.item) {
+      this.item = this.$route.params.item
+      console.log('item', this.item)
+    }
+
   }
 }
 </script>