123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- var util = require('../../../utils/util.js')
- const app = getApp();
- Page({
- data: {
- allDisabled:true,//有客户下拉时临时用来控制其他下拉不显示
- c_txt_Show:false,
- customerShow:false,
-
-
-
- id:"",
-
-
- rules: {
- remark: [{ required: true, message: '内容必填', trigger: 'blur' }],
-
- },
- // 新增/编辑
- create: {
- dialogStatus: '',
- temp: {
-
- payDate: '',
- remark: '',
- created: util.getToday(),
- id:"",
-
- },
-
- }
- },
- onLoad: function (options) {
- // 表单初始化
- wx.lin.initValidateForm(this)
-
- var id = options.id;
- this.setData({
- id:id,
- ['create.temp.id']:id
- })
-
-
- },
-
-
-
-
-
- //保存
- submit:function(e){
-
- var detail_value = e.detail.values
- var detail_errors = e.detail.errors
- var detail_errors = e.detail.errors
- console.log("detail_value",detail_value)
- console.log("create.temp",this.data.create.temp)
-
- const submit_data = Object.assign({}, this.data.create.temp, detail_value)
-
- console.log("保存发送:",submit_data)
-
-
- submit_data.createrId = app.globalData.g_createrId
- var send_data = {
- "name":"insertServiceFeedback",
- "page":1,"offset":1,
- "pagecount":1000,
- "returntype":"Map",
- "parammaps":{
- "serviceId":this.data.id,
- "createrId":app.globalData.g_createrId,
- "remark":submit_data.remark,
- }
- }
- console.log("send_data",JSON.stringify(send_data))
-
-
- //验证必填项是否为空
- if(submit_data.costStatus == ""){
- wx.showToast({title: '款项状态必填',icon: 'none',duration: 2000})
- } else {
- if( wx.getStorageSync('isLoading') == "true"){
- wx.showToast({
- title: '正在保存中,请稍等!',
- icon: 'none',
- duration: 2000
- })
- } else {
- util.postDataByName(send_data, this.getListSuccess)
- }
- }
- },
- getListSuccess: function (res) {
- console.log('table数据======>', res)
- if (res.msg !== 'fail') {
- wx.showToast({
- title: '保存成功',
- icon: 'success',
- duration: 2000,
- success: function(){
- setTimeout(() => {
- wx.redirectTo({ url:"../siteService/siteService"})
- }, 1500)
- }
- })
- } else {
- wx.showToast({
- title: '保存失败'+res.data,
- icon: 'error',
- duration: 2000,
- })
- }
- },
-
-
- onReady: function () {
- },
-
- onShow: function () {
- },
-
- onHide: function () {
- },
-
- onUnload: function () {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- },
-
- onShareAppMessage: function () {
- }
- })
|