| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- const _Http = getApp().globalData.http;
- Page({
- data: {
- loading: false,
- disabled: true,
- form: [{
- label: "费用类型",
- error: false,
- errMsg: "",
- type: "option",
- optionNmae: "feestype",
- optionType: "radio", //复选 radio 单选
- value: "",
- placeholder: "选择类型",
- valueName: "feestype",
- checking: "base",
- required: true
- }, {
- label: "营销费用",
- error: false,
- errMsg: "",
- type: "digit",
- value: "",
- placeholder: "请填写金额",
- valueName: "amount",
- checking: "base",
- required: true
- }]
- },
- onLoad(options) {
- this.data.salesfeesdetail = JSON.parse(options.salesfeesdetail)
- },
- onConfirm({
- detail
- }) {
- this.setData({
- disabled: detail
- })
- },
- submit() {
- const salesfeesdetail = Object.assign(this.data.salesfeesdetail, this.selectComponent("#Form").submit());
- this.setData({
- loading: true
- })
- _Http.basic({
- "id": 20240629090604,
- "content": {
- "userid": wx.getStorageSync('userMsg').userid,
- salesfeesdetail
- }
- }).then(res => {
- this.setData({
- loading: false
- })
- console.log("新增费用明细", res)
- wx.showToast({
- title: res.msg == '成功' ? '新增成功' : res.msg,
- icon: "none",
- mask: res.msg == '成功'
- })
- if (res.msg != '成功') return;
- _Http.updateExpenseBreakdownList && _Http.updateExpenseBreakdownList();
- setTimeout(() => {
- wx.navigateBack()
- }, 800)
- })
- }
- })
|