jiangn 1 anno fa
parent
commit
b4bc3ebf4b

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

@@ -729,6 +729,8 @@ export const columns = {
   transferableQuantity:'可转采购数量',
   makingTime:'订单日期',
   inboundProcessingFlag:'开单并入库办理标识',
+  flgCanPcLogin: '电脑登录',
+  flgCanWxLogin:'手机登录',
 }
 
 /**

+ 5 - 1
src/mixins/index.js

@@ -396,7 +396,7 @@ export const indexMixin = {
           return;
         }
         this.loading = true;
-        // 2、给参数赋值
+        // 2、给参数赋值4
         this._setParams(arg);
         // this.params.ftyId = this.$store.state.user.ftyId;// 给工厂赋默认值
         // this.params.cpId = this.$store.state.user.cpId;
@@ -503,6 +503,10 @@ export const indexMixin = {
           if (res && res.code === this.$config.SUCCESS_CODE) {
             this.formData = res.data;
           }
+          // 提供给页面额外赋值的方法
+          if (this.setValuesByEdit){
+            this.setValuesByEdit(res.data);
+          }
         })
       }
       this.editAddModal = true

+ 61 - 64
src/view/mst/basic-data/index.vue

@@ -36,6 +36,7 @@
         <DkSplit v-model="split">
           <!-- 左边部分   -->
           <DkTable slot="left" ref="leftTable" :data="leftData" :height="tableHeight" :page-flag="false"
+                   primaryKey="kindCode"
                    :page-total-flag="false" :show-setting-flag="false" :freeze="false" :choose-flag="false"
                    @current-change="currentChangeEvent($event)">
             <DkTableColumn :title="$t('allType')" field="kindName" width="auto" :filter="false" :sortable="false"
@@ -138,6 +139,7 @@ export default {
   data() {
     let self = this
     return {
+      leftRow:null,
       modalTitle: '',//新建编辑弹窗名称
       submitType: '',//新建编辑提交类型
       kindCode: null,
@@ -184,54 +186,64 @@ export default {
      */
     currentChangeEvent({row}) {
       if (row != null) {
+        this.leftRow = row
         this.kindCode = row.kindCode
-        let params = {
-          cpId: this.$store.state.user.cpId,
-        }
+        this.searchData();
+      }
+    },
 
-        // 仓库
-        if (this.kindCode == this.$config.kindCode.basicWarehouse || this.kindCode == null) {
-          setTimeout(() => {
-            this.wareHouseTableFlag = true
-          }, 100)
-          this.saleChannelTableFlag = false
-          this.dictionaryTableFlag = false
-          params.whCode = row.code
-          params.whName = row.name
-          this.excute(this.$service.wareHouseService, this.$service.wareHouseService.selectByCond, params).then(res => {
-            if (res.code === this.$config.SUCCESS_CODE) {
-              this.wareHouseData = res.data.list
-            }
-          })
-        }
-        // 渠道
-        else if (this.kindCode == this.$config.kindCode.basicChannel) {
-          params.channelCode = row.code
-          params.channelName = row.name
-          this.wareHouseTableFlag = false
-          this.dictionaryTableFlag = false
-          setTimeout(() => {
-            this.saleChannelTableFlag = true
-          }, 100)
-          this.excute(this.$service.saleChannelService, this.$service.saleChannelService.selectByCond, params).then(res => {
-            if (res.code === this.$config.SUCCESS_CODE) {
-              this.saleChannelTableData = res.data.list
-            }
-          })
-        } else {
-          // 数据字典
-          params.dictCode = this.kindCode
-          setTimeout(() => {
-            this.dictionaryTableFlag = true
-          }, 100)
-          this.saleChannelTableFlag = false
-          this.wareHouseTableFlag = false
-          this.excute(this.$service.dictionaryDataService, this.$service.dictionaryDataService.selectByCond, params).then(res => {
-            if (res.code === this.$config.SUCCESS_CODE) {
-              this.dictionaryTableData = res.data.list
-            }
-          })
-        }
+    /**
+     * @desc   : 获取数据
+     * @author : 常皓宁
+     * @date   : 2024/3/9 10:55
+     */
+    getData(params) {
+      // 商品品牌
+      if (this.kindCode == this.$config.kindCode.basicWarehouse || this.kindCode == null) {
+        setTimeout(()=>{
+          this.wareHouseTableFlag = true
+        },100)
+        this.saleChannelTableFlag = false
+        this.dictionaryTableFlag = false
+        console.log("this.leftRow:",this.leftRow)
+        params.whCode = this.leftRow.code
+        params.whName = this.leftRow.name
+        this.excute(this.$service.wareHouseService, this.$service.wareHouseService.selectByCond, params).then(res => {
+          if (res.code === this.$config.SUCCESS_CODE) {
+            this.wareHouseData = res.data.list
+          }
+          this.loading = false;
+        })
+      }
+      // 渠道
+      else if (this.kindCode == this.$config.kindCode.basicChannel) {
+        setTimeout(() => {
+          this.saleChannelTableFlag = true
+        }, 100)
+        this.wareHouseTableFlag = false
+        this.dictionaryTableFlag = false
+        params.channelCode = this.leftRow.code
+        params.channelName = this.leftRow.name
+        this.excute(this.$service.saleChannelService, this.$service.saleChannelService.selectByCond, params).then(res => {
+          if (res.code === this.$config.SUCCESS_CODE) {
+            this.saleChannelTableData = res.data.list
+          }
+          this.loading = false;
+        })
+      } else {
+        // 数据字典
+        params.dictCode = this.kindCode
+        setTimeout(() => {
+          this.dictionaryTableFlag = true
+        }, 100)
+        this.saleChannelTableFlag = false
+        this.wareHouseTableFlag = false
+        this.excute(this.$service.dictionaryDataService, this.$service.dictionaryDataService.selectByCond, params).then(res => {
+          if (res.code === this.$config.SUCCESS_CODE) {
+            this.dictionaryTableData = res.data.list
+          }
+          this.loading = false;
+        })
       }
     },
 
@@ -359,23 +371,6 @@ export default {
     },
 
     /**
-     * @desc   : 获取数据
-     * @author : 常皓宁
-     * @date   : 2024/3/9 10:55
-     */
-    getData() {
-      if (this.kindCode) {
-        let data = {
-          kindCode: this.kindCode,
-          code: this.searchCond._value['code'],
-          name: this.searchCond._value['name'],
-        }
-        this.currentChangeEvent({row: data})
-      }
-      this.loading = false
-    },
-
-    /**
      * @desc   : 基础资料左侧列表数据
      * @author : 常皓宁
      * @date   : 2024/3/9 13:03
@@ -391,10 +386,12 @@ export default {
       }
     },
   },
+  mounted() {
+    this.getBasicData() //基础资料左侧列表数据
+  },
   created() {
     this.primaryKey = 'basicDataId'  // 设置主键Id
     this.routeObjName = 'basicData'  // 设置路由名称
-    this.getBasicData() //商品属性左侧列表数据
   }
 }
 </script>

+ 74 - 12
src/view/mst/staff/index.vue

@@ -86,26 +86,45 @@
         <!--  业务部门  -->
         <DkFormItem prop="orgId" :label="$t('orgName')" :required="true">
           <SelectMagnifier v-model="formData.orgId" :display-text="formData.orgName"
+                           ref="orgId"
                            :type="this.$config.MagnifierType.org"
                            :multiple="false"></SelectMagnifier>
         </DkFormItem>
         <!--登录标识-->
-        <DkFormItem prop="flgCanLogin">
+<!--        <DkFormItem prop="flgCanLogin">-->
+<!--          <template>-->
+<!--            <i-switch v-model="formData.flgCanLogin">-->
+<!--              <span slot="open"></span>-->
+<!--              <span slot="close"></span>-->
+<!--            </i-switch>-->
+<!--          </template>-->
+<!--        </DkFormItem>-->
+        <!--电脑登录标识-->
+        <DkFormItem prop="flgCanPcLogin" :label="$t('flgCanPcLogin')">
           <template>
-            <i-switch v-model="formData.flgCanLogin">
+            <i-switch v-model="formData.flgCanPcLogin">
               <span slot="open"></span>
               <span slot="close"></span>
             </i-switch>
           </template>
         </DkFormItem>
-        <!--登录系统-->
-        <DkFormItem prop="loginType"  v-if="formData.flgCanLogin">
-          <SelectPop v-model="formData.loginType" ref="loginTypeId"
-                     :options="loginTypeList"
-                     :multiple="false"
-                     labelKey="loginTypeName" valueKey="loginTypeId">
-          </SelectPop>
+        <!--手机登录标识-->
+        <DkFormItem prop="flgCanWxLogin" :label="$t('flgCanWxLogin')">
+          <template>
+            <i-switch v-model="formData.flgCanWxLogin">
+              <span slot="open"></span>
+              <span slot="close"></span>
+            </i-switch>
+          </template>
         </DkFormItem>
+        <!--登录系统-->
+<!--        <DkFormItem prop="loginType"  v-if="formData.flgCanLogin">-->
+<!--          <SelectPop v-model="formData.loginType" ref="loginTypeId"-->
+<!--                     :options="loginTypeList"-->
+<!--                     :multiple="false"-->
+<!--                     labelKey="loginTypeName" valueKey="loginTypeId">-->
+<!--          </SelectPop>-->
+<!--        </DkFormItem>-->
         <!--  角色  -->
         <DkFormItem prop="roleIds" :label="$t('roleName')" :data-type="$config.dataType.array">
           <SelectPop v-model="formData.roleIds" ref="roleId"
@@ -176,6 +195,7 @@ export default {
         ],
       // 表单
       formData: {
+        staffID:null,
         staffCode: '',
         staffName: '',
         staffPhone: '',
@@ -183,6 +203,8 @@ export default {
         orgName: null,
         roleIds: null,
         flgCanLogin:false,
+        flgCanPcLogin:false,
+        flgCanWxLogin:false,
         loginType:null,
         remarks: ''
       },
@@ -489,14 +511,39 @@ export default {
       // 查询数据
       return this.excute(this.$service.staffService, this.$service.staffService.selectByCond, params);
     },
-
+    /**
+     * @desc   : 参数赋值
+     * @author : 姜宁
+     * @date   : 2024/7/29 14:30
+     */
+    setParams(params) {
+      let loginType = 4;
+      // 登录标识赋值
+      if (params.flgCanPcLogin || params.flgCanWxLogin){
+        params.flgCanLogin = true
+        if (params.flgCanPcLogin && params.flgCanWxLogin){
+          loginType = 3;
+        }
+        else if(params.flgCanPcLogin && !params.flgCanWxLogin){
+          loginType = 1;
+        }
+        else{
+          loginType = 2;
+        }
+      }
+      else{
+        params.flgCanLogin = false
+      }
+      params.loginType = loginType;
+      return params
+    },
     /**
      * @desc   : 提交事件
      * @author : 常皓宁
      * @date   : 2024/3/5 14:19
      */
     saveData() {
-      console.log('this.params', this.params)
+      console.log("this.params:",this.params)
       if (this.modalParams.button === this.$config.formMode.add) {
         delete this.params.staffId // 解决提示主键重复的问题,删除主键代码
         return this.excute(this.$service.staffService, this.$service.staffService.insert, this.params)
@@ -504,13 +551,13 @@ export default {
         return this.excute(this.$service.staffService, this.$service.staffService.update, this.params)
       }
     },
-
     /**
     * @desc   : 新建完毕后清空窗体
     * @author : 常皓宁
     * @date   : 2024/5/17 9:07
     */
     clear() {
+      this.staffID = null
       this.formData.staffCode = null
       this.formData.staffName = null
       this.formData.staffPhone = null
@@ -518,6 +565,8 @@ export default {
       this.formData.orgName = null
       this.formData.roleIds = null
       this.formData.flgCanLogin = false
+      this.formData.flgCanPcLogin = false
+      this.formData.flgCanWxLogin = false
       this.formData.loginType = null
       this.formData.remarks = null
     },
@@ -530,6 +579,19 @@ export default {
     detail(id) {
       return this.excuteNoParam(this.$service.staffService, this.$service.staffService.selectById, [id], false)
     },
+    /**
+     * @desc   : 编辑赋值
+     * @author : 姜宁
+     * @date   : 2024/7/29 14:52
+     */
+    setValuesByEdit(data) {
+      if (data.loginType == 1 || data.loginType == 3){
+        this.formData.flgCanPcLogin = true
+      }
+      if (data.loginType == 2 || data.loginType == 3){
+        this.formData.flgCanWxLogin = true
+      }
+    },
     // endregion
   },
   created() {