فهرست منبع

修改bug;产品型号变更

hongxudong 3 سال پیش
والد
کامیت
e02c0d7bae

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

@@ -101,6 +101,8 @@ export default {
     getColourForSet:'get_colour_for_set',
     //商标设定放大镜详细查询
     getLogoForSet:'get_logo_for_set',
+    //查询成型产品型号
+    getProductModel:'get_product_model',
     // 获取工艺节点
     getProcessNode:'get_process_node',
     // 获取成型线
@@ -169,7 +171,7 @@ export default {
     getColourForSet:'get_colour_for_set',
     //商标设定放大镜详细查询
     getLogoForSet:'get_logo_for_set',
-    
+
     getPrintingData:'get_printing_data',
   }
 }

+ 26 - 0
src/api/pages/pdm/prod-code-change.js

@@ -0,0 +1,26 @@
+/**
+ * @desc   : 产品型号变更
+ * @author : 洪旭东
+ * @date   : 2023-04-19 14:42
+ */
+export default {
+  prodCodeChangeService:{
+    prefix:'/mdm-server/pdm/productCode/',
+    //产品型号变更一览查询(分页)
+    getProductColourLogoByBarcode:'get_product_colour_logo_by_barcode',
+    //修改成型产品型号
+    updateProductModel:'update_product_model',
+  }
+}
+
+/**
+ * @desc   : 路由
+ * @author : 洪旭东
+ * @date   : 2023-04-19 14:42
+ */
+export const routeUrl = {
+  prodCodeChange: {
+    // 更改型号
+    changeModel :{key: 'changeModel', method: 'changeModel'}
+  },
+}

+ 2 - 2
src/components/base/dk-function/dk-function.vue

@@ -66,8 +66,8 @@
       </div>
     </div>
     <div class="choose-all-class">
-      <Button type="primary" size="small" @click="selectAll">{{ vm.$t('allChoose') }}</Button>
-      <Button type="default" size="small" @click="unSelectAll" style="margin-left: 2px">
+      <Button type="primary" size="small" @click="selectAll" :disabled="disabled">{{ vm.$t('allChoose') }}</Button>
+      <Button type="default" size="small" @click="unSelectAll" style="margin-left: 2px" :disabled="disabled">
         {{ vm.$t('allNoChoose') }}
       </Button>
       <Button type="default" size="small" @click="expandAll" style="margin-left: 2px">

+ 17 - 0
src/components/business/select-magnifier/select-magnifier.vue

@@ -1134,6 +1134,23 @@ export default {
           {field: 'colourName', width: 'auto'},
         ]
       }
+      //查询成型产品型号
+      else if (self.type === self.$config.MagnifierType.getProductModel) {
+        self.service = this.$service.commonService
+        self.methodsName = 'getProductModel'
+        self.methodsNameDetail = 'getProductModel'
+        self.methodsNameInput = 'getProductModel'
+        self.inputSearchField = 'pdtBarcodeEqual'
+        self.searchContent = [
+          {itemCode: 'pdtBarcode'},
+        ]
+        self.selectKey = 'itemId'
+        self.selectLabel = 'pdtBarcode'
+        self.columns = [
+          {field: 'pdtBarcode', width: 'auto'},
+          {field: 'modelName', width: 'auto', title: self.$t('pdtModelId')},
+        ]
+      }
       // 工艺节点
       else if (self.type === self.$config.MagnifierType.processNode) {
         self.service = this.$service.commonService

+ 2 - 0
src/config/index.js

@@ -866,6 +866,8 @@ export default {
     productColour: 'productColour',
     // 产品商标设定
     productLogoColour: 'productLogoColour',
+    // 查询成型产品型号
+    getProductModel: 'getProductModel',
     //用户、打卡
     userAndClock: 'userAndClock',
     //产品类别

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

@@ -713,6 +713,8 @@ export const columns = {
   moldLineCode: '成型线编码',
   oldPdtCode: '原产品条码',
   pdtCodeNew: '新产品条码',
+  oldModelName: '原产品型号',
+  newModelName: '新产品型号',
   changeUser: '变更者',
   moldLineSysTags: '成型线标签',
   bindUserCode: '绑定工号',
@@ -733,11 +735,13 @@ export const columns = {
   oldLogoName: '原商标',
   setLogo: '商标设定',
   setColour: '釉色设定',
+  setModel: '型号设定',
   oldColourName: '原釉色',
   defJobId: '默认工种',
   defJobName: '默认工种',
   newPdtLogo: '新商标',
   newPdtColour: '新釉色',
+  newModel: '新型号',
   hisTime: '变更时间',
 
   //工号变更
@@ -1066,6 +1070,7 @@ export const messages = {
   W_138: '当前暂无此生产工号,请重新输入',
   W_137: '请保存至少一条明细',
   W_136: '选择打印模板',
+  W_139: '请选择新型号',
   E_001: '系统出现异常,请联系管理员。',
   Q_001: '当前页面的数据有过更改,请确认需要保存吗?',
   Q_002: '确定要进行{param}操作吗?',

+ 1 - 1
src/view/core/user/index.vue

@@ -284,7 +284,7 @@ export default {
           this.menuList = res.data;
           //判断选中用户是否拥有超级管理员权限
           if(rows[0].roleIds && rows[0].roleIds.length>0){
-            if(rows[0].roleIds.map(map =>map == -1).length>0){
+            if(rows[0].roleIds.filter(f =>f == -1).length>0){
               //用户有超级管理员角色时,功能权限不能修改
               disabledFlag = true
             }

+ 235 - 1
src/view/pdm/prod-code-change/index.vue

@@ -1,10 +1,244 @@
+<!-- @desc:产品型号变更  @auth:洪旭东  @time:2023-04-19 10:41 -->
 <template>
+  <div class="main-div">
+    <!--  操作按钮-->
+    <BaseIndexButtonGroup id="BaseIndexButtonGroup">
+      <template #left>
+        <BaseIndexButton right-button="product-code-select" ref="search" name="search"></BaseIndexButton>
+        <!--清空查询条件-->
+        <BaseIndexButton ref="clear" name="clear"></BaseIndexButton>
+        <!--更改-->
+        <BaseIndexButton right-button="productColourLogo-productLogoColour" ref="changeModel" name="changeModel"></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>
+      <DkTable :id="'table-'+$options.name" ref="table-select" :data="tableData"
+               :pageFlag="true"
+               :page-total="pageInfo.total"
+               :current-page="pageInfo.currentPage"
+               :choose-flag="false"
+               :height="this.tableHeight" primaryKey="pdtBarcode"
+               @pageChange="pageSizeChange">
+        <!-- 产品条码-->
+        <DkTableColumn field="pdtBarcode"></DkTableColumn>
+        <!-- 原型号-->
+        <DkTableColumn field="oldModelName"></DkTableColumn>
+        <!-- 新型号-->
+        <DkTableColumn field="modelName" :title="$t('newModelName')"></DkTableColumn>
+        <!-- 变更者-->
+        <DkTableColumn :title="$t('changeUser')" field="opCreateUserName"></DkTableColumn>
+        <!-- 变更时间-->
+        <DkTableColumn field="hisTime"></DkTableColumn>
+      </DkTable>
+    </div>
+
+    <!--新建编辑-->
+    <DkModal
+      :loading="loading"
+      v-model="changeModal"
+      ref="modal_editAdd"
+      @modalOk="save"
+      :saveFlag="true"
+      :title=modalTitle
+    >
+      <DkForm ref="formInline" v-model="formData" :col-count="1" :label-max-words="5">
+        <!--   产品条码     -->
+        <DkFormItem prop="itemId" :required="true" :data-type="$config.dataType.number" :label="$t('pdtBarcode')">
+          <SelectMagnifier v-model="formData.itemId" :display-text="formData.pdtBarcode"
+                           :type="this.$config.MagnifierType.getProductModel"
+                           :multiple="false"
+                           :inputReadOnly="false"
+                           ref="pdtBarcode"
+                           @ok="chooseLogoColour"
+                           @modelOk="setPdtBarcode"
+          ></SelectMagnifier>
+        </DkFormItem>
+        <!-- 原型号 -->
+        <DkFormItem prop="oldModelName">
+          <InputPop v-model="formData.oldModelName" :readonly="true" ref="oldModelName"/>
+        </DkFormItem>
+        <!-- 新型号 -->
+        <DkFormItem :label="$t('newModel')" prop="pdtModelId">
+          <SelectMagnifier v-model="formData.pdtModelId" :display-text="formData.pdtModelName"
+                           :type="this.$config.MagnifierType.product"
+                           :multiple="false"
+                           :inputReadOnly="false"
+                           :disabled='newEnable'
+                           ref="pdtModelId"
+          ></SelectMagnifier>
+        </DkFormItem>
+      </DkForm>
+    </DkModal>
+
+  </div>
 </template>
 
 <script>
+import {indexMixin} from "@/mixins";
+
 export default {
-name: "prod-code-change"
+  mixins: [indexMixin],
+  name: "prod-code-change",
+  data() {
+    return {
+      searchContent: [
+        {
+          itemCode: 'pdtBarcode',//成型线编码
+        }
+      ],
+      changeModal: false,//窗口显示
+      modalTitle: '',//窗口名称
+      formData: {
+        itemId: '',//成型明细id
+        pdtModelId: null,//型号id
+        pdtBarcode: '',//产品条码
+        oldModelName: '',//原型号名称
+      },
+      modelList: [],//型号
+      newEnable: true, //启用、禁用新型号,新型号(true 禁用 false 启用)
+    }
+  },
+  methods: {
+    //region 一览
+    /**
+     * @desc   : 设置查询条件
+     * @author : 夏常明
+     * @date   : 2023/1/12 11:24
+     */
+    setSearchParams(params) {
+      //成型记录履历类型
+      params.hisTypeList = [this.$config.moldingItemHisType.modelBefore, this.$config.moldingItemHisType.modelAfter];
+      return params
+    },
+    /**
+     * @desc   : 获取数据
+     * @author : 夏常明
+     * @date   : 2023/2/21 10:39
+     */
+    getData(params) {
+      // 查询数据
+      return this.excute(this.$service.moldingItemHisService, this.$service.moldingItemHisService.selectByCond, params);
+    },
+    /**
+     * @desc   : 放大镜控件绑定值
+     * @author : 洪旭东
+     * @date   : 2023-04-19 14:01
+     */
+    chooseLogoColour(rows) {
+      if (rows && rows.length > 0) {
+        this.formData.pdtBarcode = rows[0].pdtBarcode;
+        this.formData.itemId = rows[0].itemId;
+        this.formData.oldModelName = rows[0].modelName;
+        this.formData.productId = rows[0].productId;
+        this.newEnable = false;
+      }else{
+        this.formData.pdtBarcode = null;
+        this.formData.itemId = null;
+        this.formData.oldModelName = null;
+        this.formData.productId = null
+      }
+    },
+    /**
+     * @desc   : 放大镜输入事件
+     * @author : 洪旭东
+     * @date   : 2023-04-19 14:00
+     */
+    setPdtBarcode(val) {
+      if (val) {
+        this.newEnable = false;
+      } else {
+        this.newEnable = true;
+        this.formData = {
+          oldModelName: '',//原型号名称
+        }
+      }
+    },
+    /**
+     * @desc   : 放大镜控件绑定值--产品型号
+     * @author : 洪旭东
+     * @date   : 2023-04-19 14:00
+     */
+    chooseColour(rows) {
+      if (rows) {
+        this.formData.oldModelName = rows[0].modelName;
+        this.formData.pdtBarcode = rows[0].pdtBarcode;
+        this.formData.itemId = rows[0].itemId;
+      }
+    },
+    /**
+     * @desc   : 型号设定按钮事件
+     * @author : 夏常明
+     * @date   : 2023/2/21 13:14
+     */
+    changeModel() {
+      this.modalTitle = this.setTitle('setModel')
+      this.changeModal = true
+      this.$nextTick(()=>{
+        // 打开选择界面
+        this.$refs.pdtBarcode.magnifierClick();
+      })
+    },
+    /**
+     * @desc   : 清空数据
+     * @author : 洪旭东
+     * @date   : 2023-04-19 14:00
+     */
+    clear() {
+      this.formData = {
+        itemId: '',//成型明细id
+        pdtModelId: null,//型号id
+        pdtBarcode: '',//产品条码
+        oldModelName: '',//原型号名称
+      }
+      this.$refs.pdtModelId.clearAll()
+      this.newEnable = true;//新型号。型号下拉控件禁用
+    },
+
+    //endregion
+
+    //region 新建编辑
+
+    /**
+     * @desc   : 保存数据
+     * @author : 洪旭东
+     * @date   : 2023-04-19 13:59
+     */
+    saveData() {
+      return this.excute(this.$service.prodCodeChangeService, this.$service.prodCodeChangeService.updateProductModel, this.params)
+    },
+    /**
+     * @desc   : 参数赋值
+     * @author : 夏常明
+     * @date   : 2023/2/20 16:08
+     */
+    setParams() {
+      this.params = {...this.formData}
+    },
+    /**
+     * @desc   : 保存校验
+     * @author : 洪旭东
+     * @date   : 2023-04-19 13:59
+     */
+    validData() {
+      if (!this.formData.pdtModelId) {
+        this.$Message.error(this.$t('W_139'))
+        return false;
+      }
+      return true;
+    }
+    //endregion
+  },
+  created() {
+    this.routeObjName = 'prodCodeChange'  // 设置路由名称
+  }
 }
 </script>
 

+ 2 - 0
src/view/pdm/prod-logo-colour/index.vue

@@ -161,12 +161,14 @@ export default {
         this.formData.pdtBarcode = rows[0].pdtBarcode;
         this.formData.itemId = rows[0].itemId;
         this.formData.oldColourName = rows[0].colourName;
+        this.formData.productId = rows[0].productId;
         this.newEnable = false;
       }else{
         this.formData.oldLogoName = null;
         this.formData.pdtBarcode = null;
         this.formData.itemId = null;
         this.formData.oldColourName = null;
+        this.formData.productId = null
       }
     },
     /**