Browse Source

app
商标釉色

wangyingjie 3 years ago
parent
commit
0b57fbeacb

+ 5 - 1
src/api/pages/common/common.js

@@ -145,7 +145,11 @@ export default {
      * @author : 于继渤
      * @date : 2023/3/13 17:07
      */
-    getCheckPlaceCode:'get_check_place_code'
+    getCheckPlaceCode:'get_check_place_code',
+    //釉色设定放大镜详细查询
+    getColourForSet:'get_colour_for_set',
+    //商标设定放大镜详细查询
+    getLogoForSet:'get_logo_for_set',
   }
 }
 

+ 135 - 43
src/view-app/app/prod-management/trademark-glaze/index.vue

@@ -1,55 +1,60 @@
 <template>
 <!--商标釉色-->
-
   <div class="main-app-form">
     <!-- 顶部导航栏 -->
     <dk-app-nav-bar :title="$t('appTrademarkGlazeTitle')"
                     @click-left="onClickLeft" ></dk-app-nav-bar>
 
-
     <!--    产品条码-->
     <dk-app-field
       :label="$t('appProductBarcode')"
-      v-model="formData.productBarcode"
+      v-model="formData.pdtBarcode"
+      @changeBarCode="queryPdtBarcode"
       placeholderType="scan"></dk-app-field>
     <!--    原商标-->
     <dk-app-field
       :label="$t('appOldLogoName')"
-      v-model="formData.productBarcode"
+      v-model="formData.oldLogoName"
+      :readonly="true"
       placeholderType="scan"></dk-app-field>
     <!--    新商标-->
     <dk-app-field
+      v-model="formData.pdtLogoName"
       :label="$t('appNewLogoName')"
-      v-model="formData.productBarcode"
-      placeholderType="scan"></dk-app-field>
-    <!--    选择商品-->
-    <dk-app-field
-      label=""  :readonly="true"
-      v-model="formData.productBarcode"
-      placeholderType="choose" is-link arrow-direction="down"></dk-app-field>
+      :readonly="true"
+      @click="clickChoosePopur('ProductLogo')"
+      placeholderType="choose" is-link arrow-direction="down"
+    ></dk-app-field>
     <!--    原釉料-->
     <dk-app-field
       :label="$t('appRawGlaze')"
-      v-model="formData.productBarcode"
+      v-model="formData.oldColourName"
+      :readonly="true"
       placeholderType="scan"></dk-app-field>
     <!--    新釉料-->
     <dk-app-field
+      v-model="formData.pdtColourName"
       :label="$t('appNewGlaze')"
-      v-model="formData.productBarcode"
-      placeholderType="scan"></dk-app-field>
-    <!--    选择商品-->
-    <dk-app-field
-      label=""  :readonly="true"
-      v-model="formData.productBarcode"
-      placeholderType="choose" is-link arrow-direction="down"></dk-app-field>
-
+      :readonly="true"
+      @click="clickChoosePopur('ProductColour')"
+      placeholderType="choose" is-link arrow-direction="down"
+    ></dk-app-field>
 
     <!--  保存按钮-->
     <div class="app_save_bottom-class">
       <dk-app-button   @click="save">{{ $t('appSave') }}
       </dk-app-button>
     </div>
-
+    <div style="height: 0">
+      <!--   选择商标 -->
+      <dk-app-single-dropdown typeName="productLogo" :show="showProductLogo"
+                              @mutiClose="mutiClose('ProductLogo')"
+                              @mutiCommit="mutiCommit($event,'ProductLogo')"></dk-app-single-dropdown>
+      <!--   选择釉色 -->
+      <dk-app-single-dropdown typeName="productColour" :show="showProductColour"
+                              @mutiClose="mutiClose('ProductColour')"
+                              @mutiCommit="mutiCommit($event,'ProductColour')"></dk-app-single-dropdown>
+    </div>
     <!-- 加载页面   -->
     <dk-app-loading :loading="loading"></dk-app-loading>
 
@@ -59,21 +64,29 @@
 </template>
 
 <script>
+import {appFormMixin} from "@/mixins/appform";
+
 export default {
   name: "app-trademark-glaze",
-
+  mixins: [appFormMixin],
   data() {
     let self = this
     return {
-      moldingMoldManagementActiveTitle:'',
-
-
-      //标题
+      moldingMoldManagementActiveTitle:'',//标题
       formData: {
-        productBarcode: '',//产品条码
-        flgValid: '',//有效标识
-        ftyId: 1,//工厂ID
+        itemId: '',//成型明细id
+        pdtLogoId: null,//商标id
+        pdtLogoName: null,//商标Name
+        pdtColourId: null,//釉色id
+        pdtColourName: null,//釉色Name
+        pdtBarcode: '',//产品条码
+        oldLogoName: '',//原商标名称
+        oldColourName: '',//原釉色名称
       },
+      showProductLogo:false,//是否 显示产品商标名称
+      showProductColour:false,//是否 显示产品商标名称
+      isChoosePopur:false,// 选择控件 是否可点击
+      loading:false,// 加载
     }
   },
   methods: {
@@ -87,24 +100,49 @@ export default {
 
     // region 控件 回调
     /**
+        * @desc   : 点击选择控件
+        * @author : 王英杰
+        * @date   : 2023/3/20 11:32
+        */
+    clickChoosePopur(e){
+      if(!this.isChoosePopur){ //产品条码不对 不可点击
+        return
+      }
+      if (e === 'ProductLogo') {//产品商标
+        this.showProductLogo = true
+      }
+      if (e === 'ProductColour') {//产品釉色
+        this.showProductColour = true
+      }
+    },
+    /**
      * @desc   : 根据输入的usercode 查询 userid
      * @author : 王英杰
      * @date   : 2023/2/10 9:16
      */
 
-    queryUser() {
+    queryPdtBarcode() {
       let params = {
         ftyId: this.$store.state.user.ftyId,
-        userCode: this.formData.makeUserName,
+        pdtBarcodeEqual: this.formData.pdtBarcode,
+        userId:this.$store.state.user.id,
+        purview:true,
+        currentPage:1,
+        pageSize:10,
       }
-      this.excute(this.$service.appCommonService, this.$service.appCommonService.selectUser, params).then(res => {
+      this.excute(this.$service.commonService, this.$service.commonService.getLogoForSet, params).then(res => {
         if (res.code === this.$config.SUCCESS_CODE) {
-          if (res.data) {
-            this.formData.makeUser = res.data.userId
-          } else { //没查找
-            this.$appToast((this.$t('appProductionJobNumbeErro')));
-            this.formData.makeUserName = ""
-            this.formData.makeUser = ""
+          let rows = res.data.list
+          if (rows && rows.length > 0) { //通过产品条码查询 给原商标 原釉色赋值
+            this.formData.oldLogoName = rows[0].logoName;
+            this.formData.itemId = rows[0].itemId;
+            this.formData.oldColourName = rows[0].colourName;
+            this.isChoosePopur = true
+          }else{
+            this.formData.oldLogoName = null;
+            this.formData.itemId = null;
+            this.formData.oldColourName = null;
+            this.isChoosePopur = false
           }
         }
       })
@@ -113,12 +151,63 @@ export default {
     onClickLeft() {
       this.$router.go(-1)
     },
+    /**
+     * @desc   : 单选侧拉确定
+     * @author : 王英杰
+     * @date   : 2023/2/7 17:26
+     */
+    mutiCommit(e, typeName) {
+      if (typeName === 'ProductLogo') {//产品商标
+        this.formData.pdtLogoName = e.names//显示 选中的 工位名称
+        this.formData.pdtLogoId = Number(e.ids) //选中的 工位id
+      }
+      if (typeName === 'ProductColour') { //产品釉色
+        this.formData.pdtColourName = e.names//显示 选中的 工位名称
+        this.formData.pdtColourId = Number(e.ids) //选中的 工位id
+      }
+
+
+    },
+    /**
+     * @desc   : 单选侧拉关闭
+     * @author : 王英杰
+     * @date   : 2023/2/7 17:26
+     */
+    mutiClose(e) {
 
+      if (e === 'ProductLogo') {//产品商标
+        this.showProductLogo = false
+      }
+
+      if (e === 'ProductColour') {//产品釉色
+        this.showProductColour = false
+      }
+
+    },
 
 
     // endregion
 
     // region 保存
+
+    /**
+     * @desc   : 清空数据
+     * @author : 夏常明
+     * @date   : 2023/2/21 15:13
+     */
+    clear() {
+      this.formData = {
+        itemId: '',//成型明细id
+        pdtLogoId: null,//商标id
+        pdtLogoName: null,//商标Name
+        pdtColourId: null,//釉色id
+        pdtColourName: null,//釉色Name
+        pdtBarcode: '',//产品条码
+        oldLogoName: '',//原商标名称
+        oldColourName: '',//原釉色名称
+      }
+      this.isChoosePopur = false;//新商标。釉色下拉控件禁用
+    },
     /**
      * @desc   : 给参数赋值
      * @author : 王英杰
@@ -134,11 +223,14 @@ export default {
      */
     validData(flag) {
       // 生产工号不能为空
-      if (!this.formData.makeUser) {
-        this.$appToast((this.$t('appProductionJobNumbeWrong')));
+      if (!this.formData.pdtBarcode) {
+        this.$appToast((this.$t('appCheckBarcode')));
+        return false;
+      }
+      if (!this.formData.pdtLogoId && !this.formData.pdtColourId) {
+        this.$appToast((this.$t('W_101')));
         return false;
       }
-
       return true;
     },
     /**
@@ -147,14 +239,14 @@ export default {
      * @date   : 2023/2/10 11:46
      */
     saveData() {
-      return this.excute(this.$service.appMouldService, this.$service.appMouldService.insert, this.params);
+      return this.excute(this.$service.productColourLogoService, this.$service.productColourLogoService.updateLogoOrColour, this.params)
     },
     // endregion
 
   },
   mounted() {
     // 设置滚动的位置和高度
-    this.setAppTableHeight(false, null)
+    this.setAppTableHeight()
   },
 }
 </script>