|
|
@@ -19,13 +19,15 @@ Page({
|
|
|
cardList: [
|
|
|
{ name: 'main', title: mixins.$t("customerInformation") },
|
|
|
{ name: 'relation' },
|
|
|
- { name: 'items', title: mixins.$t("goodsDetail"),
|
|
|
- chooseGoodsFlag: false,
|
|
|
- chooseGoodsItemFlag: true,
|
|
|
- chooseInventoryFlag: true,
|
|
|
- chooseCoordinationFlag: true,
|
|
|
-
|
|
|
- itemAmt: '', displayNum: 2, controls: [{ card: 'relation', code: 'fromNo' }], },
|
|
|
+ {
|
|
|
+ name: 'items', title: mixins.$t("goodsDetail"),
|
|
|
+ chooseGoodsFlag: false,
|
|
|
+ chooseGoodsItemFlag: true,
|
|
|
+ chooseInventoryFlag: true,
|
|
|
+ chooseCoordinationFlag: true,
|
|
|
+
|
|
|
+ itemAmt: '', displayNum: 2, controls: [{ card: 'relation', code: 'fromNo' }],
|
|
|
+ },
|
|
|
{ name: 'other', title: mixins.$t("otherInfo") },
|
|
|
|
|
|
],
|
|
|
@@ -211,11 +213,11 @@ Page({
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- /**
|
|
|
- * @desc : 自定义保存参数
|
|
|
- * @date : 2024/2/1 15:49
|
|
|
- * @author : 于继渤
|
|
|
- */
|
|
|
+ /**
|
|
|
+ * @desc : 自定义保存参数
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 于继渤
|
|
|
+ */
|
|
|
handleSaveData() {
|
|
|
let formData = {}
|
|
|
//设置显示
|
|
|
@@ -595,7 +597,7 @@ Page({
|
|
|
if (code == 'channelId') {
|
|
|
formData.channelId = e.detail.data.data.id
|
|
|
formData.channelCode = e.detail.data.data.code
|
|
|
- formData.channelName = e.detail.data.data.name
|
|
|
+ formData.channelName = e.detail.data.data.name
|
|
|
}
|
|
|
//客户来源
|
|
|
if (code == 'cusFrom') {
|
|
|
@@ -674,9 +676,9 @@ Page({
|
|
|
|
|
|
//详情 办理
|
|
|
if (this.data.formMode == Constants.formMode.add) {
|
|
|
- if(contentSaveList.length == 1){
|
|
|
+ if (contentSaveList.length == 1) {
|
|
|
contentSaveList[0].content = formData.sumAmount
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
contentSaveList[1].content = formData.sumAmount
|
|
|
}
|
|
|
} else {
|
|
|
@@ -723,16 +725,34 @@ Page({
|
|
|
let buttonSaveList = this.data.buttonSaveList
|
|
|
let contentSaveList = this.data.contentSaveList
|
|
|
let popContent = this.data.popContent
|
|
|
- contentObj.main = [
|
|
|
- { code: 'cusName', type: 'str', readonly: true, required: false, title: mixins.$t('customerName') },
|
|
|
- { code: 'cusPhone', type: 'str', readonly: true, required: false, title: mixins.$t('cusPhone') },
|
|
|
- { code: 'addressFull', type: 'str', readonly: true, required: false, title: mixins.$t('addressFull') },
|
|
|
- { code: 'addressNo', type: 'str', readonly: true, required: false, title: mixins.$t('addressNo') },
|
|
|
- { code: 'channelName', type: 'str', readonly: true, required: false, title: mixins.$t('saleChannel') },
|
|
|
- { code: 'cusFromName', type: 'str', readonly: true, required: false, title: mixins.$t('customerSource') },
|
|
|
- { code: 'contactName', type: 'str', readonly: true, title: mixins.$t('contactName') },
|
|
|
- { code: 'contactPhone', type: 'str', readonly: true, title: mixins.$t('cpPhone'), },
|
|
|
- ]
|
|
|
+
|
|
|
+ // let contentObj = this.data.contentObj
|
|
|
+ if (this.data.gradeCode == Constants.gradeCode.STD) {
|
|
|
+ contentObj.main = [
|
|
|
+ { code: 'cusName', type: 'str', readonly: true, required: false, title: mixins.$t('customerName') },
|
|
|
+ { code: 'cusPhone', type: 'str', readonly: true, required: false, title: mixins.$t('cusPhone') },
|
|
|
+ { code: 'addressFull', type: 'str', readonly: true, required: false, title: mixins.$t('addressFull') },
|
|
|
+ { code: 'addressNo', type: 'str', readonly: true, required: false, title: mixins.$t('addressNo') },
|
|
|
+ { code: 'channelName', type: 'str', readonly: true, required: false, title: mixins.$t('saleChannel') },
|
|
|
+ { code: 'contactName', type: 'str', readonly: true, title: mixins.$t('contactName') },
|
|
|
+ { code: 'contactPhone', type: 'str', readonly: true, title: mixins.$t('cpPhone'), },
|
|
|
+ ]
|
|
|
+ } else if (this.data.gradeCode == Constants.gradeCode.PRO) {
|
|
|
+ contentObj.main = [
|
|
|
+ { code: 'cusName', type: 'str', readonly: true, required: false, title: mixins.$t('customerName') },
|
|
|
+ { code: 'cusPhone', type: 'str', readonly: true, required: false, title: mixins.$t('cusPhone') },
|
|
|
+ { code: 'addressFull', type: 'str', readonly: true, required: false, title: mixins.$t('addressFull') },
|
|
|
+ { code: 'addressNo', type: 'str', readonly: true, required: false, title: mixins.$t('addressNo') },
|
|
|
+ { code: 'channelName', type: 'str', readonly: true, required: false, title: mixins.$t('saleChannel') },
|
|
|
+ { code: 'cusFromName', type: 'str', readonly: true, required: false, title: mixins.$t('customerSource') },
|
|
|
+ { code: 'contactName', type: 'str', readonly: true, title: mixins.$t('contactName') },
|
|
|
+ { code: 'contactPhone', type: 'str', readonly: true, title: mixins.$t('cpPhone'), },
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ contentObj: contentObj
|
|
|
+ })
|
|
|
+
|
|
|
contentObj.relation = [{
|
|
|
code: 'fromNo',
|
|
|
type: 'str',
|
|
|
@@ -799,6 +819,7 @@ Page({
|
|
|
} else if (this.data.formMode == Constants.formMode.add) { //新建
|
|
|
//设置显示
|
|
|
this.setFlagView()
|
|
|
+ this.setStdAndPro()
|
|
|
//处理默认值 业务员业务部门
|
|
|
formData = this.setStaffOrg(formData)
|
|
|
// 设置送货日期 当前日期 加一天
|
|
|
@@ -821,6 +842,7 @@ Page({
|
|
|
})
|
|
|
//设置显示
|
|
|
this.setFlagView()
|
|
|
+ this.setStdAndPro()
|
|
|
if (app.globalData.company.gradeCode == Constants.gradeCode.STD) {
|
|
|
this.setData({
|
|
|
checkFlag: true
|
|
|
@@ -833,7 +855,36 @@ Page({
|
|
|
formData: JSON.stringify(formData)
|
|
|
})
|
|
|
},
|
|
|
+ setStdAndPro() {
|
|
|
+ let contentObj = this.data.contentObj
|
|
|
+ if (this.data.gradeCode == Constants.gradeCode.STD) {
|
|
|
+ contentObj.main = [
|
|
|
+ { code: 'cusName', type: 'selectIcon', urlKey: 'selectCustomers', required: true, readonly: false, title: mixins.$t('customerName') },
|
|
|
+ { code: 'cusPhone', type: 'phone', title: mixins.$t('cusPhone'), required: true },
|
|
|
+ { code: 'addressFull', type: 'address', title: mixins.$t('addressFull'), required: true },
|
|
|
+ { code: 'addressNo', type: 'str', required: true, title: mixins.$t('addressNo') },
|
|
|
+ { code: 'channelId', name: 'channelName', required: true, title: mixins.$t('saleChannel'), type: 'choose', urlKey: 'chooseChannel' },
|
|
|
+ // { code: 'cusFrom', name: 'cusFromName', required: true, title: mixins.$t('customerSource'), type: 'choose', urlKey: 'choosecusFrom' },
|
|
|
+ { code: 'contactName', type: 'str', required: false, title: mixins.$t('contactName') },
|
|
|
+ { code: 'contactPhone', type: 'str', title: mixins.$t('cpPhone'), required: false },
|
|
|
+ ]
|
|
|
+ } else if (this.data.gradeCode == Constants.gradeCode.PRO) {
|
|
|
+ contentObj.main = [
|
|
|
+ { code: 'cusName', type: 'selectIcon', urlKey: 'selectCustomers', required: true, readonly: false, title: mixins.$t('customerName') },
|
|
|
+ { code: 'cusPhone', type: 'phone', title: mixins.$t('cusPhone'), required: true },
|
|
|
+ { code: 'addressFull', type: 'address', title: mixins.$t('addressFull'), required: true },
|
|
|
+ { code: 'addressNo', type: 'str', required: true, title: mixins.$t('addressNo') },
|
|
|
+ { code: 'channelId', name: 'channelName', required: true, title: mixins.$t('saleChannel'), type: 'choose', urlKey: 'chooseChannel' },
|
|
|
+ { code: 'cusFrom', name: 'cusFromName', required: false, title: mixins.$t('customerSource'), type: 'choose', urlKey: 'choosecusFrom' },
|
|
|
+ { code: 'contactName', type: 'str', required: false, title: mixins.$t('contactName') },
|
|
|
+ { code: 'contactPhone', type: 'str', title: mixins.$t('cpPhone'), required: false },
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ contentObj: contentObj
|
|
|
+ })
|
|
|
|
|
|
+ },
|
|
|
/**
|
|
|
* @desc : 设置显示
|
|
|
* @date : 2024/2/1 15:49
|
|
|
@@ -843,7 +894,7 @@ Page({
|
|
|
let contentObj = this.data.contentObj
|
|
|
if (app.globalData.company.gradeCode == Constants.gradeCode.STD) {
|
|
|
contentObj.relation = []
|
|
|
- contentObj.main = [
|
|
|
+ contentObj.main = [
|
|
|
{ code: 'cusName', type: 'selectIcon', urlKey: 'selectCustomers', required: true, readonly: false, title: mixins.$t('customerName') },
|
|
|
{ code: 'cusPhone', type: 'phone', title: mixins.$t('cusPhone'), required: true },
|
|
|
{ code: 'addressFull', type: 'address', title: mixins.$t('addressFull'), required: true },
|
|
|
@@ -891,26 +942,26 @@ Page({
|
|
|
* @date : 2024/2/1 15:49
|
|
|
* @author : 于继渤
|
|
|
*/
|
|
|
- getDefChannel() {
|
|
|
- this.excute(this.data.saleChannelService, this.data.saleChannelService.selectByCond, {
|
|
|
- flgDefault: true
|
|
|
- }).then(res => {
|
|
|
- if (res.data.code == 200) {
|
|
|
- let formData = JSON.parse(this.data.formData)
|
|
|
- if (res.data.data.list && res.data.data.list.length > 0) {
|
|
|
- formData.channelId = res.data.data.list[0].channelId
|
|
|
- formData.channelName = res.data.data.list[0].channelName
|
|
|
- formData.channelCode = res.data.data.list[0].channelCode
|
|
|
+ getDefChannel() {
|
|
|
+ this.excute(this.data.saleChannelService, this.data.saleChannelService.selectByCond, {
|
|
|
+ flgDefault: true
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ let formData = JSON.parse(this.data.formData)
|
|
|
+ if (res.data.data.list && res.data.data.list.length > 0) {
|
|
|
+ formData.channelId = res.data.data.list[0].channelId
|
|
|
+ formData.channelName = res.data.data.list[0].channelName
|
|
|
+ formData.channelCode = res.data.data.list[0].channelCode
|
|
|
+ }
|
|
|
+ // formData.staffId = app.globalData.user.staffId
|
|
|
+ // formData.staffName = app.globalData.user.staffName
|
|
|
+ // formData.orgId = app.globalData.user.orgId
|
|
|
+ // formData.orgName = app.globalData.user.orgName
|
|
|
+ //设置默认值
|
|
|
+ this.setData({
|
|
|
+ formData: JSON.stringify(formData)
|
|
|
+ })
|
|
|
}
|
|
|
- // formData.staffId = app.globalData.user.staffId
|
|
|
- // formData.staffName = app.globalData.user.staffName
|
|
|
- // formData.orgId = app.globalData.user.orgId
|
|
|
- // formData.orgName = app.globalData.user.orgName
|
|
|
- //设置默认值
|
|
|
- this.setData({
|
|
|
- formData: JSON.stringify(formData)
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
-},
|
|
|
+ })
|
|
|
+ },
|
|
|
})
|