Explorar o código

基础属性修改

于继渤 %!s(int64=2) %!d(string=hai) anos
pai
achega
b93fc56d31

+ 1 - 0
api/pages/common/common.js

@@ -23,5 +23,6 @@ module.exports = {
         unitListBy: 'unit_list_by', //计量单位
         warehouseListBy: 'get_warehouse_by_page', //仓库档案
         getDictionaryData: 'get_dictionary_data', //数据字典
+        getDataKind: 'get_data_kind', //数据字典
     },
 };

+ 5 - 0
components/dkbase/dk-form/dk-form.js

@@ -84,6 +84,11 @@ Component({
         form['addressName'] = location.name;
         form['addressFull'] = location.address + location.name;
         form['addressGcj02'] = { latitude: location.latitude, longitude: location.longitude };
+        form['addressArea'] = {
+          province: location.province,
+          city: location.city,
+          district: location.district == undefined || !location.district ? location.city : location.district
+      }
         // 如果有校验信息就清除掉
         let card = this.data.card;
         let index = this.data.index;

+ 18 - 0
components/dkbase/dk-save-bottom/dk-save-bottom.wxml

@@ -1124,6 +1124,24 @@
       </van-button>
     </view> -->
   </view>
+
+  <view wx:if="{{flagTypeName ==='basic-data-add'}}" style="display: flex; padding:35rpx 34rpx 62rpx 34rpx;">
+
+<view style="width:48%">
+  <van-button size="large" plain round color="#1B365D" custom-style="height:88rpx;" bind:click="submit" type="default">排序
+  </van-button>
+</view>
+<view style="width: 4%;"></view>
+<view style="width:100%;">
+  <van-button size="large" round color="#CAA977" custom-style="height:88rpx;" bind:click="allClean" type="default">新建
+  </van-button>
+</view>
+
+<!-- <view style="width:100%;">
+  <van-button size="large" round color="#CAA977" custom-style="height:88rpx;" bind:click="allClean" type="default">新建
+  </van-button>
+</view> -->
+</view>
   <view wx:if="{{flagTypeName ==='Product-file'}}" style="display: flex; padding:35rpx 34rpx 62rpx 34rpx;">
 
 

+ 5 - 1
i18n/zh-CN.js

@@ -172,6 +172,10 @@ const accountsManage = {
   collection: '收款',
 
 }
+
+const  customer = {
+  cusPhone:'客户电话'
+}
 // 提示信息
 const messages = {
 }
@@ -247,5 +251,5 @@ const fund ={
 
 }
 module.exports = {
-  items: Object.assign({}, fund,home, basicData, columns, saleOrder, button, messages, others, accountsManage, org, supplier, goodsSku)
+  items: Object.assign({}, fund,home, basicData, columns, saleOrder, button, messages, others, accountsManage, org, supplier, goodsSku,customer)
 }

+ 23 - 42
package-basic-data/pages/basic-data/basic-data.js

@@ -22,6 +22,7 @@ Page({
     //接口
     warehouseService: app.globalData['warehouseService'],
     saleChannelService: app.globalData['saleChannelService'],
+    commonService: app.globalData['commonService'],
     routeObjName: 'basicData',
     tableData: [],
     // 查询条件
@@ -32,45 +33,7 @@ Page({
         { code: 1, title: mixins.$t('valid'), value: true },
         { code: 2, title: mixins.$t('invalid'), value: false }]
     }],
-    sidebarList: [
-      {
-        id: 0,
-        name: mixins.$t('warehouse')
-      },
-      {
-        id: 1,
-        name: mixins.$t('saleChannel')
-      },
-      {
-        id: 2,
-        name: mixins.$t('incomeCategory')
-      },
-      {
-        id: 3,
-        name: mixins.$t('expenditureCategory')
-      },
-      {
-        id: 4,
-        name: mixins.$t('reasonStorage')
-      },
-      {
-        id: 5,
-        name: mixins.$t('reasonOutbound')
-      },
-      {
-        id: 6,
-        name: mixins.$t('accountCategory')
-      },
-      {
-        id: 7,
-        name: mixins.$t('customerSource')
-      },
-      {
-        id: 8,
-        name: mixins.$t('customerlabel')
-      },
-
-    ],
+    sidebarList: [],
     contentList: [
       { name: 'whCode', title: mixins.$t('whCode') },
       { name: 'whName', title: mixins.$t('whName') },
@@ -228,7 +191,8 @@ Page({
 
     let detail = e.detail
     this.setData({
-      formDataName: this.data.sidebarList[detail].name
+      formDataName: this.data.sidebarList[detail].kindName,
+      dictCode: this.data.sidebarList[detail].kindCode
     })
     this.setPopContent();
     this.searchData()
@@ -291,7 +255,7 @@ Page({
     } else if (params.flgValidList && params.flgValidList.indexOf("true") == -1 && params.flgValidList.indexOf("false") != -1) {
       params.flgValid = false
     }
-    params.dictCode = this.data.formDataName
+    params.dictCode = this.data.dictCode
     params.cpId = 1
     return params
   },
@@ -316,6 +280,22 @@ Page({
 
   },
   /**
+    * @desc :   获取左侧数据
+    * @date : 2024/2/1 15:49
+    * @author : 于继渤
+    */
+  getDataKind() {
+    return this.excute(this.data.commonService, this.data.commonService.getDataKind, {
+      kindType: Constants.kindType.basicData
+    }).then(res => {
+      this.setData({
+        sidebarList: res.data.data
+      })
+    })
+  },
+
+
+  /**
     * @desc :   处理接口返回数据
     * @date : 2024/2/1 15:49
     * @author : 于继渤
@@ -364,7 +344,7 @@ Page({
       } else { //基础数据
         service = this.data.service
         id = params.data_id
-        params.dictCode = this.data.formDataName
+        params.dictCode = this.data.dictCode
       }
     if (id) { //编辑
       return this.excute(service, service.update, params);
@@ -378,6 +358,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
+    this.getDataKind()
     let _this = this;
     wx.getSystemInfo({
       success: function (res) {

+ 2 - 2
package-basic-data/pages/basic-data/basic-data.wxml

@@ -10,7 +10,7 @@
   <!-- 左侧菜单列表 -->
   <van-sidebar activeKey="{{sideKey}}" bindchange="changeSidebar" custom-class="left-class">
     <view style="height:calc({{windowHeight+'px'}} - {{'390rpx'}});overflow: scroll;">
-      <van-sidebar-item wx:key="index" custom-class="{{sideKey - 1 == index? 'sidebar-item-before': (sideKey + 1 == index?'sidebar-item-next':'sidebar-item')}}" title="{{item.name}}" data-id="{{item.id}}" wx:for="{{sidebarList}}" />
+      <van-sidebar-item wx:key="index" custom-class="{{sideKey - 1 == index? 'sidebar-item-before': (sideKey + 1 == index?'sidebar-item-next':'sidebar-item')}}" title="{{item.kindName}}" data-id="{{item.id}}" wx:for="{{sidebarList}}" />
     </view>
   </van-sidebar>
   <view style="margin-left: 140rpx;width: 100%;">
@@ -32,4 +32,4 @@
 
 
 <!-- 底部信息 -->
-<dk-save-bottom flagTypeName="basic-data" bottomClass="{{true}}" bind:submit="toSort" bind:allClean="toAdd" />
+<dk-save-bottom flagTypeName="basic-data-add" bottomClass="{{true}}" bind:submit="toSort" bind:allClean="toAdd" />

+ 29 - 10
package-basic-data/pages/customer-list/add/add.js

@@ -17,30 +17,49 @@ Page({
    */
   data: {
     routeObjName: 'customer',
-    cardList: ['main','center','remarks'],
+    cardList: ['main', 'center', 'remarks'],
     contentObj: {
       main: [
         { code: 'cusName', type: 'str', required: true, title: mixins.$t('customerName') },
         { code: 'cusPhone', type: 'phone', title: '客户电话', required: true },
         { code: 'addressFull', type: 'address', title: '客户地址', required: true },
-        { code: 'addressNo', type: 'str', required: true, title:'门牌号' },
-        { code: 'cusFromId', name: 'cusFromName', type: 'drop', required: true, dropType: 'customerFrom',title:'客户来源' },
+        { code: 'addressNo', type: 'str', required: true, title: '门牌号' },
+        { code: 'cusFromId', name: 'cusFromName', type: 'drop', required: true, dropType: 'customerFrom', title: '客户来源' },
         { code: 'contactName', type: 'str', required: false, title: '联系人' },
-        { code: 'contactPhone', type: 'phone', title: '联系电话', required: false },
+        { code: 'contactPhone', type: 'str', title: '联系电话', required: false },
       ],
-      center:[
-        { code: 'channelId', name: 'channelName', type: 'drop', required: true, dropType: 'saleChannel',title:'销售渠道' },
-        { code: 'staffId', name: 'staffName', type: 'drop', required: true, dropType: 'staff',title:'销售人员' },
-        { code: 'orgId', name: 'orgName', type: 'drop', required: true, dropType: 'org',title:'销售部门' },
-        { code: 'addressNo', type: 'str', required: false, title:'初次欠款' },
+      center: [
+        { code: 'channelId', name: 'channelName', type: 'drop', required: true, dropType: 'saleChannel', title: '销售渠道' },
+        { code: 'staffId', name: 'staffName', type: 'drop', required: true, dropType: 'staff', title: '销售人员' },
+        { code: 'orgId', name: 'orgName', type: 'drop', required: true, dropType: 'org', title: '销售部门' },
+        { code: 'addressNo', type: 'str', required: false, title: '初次欠款' },
       ],
-      remarks:[
+      remarks: [
         { code: 'remarks', type: 'textarea', title: mixins.$t('remarks') }
       ]
     },
   },
+  /**
+  * @desc : 设置保存参数
+  * @date : 2024/2/1 15:49
+  * @author : 于继渤
+  */
+  setParams(params) {
+    return params
+  },
+
+
 
   /**
+  * @desc : 保存数据服务
+  * @date : 2024/2/1 15:49
+  * @author : 于继渤
+  */
+  saveData() {
+    return this.excute(this.data.service, this.data.service.insert, this.data.params);
+
+  },
+  /**
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {

+ 19 - 7
package-basic-data/pages/product-attribute/product-attribute.js

@@ -21,6 +21,7 @@ Page({
     goodsCategoryService: app.globalData['goodsCategoryService'],
     goodsSeriesService: app.globalData['goodsSeriesService'],
     unitService: app.globalData['unitService'],
+    commonService: app.globalData['commonService'],
     // 路由
     routeObjName: 'product-attribute',
     // 查询条件
@@ -37,12 +38,7 @@ Page({
       { name: 'brandName', title: mixins.$t('brandName') },
       { name: 'supplierNames', title: mixins.$t('supplier') }
     ],
-    sidebarList: [
-      { id: 0, name: mixins.$t('goodsBrand') },
-      { id: 1, name: mixins.$t('goodsCategory') },
-      { id: 2, name: mixins.$t('goodsSeries') },
-      { id: 3, name: mixins.$t('unit') }
-    ],
+
     formDataName: mixins.$t('goodsBrand'),
     popContent:
       [
@@ -200,7 +196,7 @@ Page({
   changeSidebar(e) {
     let detail = e.detail
     this.setData({
-      formDataName: this.data.sidebarList[detail].name
+      formDataName: this.data.sidebarList[detail].kindName
     })
     this.searchData()
   },
@@ -289,6 +285,21 @@ Page({
     }
 
   },
+
+   /**
+    * @desc :   获取左侧数据
+    * @date : 2024/2/1 15:49
+    * @author : 于继渤
+    */
+   getDataKind() {
+    return this.excute(this.data.commonService, this.data.commonService.getDataKind, {
+      kindType: Constants.kindType.goodsAttr
+    }).then(res => {
+      this.setData({
+        sidebarList: res.data.data
+      })
+    })
+  },
   /**
    * @desc : 设置pop字段
    * @author : 于继渤
@@ -346,6 +357,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
+    this.getDataKind()
     let _this = this;
     wx.getSystemInfo({
       success: function (res) {

+ 1 - 1
package-basic-data/pages/product-attribute/product-attribute.wxml

@@ -10,7 +10,7 @@
   <!-- 左侧菜单列表 -->
   <van-sidebar activeKey="{{sideKey}}" bindchange="changeSidebar" custom-class="left-class" >
     <view style="height:calc({{windowHeight+'px'}} - {{'220rpx'}});overflow: scroll;background-color:#ECF2FF">
-      <van-sidebar-item wx:key="index" custom-class="{{sideKey - 1 == index? 'sidebar-item-before': (sideKey + 1 == index?'sidebar-item-next':'sidebar-item')}}" title="{{item.name}}" data-id="{{item.id}}" wx:for="{{sidebarList}}" />
+      <van-sidebar-item wx:key="index" custom-class="{{sideKey - 1 == index? 'sidebar-item-before': (sideKey + 1 == index?'sidebar-item-next':'sidebar-item')}}" title="{{item.kindName}}" data-id="{{item.id}}" wx:for="{{sidebarList}}" />
     </view>
   
   </van-sidebar>