|
@@ -3,7 +3,10 @@ const _Http = getApp().globalData.http,
|
|
|
CNY = value => currency(value, {
|
|
CNY = value => currency(value, {
|
|
|
symbol: "¥",
|
|
symbol: "¥",
|
|
|
precision: 2
|
|
precision: 2
|
|
|
- }).format();
|
|
|
|
|
|
|
+ }).format(),
|
|
|
|
|
+ {
|
|
|
|
|
+ formatTime
|
|
|
|
|
+ } = require("../../utils/getTime");
|
|
|
Page({
|
|
Page({
|
|
|
data: {
|
|
data: {
|
|
|
isLeader: false, //是否为负责人
|
|
isLeader: false, //是否为负责人
|
|
@@ -165,13 +168,10 @@ Page({
|
|
|
editdataleader = s.data.editdataleader == 1;
|
|
editdataleader = s.data.editdataleader == 1;
|
|
|
}
|
|
}
|
|
|
if (status != '已终止' && status != '已过期') {
|
|
if (status != '已终止' && status != '已过期') {
|
|
|
- if (isAdmin) tabbarList = [{
|
|
|
|
|
|
|
+ if (status == '已提交' && isAdmin) tabbarList.unshift({
|
|
|
icon: "icon-genjin",
|
|
icon: "icon-genjin",
|
|
|
label: "审核"
|
|
label: "审核"
|
|
|
- }, {
|
|
|
|
|
- icon: "icon-genjin",
|
|
|
|
|
- label: "反审核"
|
|
|
|
|
- }].concat(tabbarList);
|
|
|
|
|
|
|
+ })
|
|
|
if (isLeader || isAdmin) {
|
|
if (isLeader || isAdmin) {
|
|
|
if (editdataleader) tabbarList.unshift({
|
|
if (editdataleader) tabbarList.unshift({
|
|
|
icon: "icon-zhuanyi",
|
|
icon: "icon-zhuanyi",
|
|
@@ -203,10 +203,20 @@ Page({
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
} else {
|
|
} else {
|
|
|
- tabbarList = [{
|
|
|
|
|
- icon: "icon-shanchu",
|
|
|
|
|
- label: "作废"
|
|
|
|
|
- }];
|
|
|
|
|
|
|
+ if (status == '已过期') {
|
|
|
|
|
+ tabbarList = [{
|
|
|
|
|
+ icon: "icon-genjin",
|
|
|
|
|
+ label: "反审核"
|
|
|
|
|
+ }, {
|
|
|
|
|
+ icon: "icon-shanchu",
|
|
|
|
|
+ label: "作废"
|
|
|
|
|
+ }]
|
|
|
|
|
+ } else {
|
|
|
|
|
+ tabbarList = [{
|
|
|
|
|
+ icon: "icon-shanchu",
|
|
|
|
|
+ label: "作废"
|
|
|
|
|
+ }];
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
this.setData({
|
|
this.setData({
|
|
|
isLeader,
|
|
isLeader,
|
|
@@ -264,7 +274,6 @@ Page({
|
|
|
value: data.status
|
|
value: data.status
|
|
|
}];
|
|
}];
|
|
|
if (data.typemx) {
|
|
if (data.typemx) {
|
|
|
- console.log(data)
|
|
|
|
|
briefs.splice(3, 0, {
|
|
briefs.splice(3, 0, {
|
|
|
label: "项目",
|
|
label: "项目",
|
|
|
value: data.projectname
|
|
value: data.projectname
|
|
@@ -533,33 +542,45 @@ Page({
|
|
|
})
|
|
})
|
|
|
break;
|
|
break;
|
|
|
case "审核":
|
|
case "审核":
|
|
|
- if (data.status != '已提交') return wx.showToast({
|
|
|
|
|
- title: '当前状态不可审核!',
|
|
|
|
|
- icon: "none"
|
|
|
|
|
- })
|
|
|
|
|
- wx.showModal({
|
|
|
|
|
- title: '提示',
|
|
|
|
|
- content: `是否通过当前协议`,
|
|
|
|
|
- complete: (res) => {
|
|
|
|
|
- if (res.confirm) _Http.basic({
|
|
|
|
|
- "id": 20221121203102,
|
|
|
|
|
- "version": 1,
|
|
|
|
|
- "content": {
|
|
|
|
|
- "type": 1, //0:不通过,1:通过
|
|
|
|
|
- "sa_contractids": [that.data.sa_contractid]
|
|
|
|
|
- }
|
|
|
|
|
- }).then(res => {
|
|
|
|
|
- console.log("审核合同", res)
|
|
|
|
|
- wx.showToast({
|
|
|
|
|
- title: res.msg == '成功' ? "审核成功" : res.msg,
|
|
|
|
|
- icon: "none"
|
|
|
|
|
- })
|
|
|
|
|
- if (res.msg == '成功') setTimeout(() => {
|
|
|
|
|
- that.getDetail();
|
|
|
|
|
- }, 300)
|
|
|
|
|
|
|
+ // enddate
|
|
|
|
|
+ if (formatTime().split(" ")[0] <= that.data.detail.enddate) {
|
|
|
|
|
+ wx.showModal({
|
|
|
|
|
+ title: '提示',
|
|
|
|
|
+ content: `是否通过当前协议`,
|
|
|
|
|
+ complete: (res) => {
|
|
|
|
|
+ if (res.confirm) handle()
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ wx.showModal({
|
|
|
|
|
+ title: '提示',
|
|
|
|
|
+ content: `当前合同已过期,是否确认继续审核`,
|
|
|
|
|
+ complete: (res) => {
|
|
|
|
|
+ if (res.confirm) handle()
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function handle() {
|
|
|
|
|
+ _Http.basic({
|
|
|
|
|
+ "id": 20221121203102,
|
|
|
|
|
+ "version": 1,
|
|
|
|
|
+ "content": {
|
|
|
|
|
+ "type": 1, //0:不通过,1:通过
|
|
|
|
|
+ "sa_contractid": that.data.sa_contractid
|
|
|
|
|
+ }
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ console.log("审核合同", res)
|
|
|
|
|
+ wx.showToast({
|
|
|
|
|
+ title: res.msg == '成功' ? "审核成功" : res.msg,
|
|
|
|
|
+ icon: "none"
|
|
|
})
|
|
})
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ if (res.msg == '成功') setTimeout(() => {
|
|
|
|
|
+ that.getDetail();
|
|
|
|
|
+ }, 300)
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
break;
|
|
break;
|
|
|
case "撤回":
|
|
case "撤回":
|
|
|
if (data.status != '已提交') return wx.showToast({
|
|
if (data.status != '已提交') return wx.showToast({
|