|
|
@@ -6,534 +6,274 @@
|
|
|
* 作者 日期 版本 修改内容
|
|
|
* 于继渤 2024-1-23 1.00 基础资料
|
|
|
*******************************************************************************/
|
|
|
+const Constants = require('@/utils/Constants.js');
|
|
|
+const util = require('@/utils/util.js')
|
|
|
+const mixins = require('@/mixins/index.js')
|
|
|
+const app = getApp()
|
|
|
Page({
|
|
|
-
|
|
|
+ mixins: [mixins],
|
|
|
/**
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
- sideKey: 0,
|
|
|
- listTitle: '',
|
|
|
- showPopup: false,
|
|
|
- leftData: [],
|
|
|
- showPopupItem: {},
|
|
|
- fieldData: {},
|
|
|
- statusItem: {
|
|
|
- text: '全部',
|
|
|
- value: -1
|
|
|
- },
|
|
|
- statusList: [
|
|
|
- { checked: false, text: '有效', value: 1},
|
|
|
- { checked: false, text: '无效', value: 0 },
|
|
|
- { checked: true, text: '全部', value: -1 },
|
|
|
- ], //状态
|
|
|
- fieldList: [
|
|
|
- {
|
|
|
- typeName: '仓库档案',
|
|
|
- warehouseCode: '仓库编码',
|
|
|
- warehouseName: '仓库名称',
|
|
|
- supervisorName: '仓库主管'
|
|
|
- },
|
|
|
- {
|
|
|
- typeName: '销售渠道',
|
|
|
- channelCode: '渠道编码',
|
|
|
- channelName: '渠道名称'
|
|
|
- },
|
|
|
- {
|
|
|
- typeName: '收入类别',
|
|
|
- incomeCode: '收入编码',
|
|
|
- incomeName: '收入名称'
|
|
|
- },
|
|
|
- {
|
|
|
- typeName: '支出类别',
|
|
|
- expenditureCode: '支出编码',
|
|
|
- expenditureName: '支出名称'
|
|
|
- },
|
|
|
- {
|
|
|
- typeName: '入库原因',
|
|
|
- reasonCode: '原因编码',
|
|
|
- reasonName: '原因名称'
|
|
|
- },
|
|
|
- {
|
|
|
- typeName: '出库原因',
|
|
|
- reasonCode: '原因编码',
|
|
|
- reasonName: '原因名称'
|
|
|
- },
|
|
|
- {
|
|
|
- typeName: '账户类别',
|
|
|
- paymentCode: '账户编码',
|
|
|
- paymentName: '账户名称'
|
|
|
- },
|
|
|
- {
|
|
|
- typeName: '客户来源',
|
|
|
- sourceCode: '来源编码',
|
|
|
- sourceName: '来源名称'
|
|
|
- },
|
|
|
- {
|
|
|
- typeName: '客户标签'
|
|
|
- },
|
|
|
-
|
|
|
- ], //字段渲染
|
|
|
- // 渲染数据
|
|
|
- test00: [{
|
|
|
- warehouseCode: 'CK00001',
|
|
|
- warehouseName: '运营主仓',
|
|
|
- supervisorName: '王仓管员/15640556650',
|
|
|
- flagValue: true,
|
|
|
- defFlag: true
|
|
|
- },
|
|
|
- {
|
|
|
- warehouseCode: 'CK00002',
|
|
|
- warehouseName: '红星店面仓库',
|
|
|
- supervisorName: '王店长/15640556650',
|
|
|
- flagValue: false
|
|
|
- },
|
|
|
- {
|
|
|
- warehouseCode: 'CK00003',
|
|
|
- warehouseName: '红星店面仓库',
|
|
|
- supervisorName: '王店长/15640556650',
|
|
|
- flagValue: true
|
|
|
- }],
|
|
|
- test01: [
|
|
|
- {
|
|
|
- channelCode: 'QD00001',
|
|
|
- channelName: '零售',
|
|
|
- flagValue: true,
|
|
|
- defFlag: true
|
|
|
- },
|
|
|
- {
|
|
|
- channelCode: 'QD00002',
|
|
|
- channelName: '家装',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- channelCode: 'QD00003',
|
|
|
- channelName: '分销',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- channelCode: 'QD00004',
|
|
|
- channelName: '工程',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- channelCode: 'QD00005',
|
|
|
- channelName: '其他',
|
|
|
- flagValue: true
|
|
|
- }
|
|
|
- ],
|
|
|
- test02: [
|
|
|
- {
|
|
|
- incomeCode: 'SR00001',
|
|
|
- incomeName: '配送费',
|
|
|
- flagValue: true,
|
|
|
- defFlag: true
|
|
|
- },
|
|
|
- {
|
|
|
- incomeCode: 'SR00002',
|
|
|
- incomeName: '安装费',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- incomeCode: 'SR00003',
|
|
|
- incomeName: '加工费',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- incomeCode: 'SR00004',
|
|
|
- incomeName: '拆旧费',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- incomeCode: 'SR00005',
|
|
|
- incomeName: '其他收入',
|
|
|
- flagValue: true
|
|
|
- }
|
|
|
- ],
|
|
|
- test03: [
|
|
|
- {
|
|
|
- expenditureCode: 'SR00001',
|
|
|
- expenditureName: '房租费',
|
|
|
- flagValue: true,
|
|
|
- defFlag: true
|
|
|
- },
|
|
|
- {
|
|
|
- expenditureCode: 'SR00002',
|
|
|
- expenditureName: '水电费',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- expenditureCode: 'SR00003',
|
|
|
- expenditureName: '送货费',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- expenditureCode: 'SR00004',
|
|
|
- expenditureName: '员工工资',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- expenditureCode: 'SR00005',
|
|
|
- expenditureName: '促销活动费',
|
|
|
- flagValue: true
|
|
|
- }
|
|
|
- ],
|
|
|
- test04: [
|
|
|
- {
|
|
|
- reasonCode: 'RK00001',
|
|
|
- reasonName: '期初入库',
|
|
|
- flagValue: true,
|
|
|
- defFlag: true
|
|
|
- },
|
|
|
- {
|
|
|
- reasonCode: 'RK00002',
|
|
|
- reasonName: '其他入库',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- reasonCode: 'RK00003',
|
|
|
- reasonName: '采购入库',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- reasonCode: 'RK00004',
|
|
|
- reasonName: '销售回库',
|
|
|
- flagValue: true
|
|
|
- }
|
|
|
- ],
|
|
|
- test05: [
|
|
|
- {
|
|
|
- reasonCode: 'CK00001',
|
|
|
- reasonName: '销售出库',
|
|
|
- flagValue: true,
|
|
|
- defFlag: true
|
|
|
- },
|
|
|
+ routeObjNameGoTo: '',
|
|
|
+ formDataName: mixins.$t('warehouse'),
|
|
|
+ //接口
|
|
|
+ warehouseService: app.globalData['warehouseService'],
|
|
|
+ saleChannelService: app.globalData['saleChannelService'],
|
|
|
+ routeObjName: 'basic-data',
|
|
|
+ tableData:[],
|
|
|
+ sidebarList: [
|
|
|
{
|
|
|
- reasonCode: 'CK00002',
|
|
|
- reasonName: '其他出库',
|
|
|
- flagValue: true
|
|
|
+ id: 0,
|
|
|
+ name: mixins.$t('warehouse')
|
|
|
},
|
|
|
{
|
|
|
- reasonCode: 'CK00003',
|
|
|
- reasonName: '采购退货出库',
|
|
|
- flagValue: true
|
|
|
+ id: 1,
|
|
|
+ name: mixins.$t('saleChannel')
|
|
|
},
|
|
|
{
|
|
|
- reasonCode: 'CK00004',
|
|
|
- reasonName: '调货出库',
|
|
|
- flagValue: true
|
|
|
- }
|
|
|
- ],
|
|
|
- test06: [
|
|
|
- {
|
|
|
- paymentCode: 'SF00001',
|
|
|
- paymentName: '微信',
|
|
|
- flagValue: true,
|
|
|
- defFlag: true
|
|
|
+ id: 2,
|
|
|
+ name: mixins.$t('incomeCategory')
|
|
|
},
|
|
|
{
|
|
|
- paymentCode: 'SF00002',
|
|
|
- paymentName: '现金',
|
|
|
- flagValue: true
|
|
|
+ id: 3,
|
|
|
+ name: mixins.$t('expenditureCategory')
|
|
|
},
|
|
|
{
|
|
|
- paymentCode: 'SF00003',
|
|
|
- paymentName: '银行转账',
|
|
|
- flagValue: true
|
|
|
+ id: 4,
|
|
|
+ name: mixins.$t('reasonStorage')
|
|
|
},
|
|
|
{
|
|
|
- paymentCode: 'SF00004',
|
|
|
- paymentName: '支付宝',
|
|
|
- flagValue: true
|
|
|
- }
|
|
|
- ],
|
|
|
- test07: [
|
|
|
- {
|
|
|
- sourceCode: 'QD00001',
|
|
|
- sourceName: '零售',
|
|
|
- flagValue: true,
|
|
|
- defFlag: true
|
|
|
+ id: 5,
|
|
|
+ name: mixins.$t('reasonOutbound')
|
|
|
},
|
|
|
{
|
|
|
- sourceCode: 'QD00002',
|
|
|
- sourceName: '家装',
|
|
|
- flagValue: true
|
|
|
+ id: 6,
|
|
|
+ name: mixins.$t('accountCategory')
|
|
|
},
|
|
|
{
|
|
|
- sourceCode: 'QD00003',
|
|
|
- sourceName: '分销',
|
|
|
- flagValue: true
|
|
|
- },
|
|
|
- {
|
|
|
- sourceCode: 'QD00004',
|
|
|
- sourceName: '工程',
|
|
|
- flagValue: true
|
|
|
- }
|
|
|
- ],
|
|
|
-
|
|
|
- test08: [
|
|
|
- {
|
|
|
- code: '客户级别',
|
|
|
- list:[
|
|
|
- {
|
|
|
- code:'A类',
|
|
|
- flagValue:true,
|
|
|
- },
|
|
|
- {
|
|
|
- code:'B类',
|
|
|
- flagValue:true,
|
|
|
- }
|
|
|
-
|
|
|
- ],
|
|
|
+ id: 7,
|
|
|
+ name: mixins.$t('customerSource')
|
|
|
},
|
|
|
{
|
|
|
- code: '房屋类型',
|
|
|
- list:[
|
|
|
- {
|
|
|
- code:'两居室',
|
|
|
- flagValue:true,
|
|
|
- },
|
|
|
- {
|
|
|
- code:'三居室',
|
|
|
- flagValue:true,
|
|
|
- }
|
|
|
- ],
|
|
|
+ id: 8,
|
|
|
+ name: mixins.$t('customerlabel')
|
|
|
},
|
|
|
|
|
|
- {
|
|
|
- code: '装修风格',
|
|
|
- list:[
|
|
|
- {
|
|
|
- code:'中式',
|
|
|
- flagValue:true,
|
|
|
- },
|
|
|
- {
|
|
|
- code:'欧式',
|
|
|
- flagValue:true,
|
|
|
- },
|
|
|
-
|
|
|
- ],
|
|
|
- },
|
|
|
],
|
|
|
+ contentList: [
|
|
|
+ { name: 'whCode', title: mixins.$t('whCode') },
|
|
|
+ { name: 'whName', title: mixins.$t('whName') },
|
|
|
+ { name: 'supervisor', title: mixins.$t('supervisor') }
|
|
|
+ ],
|
|
|
+ popContent:
|
|
|
+ [
|
|
|
+ { code: 'whCode', type: 'str', title: mixins.$t('whCode'), required: false, readonly: true, },
|
|
|
+ { code: 'whName', type: 'str', title: mixins.$t('whName'), required: true },
|
|
|
+ { code: 'supervisor', type: 'str', title: mixins.$t('supervisor'), required: true },
|
|
|
+ { code: 'contactPhone', type: 'str', title: mixins.$t('contactPhone'), required: true },
|
|
|
+ { code: 'remarks', type: 'str', title: mixins.$t('remarks'), required: false }
|
|
|
+ ],
|
|
|
+ sideKey: 0,
|
|
|
},
|
|
|
|
|
|
- dropdownSwitchCommit(e) {
|
|
|
- console.log(e)
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
- * @desc : 分类切换
|
|
|
+ * @desc : 设置pop字段
|
|
|
* @author : 于继渤
|
|
|
- * @date : 2022/5/26 20:16
|
|
|
+ * @date : 2024/1/23 9:16
|
|
|
*/
|
|
|
- changeSidebar(e) {
|
|
|
- console.log(e)
|
|
|
- let id = this.data.leftData[e.detail].id
|
|
|
- let name = this.data.leftData[e.detail].name
|
|
|
- console.log(name)
|
|
|
- let fieldList = this.data.fieldList
|
|
|
- let tableData = this.data.tableData
|
|
|
- let sidebarList = fieldList.filter(res => {
|
|
|
- return res.typeName == name
|
|
|
- })
|
|
|
- if (name == '仓库档案') {
|
|
|
- tableData = this.data.test00
|
|
|
+ setPopContent() {
|
|
|
+ let formDataName = this.data.formDataName
|
|
|
+ let popContent = this.data.popContent
|
|
|
+ let contentList = this.data.contentList
|
|
|
+ let routeObjNameGoTo = this.data.routeObjNameGoTo
|
|
|
+ if (formDataName == mixins.$t('warehouse')) {//仓库档案
|
|
|
+ //设置列表字段
|
|
|
+ contentList = [
|
|
|
+ { name: 'whCode', title: mixins.$t('whCode') },
|
|
|
+ { name: 'whName', title: mixins.$t('whName') },
|
|
|
+ { name: 'supervisor', title: mixins.$t('supervisor') }
|
|
|
+ ]
|
|
|
+ //设置新建编辑字段
|
|
|
+ popContent =
|
|
|
+ [
|
|
|
+ { code: 'whCode', type: 'str', title: mixins.$t('whCode'), required: false, readonly: true, },
|
|
|
+ { code: 'whName', type: 'str', title: mixins.$t('whName'), required: true },
|
|
|
+ { code: 'supervisor', type: 'str', title: mixins.$t('supervisor'), required: true },
|
|
|
+ { code: 'contactPhone', type: 'str', title: mixins.$t('contactPhone'), required: true },
|
|
|
+ { code: 'remarks', type: 'str', title: mixins.$t('remarks'), required: false }
|
|
|
+ ]
|
|
|
+ routeObjNameGoTo = 'warehouse'
|
|
|
}
|
|
|
- if (name == '销售渠道') {
|
|
|
- tableData = this.data.test01
|
|
|
+ if (formDataName == mixins.$t('saleChannel')) {
|
|
|
+ //设置列表字段
|
|
|
+ contentList = [
|
|
|
+ { name: 'channelCode', title: mixins.$t('channelCode') },
|
|
|
+ { name: 'channelName', title: mixins.$t('channelName') }
|
|
|
+ ]
|
|
|
+ popContent =
|
|
|
+ [
|
|
|
+ { code: 'channelCode', type: 'str', title: mixins.$t('channelCode'), required: false, readonly: true, },
|
|
|
+ { code: 'channelName', type: 'str', title: mixins.$t('channelName'), required: true },
|
|
|
+ { code: 'remarks', type: 'str', title: mixins.$t('remarks'), required: false }
|
|
|
+ ]
|
|
|
}
|
|
|
- if (name == '收入类别') {
|
|
|
- tableData = this.data.test02
|
|
|
- }
|
|
|
- if (name == '支出类别') {
|
|
|
- tableData = this.data.test03
|
|
|
- }
|
|
|
- if (name == '入库原因') {
|
|
|
- tableData = this.data.test04
|
|
|
- }
|
|
|
- if (name == '出库原因') {
|
|
|
- tableData = this.data.test05
|
|
|
- }
|
|
|
- if (name == '账户类别') {
|
|
|
- tableData = this.data.test06
|
|
|
- }
|
|
|
- if (name == '客户来源') {
|
|
|
- tableData = this.data.test07
|
|
|
- }
|
|
|
- if (name == '客户标签') {
|
|
|
- tableData = this.data.test08
|
|
|
- }
|
|
|
-
|
|
|
- this.setData({
|
|
|
- sideKey: e.detail,
|
|
|
- specsId: e.detail.id,
|
|
|
- fieldData: sidebarList[0],
|
|
|
- tableData: tableData
|
|
|
- })
|
|
|
+
|
|
|
this.setData({
|
|
|
- searchText: ''
|
|
|
+ contentList: contentList,
|
|
|
+ popContent: popContent,
|
|
|
+ routeObjNameGoTo: routeObjNameGoTo
|
|
|
})
|
|
|
- // 查询
|
|
|
- // this.doSearch()
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 启用停用
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 于继渤
|
|
|
+ */
|
|
|
+ deactivateEnable(e) {
|
|
|
+ let item = e.detail.item
|
|
|
+ let service = null
|
|
|
+ let id = null
|
|
|
+ if (this.data.formDataName == mixins.$t('warehouse')) {
|
|
|
+ service = this.data.warehouseService
|
|
|
+ id = 'whId'
|
|
|
+ }
|
|
|
+ if (this.data.formDataName == mixins.$t('saleChannel')) {
|
|
|
+ service = this.data.saleChannelService
|
|
|
+ id = 'channelId'
|
|
|
+ }
|
|
|
+
|
|
|
+ //执行接口
|
|
|
+ this.handleMoreDataIsValid(service, item, id)
|
|
|
},
|
|
|
/**
|
|
|
- * @desc : 左滑功能
|
|
|
+ * @desc : 分类切换
|
|
|
* @author : 于继渤
|
|
|
- * @date : 2024/1/23 9:16
|
|
|
+ * @date : 2022/5/26 20:16
|
|
|
*/
|
|
|
- onCloseDel(e) {
|
|
|
- console.log(e)
|
|
|
+ changeSidebar(e) {
|
|
|
+
|
|
|
+ let detail = e.detail
|
|
|
+ this.setData({
|
|
|
+ formDataName: this.data.sidebarList[detail].name
|
|
|
+ })
|
|
|
+ this.setPopContent();
|
|
|
+ this.searchData()
|
|
|
},
|
|
|
-
|
|
|
/**
|
|
|
* @desc : 列表对象点击
|
|
|
* @author : 于继渤
|
|
|
* @date : 2024/1/23 9:16
|
|
|
*/
|
|
|
toDetail(e) {
|
|
|
- console.log(e)
|
|
|
- let index = e.currentTarget.dataset.index
|
|
|
- let tableData = this.data.tableData
|
|
|
+ this.setPopContent();
|
|
|
+ let item = e.detail.item
|
|
|
this.setData({
|
|
|
- showPopup: true,
|
|
|
- showPopupItem: tableData[index]
|
|
|
+ popContent: this.data.popContent,
|
|
|
+ showPop: true,
|
|
|
+ dataItem: JSON.stringify(item)
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
- * @desc : 关闭弹窗
|
|
|
+ * @desc : 新建
|
|
|
* @author : 于继渤
|
|
|
* @date : 2024/1/23 9:16
|
|
|
*/
|
|
|
- onClosePopup() {
|
|
|
- this.setData({
|
|
|
- showPopup: false
|
|
|
- })
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 新建
|
|
|
- * @author : 于继渤
|
|
|
- * @date : 2024/1/23 9:16
|
|
|
- */
|
|
|
toAdd() {
|
|
|
+ this.setPopContent();
|
|
|
this.setData({
|
|
|
- showPopupItem: {},
|
|
|
- showPopup: true
|
|
|
+ dataItem: null,
|
|
|
+ formData: null,
|
|
|
+ showPop: true,
|
|
|
})
|
|
|
+
|
|
|
},
|
|
|
+ /**
|
|
|
+ * @desc : 加载数据
|
|
|
+ * @author : 于继渤
|
|
|
+ * @date : 2024/1/23 9:16
|
|
|
+ */
|
|
|
+ getData(params) {
|
|
|
+ if (this.data.formDataName == mixins.$t('warehouse')) { //仓库档案
|
|
|
+ return this.excute(this.data.warehouseService, this.data.warehouseService.selectByCond, params);
|
|
|
+ } else if (this.data.formDataName == mixins.$t('saleChannel')) { //销售渠道
|
|
|
+ return this.excute(this.data.saleChannelService, this.data.saleChannelService.selectByCond, params);
|
|
|
+ }
|
|
|
|
|
|
+ },
|
|
|
/**
|
|
|
- * 生命周期函数--监听页面加载
|
|
|
- */
|
|
|
- onLoad(options) {
|
|
|
- let _this = this;
|
|
|
- wx.getSystemInfo({
|
|
|
- success: function (res) {
|
|
|
- _this.setData({
|
|
|
- windowHeight: res.windowHeight,
|
|
|
- windowWidth: res.windowWidth
|
|
|
- })
|
|
|
- }
|
|
|
+ * @desc : 处理接口返回数据
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 于继渤
|
|
|
+ */
|
|
|
+ handleSearchData(tableData) {
|
|
|
+
|
|
|
+ tableData.forEach(res => {
|
|
|
+ res.listItemTitle = this.data.formDataName
|
|
|
})
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- let leftData = [
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- name: '仓库档案'
|
|
|
- },
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- name: '销售渠道'
|
|
|
- },
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- name: '收入类别'
|
|
|
- },
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- name: '支出类别'
|
|
|
- },
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- name: '入库原因'
|
|
|
- },
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- name: '出库原因'
|
|
|
- },
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- name: '账户类别'
|
|
|
- },
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- name: '客户来源'
|
|
|
- },
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- name: '客户标签'
|
|
|
- },
|
|
|
-
|
|
|
- ]
|
|
|
- let tableData = this.data.test00
|
|
|
this.setData({
|
|
|
- leftData: leftData,
|
|
|
- tableData: tableData,
|
|
|
- listTitle: leftData[0].name,
|
|
|
- fieldData: this.data.fieldList[0]
|
|
|
-
|
|
|
+ tableData: tableData
|
|
|
})
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面初次渲染完成
|
|
|
- */
|
|
|
- onReady() {
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
- * 生命周期函数--监听页面显示
|
|
|
+ * @desc : 新建编辑事件
|
|
|
+ * @author : 于继渤
|
|
|
+ * @date : 2024/1/26 11:46
|
|
|
*/
|
|
|
- onShow() {
|
|
|
-
|
|
|
+ editItems(e) {
|
|
|
+ let data = e.detail.form
|
|
|
+ this.setData({
|
|
|
+ formData: JSON.stringify(data)
|
|
|
+ })
|
|
|
+ //执行保存编辑操作
|
|
|
+ this.save({})
|
|
|
},
|
|
|
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面隐藏
|
|
|
- */
|
|
|
- onHide() {
|
|
|
-
|
|
|
- },
|
|
|
|
|
|
/**
|
|
|
- * 生命周期函数--监听页面卸载
|
|
|
+ * @desc : 保存编辑
|
|
|
+ * @author : 于继渤
|
|
|
+ * @date : 2022/5/26 20:16
|
|
|
*/
|
|
|
- onUnload() {
|
|
|
+ saveData(params) {
|
|
|
+ let id = null
|
|
|
+ let service = null
|
|
|
+ if (this.data.formDataName == mixins.$t('warehouse')) { //仓库档案
|
|
|
+ service = this.data.warehouseService
|
|
|
+ id = params.whId
|
|
|
+ }
|
|
|
+ if (this.data.formDataName == mixins.$t('saleChannel')) { //销售渠道
|
|
|
+ service = this.data.saleChannelService
|
|
|
+ id = params.channelId
|
|
|
+ }
|
|
|
+ if (id) { //编辑
|
|
|
+ return this.excute(service, service.update, params);
|
|
|
+ } else { //新建
|
|
|
+ return this.excute(service, service.insert, params);
|
|
|
+ }
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
- * 页面相关事件处理函数--监听用户下拉动作
|
|
|
+ * 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
- onPullDownRefresh() {
|
|
|
-
|
|
|
- },
|
|
|
+ onLoad(options) {
|
|
|
+ let _this = this;
|
|
|
+ wx.getSystemInfo({
|
|
|
+ success: function (res) {
|
|
|
+ _this.setData({
|
|
|
+ windowHeight: res.windowHeight,
|
|
|
+ windowWidth: res.windowWidth
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
- /**
|
|
|
- * 页面上拉触底事件的处理函数
|
|
|
- */
|
|
|
- onReachBottom() {
|
|
|
|
|
|
},
|
|
|
|
|
|
- /**
|
|
|
- * 用户点击右上角分享
|
|
|
- */
|
|
|
- onShareAppMessage() {
|
|
|
|
|
|
- }
|
|
|
})
|