add.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // package-basic-data/pages/test/add/add.js
  2. const mixins = require('@/mixins/index.js')
  3. const app = getApp()
  4. Page({
  5. mixins: [mixins],
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. cardList: ['main'],
  11. contentObj: {
  12. main: [{ code: 'staffId', name: 'staffName', type: 'drop', required: true, dropType: 'staff' }, { code: 'customerName', type: 'str', required: true },
  13. { code: 'telephone', type: 'phone', title: '客户电话', required: true }, { code: 'address', type: 'address', title: '客户地址', required: true }, { code: 'designStatus', type: 'checkbox', title: '设计制图' }, { code: 'collectAmount', type: 'number', title: '收款金额', required: true }, { code: 'remarks', type: 'textarea', title: '备注' }, { code: 'file', type: 'uploader', title: '附件' }]
  14. },
  15. // cardList: [{name:'main',title:'客户信息',expandFlag:true,infoCols:['telephone'],displayNum:2},{name:'relation'},{name:'items',title:'商品明细',displayNum:2,info:'(待入库)'},{name:'other',title:'其他信息'}],
  16. // contentObj: {
  17. // main: [{ code: 'staffId', name: 'staffName', type: 'choose', required: true, dropType: 'staff',urlKey:'follow' },
  18. // { code: 'telephone', type: 'phone', title: '客户电话', required: true }, { code: 'address', type: 'address', title: '客户地址', required: true }, { code: 'designStatus', type: 'switch', title: '设计制图' }],
  19. // items:[{ code: 'collectType', name: 'collectName', type: 'drop', required: true, dropType: 'collect' },{ code: 'collectAmount', type: 'number', title: '收款金额', required: true }],
  20. // relation:[{ code: 'invoice', type: 'choose',title:'关联源单'}],
  21. // other:[{ code: 'deliveryDate', type: 'date', title: '送货日期' },{ code: 'remarks', type: 'textarea', title: '备注',readonly:false },{ code: 'test1', type: 'str', title: '测试1' },{ code: 'test2', type: 'address', title: '测试2' },{ code: 'test3', type: 'phone', title: '测试3' }, { code: 'test4', type: 'number', title: '测试4' }, { code: 'test5', type: 'switch', title: '测试5' }, { code: 'test6', type: 'checkbox', title: '测试6`' },{ code: 'file', type: 'uploader', title: '附件' }]
  22. // },
  23. // 路由
  24. routeObjName: 'customer',
  25. },
  26. /**
  27. * @desc : 绑定数据
  28. * @author : 周兴
  29. * @date : 2024/1/26 11:46
  30. */
  31. chooseData(e) {
  32. },
  33. /**
  34. * 生命周期函数--监听页面加载
  35. */
  36. onLoad: function (options) {
  37. // 接收父页面传递的参数
  38. const eventChannel = this.getOpenerEventChannel()
  39. let _this = this;
  40. eventChannel.on('choose', function (data) {
  41. // 设置商品明细
  42. _this.selectComponent('#' + _this.data.formName).setGoods(data);
  43. })
  44. }
  45. })