| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- const _Http = getApp().globalData.http;
- let sa_projectid = 0;
- import {
- formatTime
- } from "../../../utils/getTime";
- Page({
- data: {
- disabled: true,
- loading: false
- },
- onLoad(options) {
- this.setData({
- form: [{
- label: "项目名称",
- error: false,
- errMsg: "",
- type: "number",
- value: options.projectname,
- placeholder: "项目名称",
- valueName: "projectname",
- checking: "base",
- required: true,
- disabled: true
- }, {
- label: "客户名称",
- error: false,
- errMsg: "",
- type: "route",
- url: "/packageA/select/setclient/select",
- value: "",
- params: {
- "id": 20221027143702,
- "content": {
- sa_projectid: options.sa_projectid,
- "pageSize": 20,
- "where": {
- "condition": "",
- }
- },
- },
- query: "&radio=true&idname=sys_enterpriseid",
- placeholder: "选择客户",
- valueName: "sys_enterpriseid",
- checking: "base",
- required: true
- }, {
- label: "有效期",
- error: false,
- errMsg: "",
- type: "dateRange",
- start: "",
- value: ["", ""],
- placeholder: ['生效日期', '截止日期'],
- valueName: "invaliddate",
- checking: "base",
- required: true
- }]
- })
- sa_projectid = options.sa_projectid;
- },
- /* 表单必填项是否完成 */
- onConfirm({
- detail
- }) {
- this.setData({
- disabled: detail
- })
- },
- cancel() {
- wx.showModal({
- title: '提示',
- content: '是否确定取消发起授权',
- complete: (res) => {
- if (res.confirm) wx.navigateBack()
- }
- })
- },
- preview() {
- let data = this.selectComponent("#Form").submit();
- _Http.basic({
- "id": 20221213094501,
- "content": {
- "sys_reportid": 104,
- "dataid": sa_projectid,
- sys_enterpriseid: data.sys_enterpriseid[1][0],
- }
- }).then(res => {
- if (res.msg != '成功') return wx.showToast({
- title: res.msg,
- icon: "none"
- })
- let url = `${_Http.baseUrl+res.data}&enterprisename=${data.sys_enterpriseid[0]}&begdate=${data.invaliddate[0]}&enddate=${data.invaliddate[1]}`
- wx.navigateTo({
- url: `/packageA/project/impower/webview`,
- })
- this.setData({
- url
- })
- })
- },
- submit() {
- let that = this;
- this.setData({
- loading: true
- })
- wx.showModal({
- title: '提示',
- content: '是否确定发起授权',
- complete: ({
- confirm
- }) => {
- if (confirm) {
- let data = this.selectComponent("#Form").submit();
- _Http.basic({
- "id": 20230810161704,
- "content": {
- sa_projectid,
- "begdate": data.invaliddate[0],
- "enddate": data.invaliddate[1],
- "sys_enterpriseid": data.sys_enterpriseid[1][0]
- }
- }).then(res => {
- console.log("发起授权", res)
- that.setData({
- loading: false
- })
- wx.showToast({
- title: res.msg != '成功' ? res.msg : "发起成功",
- icon: "none"
- });
- if (res.msg == '成功') return setTimeout(() => {
- wx.navigateBack()
- }, 500)
- })
- }
- }
- })
- }
- })
|