|
|
@@ -35,8 +35,7 @@ Page({
|
|
|
{ code: 'channelId', name: 'channelName', required: true, title: mixins.$t('saleChannel'), type: 'choose', urlKey: 'chooseChannel' },
|
|
|
{ code: 'staffId', name: 'staffName', type: 'choose', required: true, title: mixins.$t('saleStaff'), urlKey: 'chooseStaff' },
|
|
|
{ code: 'orgId', name: 'orgName', type: 'choose', required: true, title: mixins.$t('saleOrg'), urlKey: 'chooseOrg' },
|
|
|
- { code: 'initialPaymentId', name: 'initialPayment', type: 'choose', title: mixins.$t('initialPayment'), urlKey: 'chooseInitialPaymentType' },
|
|
|
- // { code: 'startAmount', type: 'number', required: false, title: '初始欠款' },
|
|
|
+ { code: 'initialPaymentId', name: 'initialPayment', type: 'choose', title: mixins.$t('initialPayment'), urlKey: 'chooseInitialPaymentType' },
|
|
|
],
|
|
|
remarks: [
|
|
|
{ code: 'remarks', type: 'textarea', title: mixins.$t('remarks') }
|
|
|
@@ -50,12 +49,12 @@ Page({
|
|
|
* @author : 于继渤
|
|
|
*/
|
|
|
chooseData(e) {
|
|
|
-
|
|
|
+
|
|
|
let formData = JSON.parse(this.data.formData)
|
|
|
let code = e.detail.code
|
|
|
let data = e.detail.data.data
|
|
|
|
|
|
- console.log(code,data);
|
|
|
+ console.log(code, data);
|
|
|
|
|
|
if (code == "staffId") { //员工
|
|
|
formData.staffId = data.id
|
|
|
@@ -77,10 +76,49 @@ Page({
|
|
|
formData.cusFromCode = data.code
|
|
|
formData.cusFromName = data.name
|
|
|
}
|
|
|
+ //客户来源
|
|
|
+ if (code == 'macId') {
|
|
|
+ formData.macId = data.id
|
|
|
+ formData.macCode = data.code
|
|
|
+ formData.macName = data.name
|
|
|
+ }
|
|
|
//初始款项
|
|
|
- if (code == "initialPaymentId") {
|
|
|
- formData.initialPaymentId = data.id
|
|
|
+ if (code == "initialPaymentId") {
|
|
|
+ formData.initialPaymentId = data.id
|
|
|
formData.initialPayment = data.name
|
|
|
+ let contentObj = this.data.contentObj;
|
|
|
+ // 初始款项-欠款
|
|
|
+ if (data.id == Constants.initialPayType.debt) {
|
|
|
+ contentObj.center = [
|
|
|
+ { code: 'channelId', name: 'channelName', required: true, title: mixins.$t('saleChannel'), type: 'choose', urlKey: 'chooseChannel' },
|
|
|
+ { code: 'staffId', name: 'staffName', type: 'choose', required: true, title: mixins.$t('saleStaff'), urlKey: 'chooseStaff' },
|
|
|
+ { code: 'orgId', name: 'orgName', type: 'choose', required: true, title: mixins.$t('saleOrg'), urlKey: 'chooseOrg' },
|
|
|
+ { code: 'initialPaymentId', name: 'initialPayment', type: 'choose', title: mixins.$t('initialPayment'), urlKey: 'chooseInitialPaymentType' },
|
|
|
+ { code: 'startAmount', type: 'number', required: true, title: mixins.$t('initialDebtOwed') },
|
|
|
+ ]
|
|
|
+
|
|
|
+ } else if (data.id == Constants.initialPayType.payment) {
|
|
|
+ // 初始款项-预收
|
|
|
+ contentObj.center = [
|
|
|
+ { code: 'channelId', name: 'channelName', required: true, title: mixins.$t('saleChannel'), type: 'choose', urlKey: 'chooseChannel' },
|
|
|
+ { code: 'staffId', name: 'staffName', type: 'choose', required: true, title: mixins.$t('saleStaff'), urlKey: 'chooseStaff' },
|
|
|
+ { code: 'orgId', name: 'orgName', type: 'choose', required: true, title: mixins.$t('saleOrg'), urlKey: 'chooseOrg' },
|
|
|
+ { code: 'initialPaymentId', name: 'initialPayment', type: 'choose', title: mixins.$t('initialPayment'), urlKey: 'chooseInitialPaymentType' },
|
|
|
+ { code: 'startAmount', type: 'number', required: true, title: mixins.$t('initialDebtOwed') },
|
|
|
+ { code: 'macId', name: 'macName', type: 'choose', required: true, title: mixins.$t('moneyAccount'), urlKey: 'chooseMoneyAccount' },
|
|
|
+ ]
|
|
|
+ } else {
|
|
|
+ // 初始款项-无
|
|
|
+ contentObj.center = [
|
|
|
+ { code: 'channelId', name: 'channelName', required: true, title: mixins.$t('saleChannel'), type: 'choose', urlKey: 'chooseChannel' },
|
|
|
+ { code: 'staffId', name: 'staffName', type: 'choose', required: true, title: mixins.$t('saleStaff'), urlKey: 'chooseStaff' },
|
|
|
+ { code: 'orgId', name: 'orgName', type: 'choose', required: true, title: mixins.$t('saleOrg'), urlKey: 'chooseOrg' },
|
|
|
+ { code: 'initialPaymentId', name: 'initialPayment', type: 'choose', title: mixins.$t('initialPayment'), urlKey: 'chooseInitialPaymentType' },
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ contentObj: contentObj
|
|
|
+ })
|
|
|
}
|
|
|
this.setData({
|
|
|
formData: JSON.stringify(formData)
|
|
|
@@ -120,13 +158,13 @@ Page({
|
|
|
})
|
|
|
// 控制初始欠款不允许编辑
|
|
|
let contentObj = this.data.contentObj;
|
|
|
- let filters = contentObj.center.filter(it=>it.code == 'startAmount')
|
|
|
+ let filters = contentObj.center.filter(it => it.code == 'initialPaymentId')
|
|
|
|
|
|
- if(filters && filters.length > 0){
|
|
|
+ if (filters && filters.length > 0) {
|
|
|
filters[0].readonly = true;
|
|
|
}
|
|
|
this.setData({
|
|
|
- contentObj:contentObj
|
|
|
+ contentObj: contentObj
|
|
|
})
|
|
|
},
|
|
|
|