|
|
@@ -7,684 +7,139 @@
|
|
|
* 作者 日期 版本 修改内容
|
|
|
* 于继渤 2022-5-25 1.00 新建
|
|
|
*******************************************************************************/
|
|
|
-import Dialog from '../../../../dist/dialog/dialog.js';
|
|
|
-const util = require('../../../../utils/util.js')
|
|
|
-const api = require('../../../../utils/api.js')
|
|
|
-const Constants = require('../../../../utils/Constants.js')
|
|
|
-const config = require('../../../../config/config.js')
|
|
|
-const common = require('../../../../utils/common');
|
|
|
+
|
|
|
+const Constants = require('@/utils/Constants.js');
|
|
|
+import Dialog from '@/dist/dialog/dialog.js';
|
|
|
+const mixins = require('@/mixins/index.js')
|
|
|
const app = getApp()
|
|
|
Page({
|
|
|
-
|
|
|
+ mixins: [mixins],
|
|
|
/**
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
- CustomerRefundFlag: false,
|
|
|
- activeNamese: [
|
|
|
- "1"
|
|
|
- ],
|
|
|
- customList: [
|
|
|
- {
|
|
|
- "number": 0,
|
|
|
- "text": "请选择"
|
|
|
- }
|
|
|
- ],
|
|
|
- fileList: [],
|
|
|
- form: {
|
|
|
- "balanceAmount": 0,
|
|
|
- "customerForm": {
|
|
|
- "addressName": "",
|
|
|
- "addressNo": "",
|
|
|
- "ageComposition": null,
|
|
|
- "ageCompositionName": "",
|
|
|
- "deliveryPhone": null,
|
|
|
- "customerCode": "",
|
|
|
- "customerFrom": null,
|
|
|
- "customerFromName": "",
|
|
|
- "customerName": "",
|
|
|
- "decisionMaker": null,
|
|
|
- "decisionMakerName": "",
|
|
|
- "fitupStyle": null,
|
|
|
- "fitupStyleName": "",
|
|
|
- "fitupType": null,
|
|
|
- "fitupTypeName": "",
|
|
|
- "houseType": null,
|
|
|
- "houseTypeName": "",
|
|
|
- "pice": 0,
|
|
|
- "toiletCount": null,
|
|
|
- "toiletCountName": ""
|
|
|
- },
|
|
|
- "designGraphics": false,
|
|
|
- "feeItemAmount": 0,
|
|
|
- "refundAccount": "",
|
|
|
- "remarks": "",
|
|
|
- "settlementAmount": 0,
|
|
|
- "sreceiptId": "",
|
|
|
- "sreceiptNo": "",
|
|
|
- "sumAmount": 0,
|
|
|
- "sumRefundAmount": 0,
|
|
|
- "sumTempAmount": 0
|
|
|
- },
|
|
|
- loading: false,
|
|
|
- orderINFO: {
|
|
|
- "receivable": 0,
|
|
|
- "sumAmount": 0
|
|
|
- },
|
|
|
- orgItem: {
|
|
|
- "code": "",
|
|
|
- "text": "北海富安居店",
|
|
|
- "value": 32402
|
|
|
- },
|
|
|
- receiptList: [
|
|
|
- {
|
|
|
- "settlementAmonut": 0,
|
|
|
- "settlementName": ""
|
|
|
- }
|
|
|
+ cardList: [
|
|
|
+ { name: 'main', title: mixins.$t("customerInformation") },
|
|
|
+
|
|
|
],
|
|
|
- salesChannelItem: {
|
|
|
- "code": "",
|
|
|
- "text": "零售",
|
|
|
- "value": 1
|
|
|
- },
|
|
|
- selectTotallength: "0",
|
|
|
- selectlength: "0",
|
|
|
- staffItem: {
|
|
|
- "code": null,
|
|
|
- "text": "王英杰",
|
|
|
- "value": 643
|
|
|
- },
|
|
|
- },
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面加载
|
|
|
- */
|
|
|
- onLoad: function (options) { },
|
|
|
- //获取客户信息
|
|
|
+ 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('adddressFull'), required: false },
|
|
|
+ { code: 'amountCollected', type: 'number', title: mixins.$t("amountCollected"), readonly: false },
|
|
|
+
|
|
|
+ { code: 'sourceOrder', name: 'sourceOrder', type: 'drop', required: false, dropType: 'sourceOrder', title: mixins.$t('sourceOrder') },
|
|
|
+ { code: 'remarks', type: 'textarea', title: mixins.$t("remarks"), readonly: false },
|
|
|
+ { code: 'file', type: 'uploader', title: mixins.$t("uploader") }
|
|
|
+ ],
|
|
|
|
|
|
- getCustomerDetail(param) {
|
|
|
- this.setData({
|
|
|
- loading: true
|
|
|
- })
|
|
|
- param.cpId = app.globalData.user.cpId
|
|
|
- api.request(Constants.SALE_CUSTOMER_API + 'select_customer_detail_phone', 'POST', param).then(res => {
|
|
|
- this.setData({
|
|
|
- loading: false
|
|
|
- })
|
|
|
- if (res.data.code === 200) {
|
|
|
- let item = res.data.data
|
|
|
- if (item) {
|
|
|
- let form = this.data.form
|
|
|
- form.customerForm.customerId = item.customerId
|
|
|
- form.customerForm.customerName = item.customerName
|
|
|
- form.customerForm.customerPhone = item.customerPhone
|
|
|
- form.customerForm.addressName = item.addressName
|
|
|
- form.customerForm.addressNo = item.addressNo
|
|
|
- form.customerForm.addressGcj02 = item.addressGcj02
|
|
|
- form.customerForm.addressArea = item.addressArea
|
|
|
- form.customerForm.addressFull = item.addressFull
|
|
|
- form.customerForm.address = item.addressFull
|
|
|
- form.customerForm.deliveryPhone = item.deliveryPhone ? item.deliveryPhone : item.customerPhone
|
|
|
- form.customerForm.customerFrom = item.customerFrom
|
|
|
- form.customerForm.decisionMaker = item.decisionMaker
|
|
|
- form.customerForm.fitupStyle = item.fitupStyle
|
|
|
- form.customerForm.fitupType = item.fitupType
|
|
|
- form.customerForm.houseType = item.houseType
|
|
|
- form.customerForm.toiletCount = item.toiletCount
|
|
|
- form.customerForm.ageComposition = item.ageComposition
|
|
|
- form.customerForm.customerFromName = item.customerFromName
|
|
|
- form.customerForm.decisionMakerName = item.decisionMakerName
|
|
|
- form.customerForm.fitupStyleName = item.fitupStyleName
|
|
|
- form.customerForm.fitupTypeName = item.fitupTypeName
|
|
|
- form.customerForm.houseTypeName = item.houseTypeName
|
|
|
- form.customerForm.toiletCountName = item.toiletCountName
|
|
|
- form.customerForm.ageCompositionName = item.ageCompositionName
|
|
|
- form.customerForm.estateName = item.estateName
|
|
|
- form.customerForm.estateId = item.estateId
|
|
|
- this.setData({
|
|
|
- form: form
|
|
|
- })
|
|
|
- }
|
|
|
+ },
|
|
|
+ buttonSaveList: [{ code: 'add', title: mixins.$t("collection"), color: '#CAA977' }],
|
|
|
+ contentSaveList: [{ code: 'need', title: mixins.$t("saleCollection"), type: 'str' }, { code: 'amount', content: 2000, type: 'number' }],
|
|
|
+ routeObjName: 'cusReceiptPayment',
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 选择回调
|
|
|
+ * @author : 于继渤
|
|
|
+ * @date : 2024/1/26 11:46
|
|
|
+ */
|
|
|
+ chooseData(e) {
|
|
|
+ console.log('eee1', e);
|
|
|
+ let item = e.detail.data
|
|
|
+ let code = e.detail.code
|
|
|
+ let formData = JSON.parse(this.data.formData)
|
|
|
+ //设置客户信息
|
|
|
+ if (code == 'cusName') {
|
|
|
+ formData.cusCode = item.cusCode
|
|
|
+ formData.cusId = item.cusId
|
|
|
+ formData.cusName = item.cusName
|
|
|
+ formData.cusPhone = item.cusPhone
|
|
|
+ formData.cusFromName = item.cusFromName
|
|
|
+ formData.cusFrom = item.cusFrom
|
|
|
+ //处理地址
|
|
|
+ formData.address = {
|
|
|
+ address: item.addressFull,
|
|
|
+ addressFull: item.addressFull,
|
|
|
+ addressArea: item.addressArea,
|
|
|
+ addressGcj02: item.addressGcj02,
|
|
|
+ addressName: item.addressName,
|
|
|
}
|
|
|
- })
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 销售价格编辑
|
|
|
- * @author : 常皓宁
|
|
|
- * @date : 2022/5/31 14:45
|
|
|
- */
|
|
|
- changeSalesPriceField(e) {
|
|
|
- let form = this.data.form
|
|
|
- form.sumAmount = e.detail.value;
|
|
|
- this.setData({
|
|
|
- form
|
|
|
- })
|
|
|
- },
|
|
|
- /**
|
|
|
- * 退款账号数值改变监听
|
|
|
- */
|
|
|
- changeRefundAccountField(e) {
|
|
|
-
|
|
|
- let form = this.data.form
|
|
|
- form.refundAccount = e.detail;
|
|
|
- this.setData({
|
|
|
- form
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 上传方法
|
|
|
- * @author : 于继渤
|
|
|
- * @date : 2022/6/02 16:16
|
|
|
- */
|
|
|
- afterRead(event) {
|
|
|
- const _this = this;
|
|
|
- const {
|
|
|
- file
|
|
|
- } = event.detail;
|
|
|
- file.forEach(res => {
|
|
|
- // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
|
|
|
- wx.uploadFile({
|
|
|
- url: `${config.server_add}:${config.server_port}` + '/basic-server/file/upload',
|
|
|
- filePath: res.path,
|
|
|
- name: 'file',
|
|
|
- formData: {
|
|
|
- 'folder': 't_receipt/receipt'
|
|
|
- },
|
|
|
- header: {
|
|
|
- 'Authorization': 'Bearer ' + app.globalData.token
|
|
|
- },
|
|
|
- success(res) {
|
|
|
- res.data = JSON.parse(res.data)
|
|
|
- if (res.data.code === 200) {
|
|
|
- let arr = _this.data.fileList;
|
|
|
- arr.push({
|
|
|
- url: res.data.data.absolutelyPath,
|
|
|
- FilePath: res.data.data.relativePath,
|
|
|
- deletable: true
|
|
|
- })
|
|
|
- _this.setData({
|
|
|
- fileList: arr
|
|
|
- })
|
|
|
-
|
|
|
- }
|
|
|
- },
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 收款金额输入数量监听
|
|
|
- */
|
|
|
- changeSumAmount(e) {
|
|
|
- let orderINFO = this.data.orderINFO
|
|
|
- orderINFO.sumAmount = e.detail.value;
|
|
|
- this.setData({
|
|
|
- orderINFO
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 下拉多选确定
|
|
|
- * @author : 王英杰
|
|
|
- * @date : 2022/5/26 12:16
|
|
|
- */
|
|
|
- mutiSearchAll(e) {
|
|
|
- let id = e.currentTarget.id
|
|
|
- if (id === 'org') {
|
|
|
- this.setData({
|
|
|
- orgIds: e.detail.idList,
|
|
|
- orgFlag: false
|
|
|
- })
|
|
|
- // this.selectComponent("#statusItemOrg").toggle(false)
|
|
|
- this.doSearch()
|
|
|
+ formData.addressArea = item.addressArea
|
|
|
+ formData.addressFull = item.addressFull
|
|
|
+ formData.addressGcj02 = item.addressGcj02
|
|
|
+ formData.addressName = item.addressName
|
|
|
+ formData.addressNo = item.addressNo
|
|
|
+ //订单销售渠道 ,默认取的客户的渠道
|
|
|
+ formData.salesChannel = item.channelId
|
|
|
+ formData.channelId = item.channelId
|
|
|
+ formData.channelName = item.channelName
|
|
|
+ formData.contactPhone = item.contactPhone
|
|
|
+ formData.contactPhone = item.contactPhone
|
|
|
+ }
|
|
|
+ ///设置主从业务员
|
|
|
+ if (code == 'staff') {
|
|
|
+ formData.staff = item.staffItem
|
|
|
+ formData['staffId'] = item.staffMain.staffId
|
|
|
+ formData['staffName'] = item.staffMain.staffName
|
|
|
+ formData['staffList'] = item.staffList
|
|
|
+ console.log(item.staffList)
|
|
|
+ }
|
|
|
+ ///设置主从业务部门
|
|
|
+ if (code == 'org') {
|
|
|
+ console.log('item', item)
|
|
|
+ formData.org = item.orgItem
|
|
|
+ formData['orgId'] = item.orgMain.orgId
|
|
|
+ formData['orgName'] = item.orgMain.orgName
|
|
|
+ formData['orgList'] = item.orgList
|
|
|
}
|
|
|
- if (id === 'staff') {
|
|
|
- this.setData({
|
|
|
- staffIds: e.detail.idList,
|
|
|
- staffFlag: false
|
|
|
- })
|
|
|
- // this.selectComponent("#statusItemStaff").toggle(false)
|
|
|
- this.doSearch()
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 下拉多选关闭
|
|
|
- * @author : 于继渤
|
|
|
- * @date : 2022/5/26 12:16
|
|
|
- */
|
|
|
- muticloseAll(e) {
|
|
|
- let id = e.currentTarget.id
|
|
|
- if (id === 'org') {
|
|
|
- this.setData({
|
|
|
- orgFlag: false
|
|
|
- })
|
|
|
- this.selectComponent("#statusItemOrg").toggle(false)
|
|
|
- }
|
|
|
- if (id === 'staff') {
|
|
|
- this.setData({
|
|
|
- staffFlag: false
|
|
|
- })
|
|
|
- this.selectComponent("#statusItemStaff").toggle(false)
|
|
|
- }
|
|
|
- },
|
|
|
- /* 表单校验 */
|
|
|
- checkForm() {
|
|
|
-
|
|
|
- if (!this.data.staffItem.value) {
|
|
|
- return {
|
|
|
- flag: false,
|
|
|
- msg: '请选择业务员'
|
|
|
- };
|
|
|
- }
|
|
|
- if (!this.data.orgItem.value) {
|
|
|
- return {
|
|
|
- flag: false,
|
|
|
- msg: '请选择业务部门'
|
|
|
- };
|
|
|
- }
|
|
|
- if (!this.data.salesChannelItem.value) {
|
|
|
- return {
|
|
|
- flag: false,
|
|
|
- msg: '请选择销售渠道'
|
|
|
- };
|
|
|
- }
|
|
|
- if (!this.data.form.customerForm.customerId) {
|
|
|
- return {
|
|
|
- flag: false,
|
|
|
- msg: '请选择客户'
|
|
|
- };
|
|
|
- }
|
|
|
-
|
|
|
- return {
|
|
|
- flag: true,
|
|
|
- msg: '表单校验通过'
|
|
|
- }
|
|
|
- },
|
|
|
- /**
|
|
|
- * 备注
|
|
|
- * @param {*} e
|
|
|
- */
|
|
|
- changeRemarksField(e) {
|
|
|
- let form = this.data.form
|
|
|
- form.remarks = e.detail
|
|
|
this.setData({
|
|
|
- form
|
|
|
+ formData: JSON.stringify(formData)
|
|
|
})
|
|
|
- },
|
|
|
- /**
|
|
|
- * 保存
|
|
|
- */
|
|
|
- submit() {
|
|
|
-
|
|
|
- wx.navigateTo({
|
|
|
- url: '../../order-billing/collection-confirm/collection-confirm'
|
|
|
- })
|
|
|
-
|
|
|
- wx.navigateTo({
|
|
|
- url: '../customer-collection-confirm?type=' + type + "&customerForm=" + JSON.stringify(this.data.form.customerForm) +
|
|
|
- "&orderINFO=" + JSON.stringify(this.data.orderINFO) +
|
|
|
- "&staffID=" + this.data.staffItem.value +//员工
|
|
|
- "&staffCode=" + this.data.staffItem.code +//员工
|
|
|
- "&orgID=" + this.data.orgItem.value +// 部门
|
|
|
- "&orgCode=" + this.data.orgItem.code +// 部门
|
|
|
- "&salesChannelID=" + this.data.salesChannelItem.value + //渠道
|
|
|
- "&salesChannelName=" + this.data.salesChannelItem.text + //渠道
|
|
|
- "&sreceiptId=" + formInfo.sreceiptId +//原单id
|
|
|
- "&sreceiptNo=" + formInfo.sreceiptNo +//原单单号
|
|
|
- "&formInfo=" + JSON.stringify(formInfo) +
|
|
|
- "&refundAccount=" + formInfo.refundAccount +
|
|
|
- "&remarks=" + formInfo.remarks +
|
|
|
- "&fileList=" + JSON.stringify(this.data.fileList) + // 图片
|
|
|
- "&editTime=" + this.data.orderINFO.editTime + // 图片
|
|
|
- "&receiptId=" + receiptId +
|
|
|
- "&moneySynchroType=1" +'&orgId='+this.data.orgItem.value
|
|
|
- })
|
|
|
-
|
|
|
- },
|
|
|
- /**
|
|
|
- * 删除图片
|
|
|
- */
|
|
|
- deleteImg(e) {
|
|
|
- let index = e.detail.index;
|
|
|
- let arr = this.data.fileList;
|
|
|
- arr.splice(index, 1);
|
|
|
- this.setData({
|
|
|
- fileList: arr
|
|
|
- })
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 客户费用合计
|
|
|
- * @author : 于继渤
|
|
|
- * @date : 2022/5/24 12:16
|
|
|
- */
|
|
|
- totalCustomerFees() {
|
|
|
- let customList = this.data.customList
|
|
|
- let feeListSum = 0
|
|
|
- customList.forEach(res => {
|
|
|
- feeListSum += parseFloat(res.number ? res.number : 0)
|
|
|
- })
|
|
|
-
|
|
|
- return feeListSum.toFixed(2)
|
|
|
|
|
|
},
|
|
|
|
|
|
- /**
|
|
|
- * @desc : 组件单选下拉打开事件
|
|
|
- * @author : 于继渤
|
|
|
- * @date : 2022/5/26 17:16
|
|
|
- */
|
|
|
- openSingle(e) {
|
|
|
- // let type = e.currentTarget.dataset.type
|
|
|
-
|
|
|
- if (e.detail.currentTarget) {
|
|
|
- let type_one = e.detail.currentTarget.dataset.type
|
|
|
- if (type_one === 'settlement') {
|
|
|
- let index = e.detail.currentTarget.dataset.index
|
|
|
- this.setData({
|
|
|
- settlementIndex: index,
|
|
|
- settlementFlag: true
|
|
|
- })
|
|
|
- }
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 组件单选确定
|
|
|
- * @author : 于继渤
|
|
|
- * @date : 2022/5/26 17:16
|
|
|
- */
|
|
|
- mutiSearch(e) {
|
|
|
- let id = e.target.id
|
|
|
- if (id === 'settlement') {
|
|
|
- let settlementIndex = this.data.settlementIndex
|
|
|
- let customList = this.data.customList
|
|
|
- customList[settlementIndex].text = e.detail.name
|
|
|
- customList[settlementIndex].id = e.detail.id
|
|
|
- this.setData({
|
|
|
- customList: customList
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 客户收款费用明细组件输入事件删
|
|
|
- * @author : 于继渤
|
|
|
- * @date : 2022/6/02 12:16
|
|
|
- */
|
|
|
- changeSettlementFeeField(e) {
|
|
|
- let key = e.currentTarget.dataset.key
|
|
|
- let customList = this.data.customList
|
|
|
- let index = e.detail.index
|
|
|
- let number = e.detail.number
|
|
|
- let form = this.data.form
|
|
|
- if (key === 'settlement') {
|
|
|
- customList[index].number = number
|
|
|
- //调用计算费用总计函数
|
|
|
- form.settlementAmount = this.totalCustomerFees()
|
|
|
- }
|
|
|
- this.setData({
|
|
|
- form: form,
|
|
|
-
|
|
|
- customList: customList
|
|
|
- })
|
|
|
-
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 结算方式添加数据
|
|
|
- * @author : 于继渤
|
|
|
- * @date : 2022/5/26 12:16
|
|
|
- */
|
|
|
- addItem_settlement() {
|
|
|
- let customList = this.data.customList;
|
|
|
- customList.push({
|
|
|
- text: '请选择',
|
|
|
- number: 0.00
|
|
|
- })
|
|
|
- this.setData({
|
|
|
- customList: customList
|
|
|
- })
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 客户收款删除事件
|
|
|
- * @author : 于继渤
|
|
|
- * @date : 2022/5/26 12:16
|
|
|
- */
|
|
|
- del(e) {
|
|
|
- let index = e.detail;
|
|
|
- let key = e.currentTarget.dataset.key
|
|
|
|
|
|
- if (key === 'settlement') {
|
|
|
|
|
|
- let customList = this.data.customList;
|
|
|
- customList.splice(index, 1)
|
|
|
- this.setData({
|
|
|
- customList: customList
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 下拉打开事件
|
|
|
- * @author : 于继渤
|
|
|
- * @date : 2022/5/26 12:16
|
|
|
- */
|
|
|
- openSalesChannelDropdown(e) {
|
|
|
- this.setData({
|
|
|
- salesChannelFlag: true
|
|
|
- })
|
|
|
- },
|
|
|
|
|
|
/**
|
|
|
- * @desc : 下拉单选确认事件
|
|
|
- * @author : 于继渤
|
|
|
- * @date : 2022/5/26 12:16
|
|
|
- */
|
|
|
- singleSearchAll(e) {
|
|
|
- let id = e.currentTarget.id
|
|
|
- let salesChannelItem = this.data.salesChannelItem
|
|
|
- let orgItem = this.data.orgItem
|
|
|
- let staffItem = this.data.staffItem
|
|
|
- if (id === 'salesChannel') {
|
|
|
- salesChannelItem.text = e.detail.name
|
|
|
- salesChannelItem.value = e.detail.id
|
|
|
- this.setData({
|
|
|
- salesChannelItem: salesChannelItem,
|
|
|
- salesChannelFlag: false
|
|
|
- })
|
|
|
- // this.selectComponent("#salesChannelItem").toggle(false)
|
|
|
+ * 生命周期函数--监听页面加载
|
|
|
+ */
|
|
|
+ loadInit() {
|
|
|
+ let formData = JSON.parse(this.data.formData)
|
|
|
+ formData['staff'] = {
|
|
|
+ text: app.globalData.user.staffName,
|
|
|
+ value: [app.globalData.user.staffId]
|
|
|
}
|
|
|
- if (id === 'org') {
|
|
|
- orgItem.text = e.detail.name
|
|
|
- orgItem.value = e.detail.id
|
|
|
- orgItem.code = e.detail.code
|
|
|
- salesChannelItem.text = e.detail.salesChannelName
|
|
|
- salesChannelItem.value = e.detail.salesChannel
|
|
|
- this.setData({
|
|
|
- orgItem: orgItem,
|
|
|
- salesChannelItem,
|
|
|
- orgFlag: false
|
|
|
- })
|
|
|
- this.selectComponent("#orgItem").toggle(false)
|
|
|
+ formData['org'] = {
|
|
|
+ text: app.globalData.user.orgName,
|
|
|
+ value: [app.globalData.user.orgId]
|
|
|
}
|
|
|
-
|
|
|
- if (id === 'staff') {
|
|
|
- staffItem.text = e.detail.name
|
|
|
- staffItem.value = e.detail.id
|
|
|
- staffItem.code = e.detail.code
|
|
|
- orgItem.text = e.detail.orgName
|
|
|
- orgItem.value = e.detail.orgId
|
|
|
- orgItem.code = e.detail.orgCode
|
|
|
- this.setData({
|
|
|
- orgItem: orgItem,
|
|
|
- staffItem: staffItem,
|
|
|
- staffFlag: false
|
|
|
- })
|
|
|
- this.selectComponent("#staffItem").toggle(false)
|
|
|
- }
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 跳转选择客户
|
|
|
- * @author : 于继渤
|
|
|
- * @date : 2022/5/26 12:16
|
|
|
- */
|
|
|
- onChooseCustomer() {
|
|
|
- wx.navigateTo({
|
|
|
- url: '../../choose-customer/choose-customer',
|
|
|
- })
|
|
|
- },
|
|
|
- /**
|
|
|
- * 跳转订单选择界面
|
|
|
- */
|
|
|
- chooseOrder() {
|
|
|
- if (!this.data.form.customerForm.customerId) {
|
|
|
- wx.showToast({
|
|
|
- title: "请选择客户",
|
|
|
- image: '/static/image/warning.png',
|
|
|
- duration: 1000
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- wx.navigateTo({
|
|
|
- url: '../relation-order/relation-order?customerId=' + this.data.form.customerForm.customerId,
|
|
|
- })
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 清除客户信息
|
|
|
- * @author : 于继渤
|
|
|
- * @date : 2022/5/26 12:16
|
|
|
- */
|
|
|
- onChooseCustomerClear() {
|
|
|
- let form = this.data.form
|
|
|
- form.customerForm = {
|
|
|
- orderNo: '',
|
|
|
- customerName: '', //客户姓名
|
|
|
- pice: 0, //预收款
|
|
|
- deliveryPhone: '',
|
|
|
- addressName: '',
|
|
|
- addressNo: '',
|
|
|
- //客户来源
|
|
|
- customerFrom: null,
|
|
|
- customerFromName: '',
|
|
|
- //卫生间数
|
|
|
- toiletCount: null,
|
|
|
- toiletCountName: '',
|
|
|
- //装修类型
|
|
|
- fitupType: null,
|
|
|
- fitupTypeName: '',
|
|
|
- //房屋类型
|
|
|
- houseType: null,
|
|
|
- houseTypeName: '',
|
|
|
- //装修风格
|
|
|
- fitupStyle: null,
|
|
|
- fitupStyleName: '',
|
|
|
- //年龄构成
|
|
|
- ageComposition: null,
|
|
|
- ageCompositionName: '',
|
|
|
- //决策者
|
|
|
- decisionMaker: null,
|
|
|
- decisionMakerName: '',
|
|
|
- }
|
|
|
- this.setData({
|
|
|
- form: form,
|
|
|
- orderINFO:{
|
|
|
- receivable:0,
|
|
|
- sumAmount:0
|
|
|
+ formData.orgId = app.globalData.user.orgId
|
|
|
+ formData.orgList = [
|
|
|
+ {
|
|
|
+ orgId: app.globalData.user.orgId,
|
|
|
+ orgName: app.globalData.user.orgName,
|
|
|
+ ownerFlag: true,
|
|
|
+ allocationRatio: 100,
|
|
|
}
|
|
|
- })
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 下拉单选关闭事件
|
|
|
- * @author : 于继渤
|
|
|
- * @date : 2022/5/26 12:16
|
|
|
- */
|
|
|
- singleCloseAll(e) {
|
|
|
- let id = e.currentTarget.id
|
|
|
- if (id === 'salesChannel') {
|
|
|
- this.setData({
|
|
|
- salesChannelFlag: false
|
|
|
- })
|
|
|
- // this.selectComponent("#salesChannelItem").toggle(false)
|
|
|
- }
|
|
|
- this.selectComponent("#staffItem").toggle(false)
|
|
|
- this.selectComponent("#orgItem").toggle(false)
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 选择业务部门
|
|
|
- * @author : 于继渤
|
|
|
- * @date : 2022/5/26 12:16
|
|
|
- */
|
|
|
- openOrgDropdown() {
|
|
|
- this.setData({
|
|
|
- orgFlag: true
|
|
|
- })
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 选择业务员
|
|
|
- * @author : 于继渤
|
|
|
- * @date : 2022/5/26 12:16
|
|
|
- */
|
|
|
- openStaffDropdown() {
|
|
|
- this.setData({
|
|
|
- staffFlag: true
|
|
|
- })
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 加载数据
|
|
|
- * @author : 于继渤
|
|
|
- * @date : 2022/6/10 12:16
|
|
|
- */
|
|
|
- getsalesChanne() {
|
|
|
- this.setData({
|
|
|
- loading: true
|
|
|
- })
|
|
|
- let param = {}
|
|
|
- param.cpId = app.globalData.user.cpId
|
|
|
- param.orgId = app.globalData.user.orgId
|
|
|
- api.request(Constants.BASIC_COMMON_API + 'select_salechannel_by_org', 'POST', param).then(res => {
|
|
|
- this.setData({
|
|
|
- loading: false
|
|
|
- })
|
|
|
- if (res.data.code === 200) {
|
|
|
-
|
|
|
- let salesChannelItem = this.data.salesChannelItem
|
|
|
- salesChannelItem.text = res.data.data.salesChannelName
|
|
|
- salesChannelItem.value = res.data.data.salesChannel
|
|
|
- this.setData({
|
|
|
- salesChannelItem
|
|
|
- })
|
|
|
-
|
|
|
+ ]
|
|
|
+ formData.staffId = app.globalData.user.staffId
|
|
|
+ formData.staffList = [
|
|
|
+ {
|
|
|
+ staffId: app.globalData.user.staffId,
|
|
|
+ staffName: app.globalData.user.staffName,
|
|
|
+ ownerFlag: true,
|
|
|
+ allocationRatio: 100,
|
|
|
}
|
|
|
-
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- //获取来源单据
|
|
|
- getRefund() {
|
|
|
+ ]
|
|
|
this.setData({
|
|
|
- loading: true
|
|
|
+ formData: JSON.stringify(formData)
|
|
|
})
|
|
|
- let param = {}
|
|
|
- param.settlementTypeName = '微信(新)'//结算方式名称
|
|
|
- param.orderNo = ''//订单单号
|
|
|
- param.customerPhone = '13300006666'//客户电话
|
|
|
- param.organizationCode = '' //部门编码
|
|
|
- param.cpId = app.globalData.user.cpId
|
|
|
- api.request(Constants.SALE_ORDER_REFUND + 'select_refund', 'POST', param).then(res => {
|
|
|
- this.setData({
|
|
|
- loading: false
|
|
|
- })
|
|
|
|
|
|
- if (res.data.code === 200) {
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
},
|
|
|
-
|
|
|
})
|