|
|
@@ -4,10 +4,6 @@ Page({
|
|
|
isLeader: false, //是否为负责人
|
|
|
tabsActive: 1, //tabs 选中项
|
|
|
sa_quotedpriceid: "",
|
|
|
- /* {
|
|
|
- label: "关联客户",
|
|
|
- icon: "icon-tabkehu"
|
|
|
- }, */
|
|
|
tabsList: [{
|
|
|
label: "详细信息",
|
|
|
icon: "icon-tabxiangxixinxi1"
|
|
|
@@ -15,6 +11,10 @@ Page({
|
|
|
label: "产品清单",
|
|
|
icon: "icon-tabchanpin",
|
|
|
model: "#Product"
|
|
|
+ }, {
|
|
|
+ label: "其他费用",
|
|
|
+ icon: "icon-tabkaipiaoxinxi",
|
|
|
+ model: "#PettyExpense"
|
|
|
}, {
|
|
|
label: "历史报价",
|
|
|
icon: "icon-tabbaojiadan",
|
|
|
@@ -60,138 +60,12 @@ Page({
|
|
|
title: res.msg,
|
|
|
icon: "none"
|
|
|
});
|
|
|
- /* if (res.data.quotedpricetype == '项目报价') {
|
|
|
- this.data.tabsList.splice(2, 0, {
|
|
|
- label: "项目商机",
|
|
|
- icon: "icon-tabxiangmu"
|
|
|
- })
|
|
|
- } */
|
|
|
- let tabbarList = [{
|
|
|
- icon: "icon-genjin",
|
|
|
- label: "跟进"
|
|
|
- }],
|
|
|
- isLeader = res.data.createuserid == wx.getStorageSync('userMsg').userid;
|
|
|
-
|
|
|
- if (isLeader || this.data.isAdmin) {
|
|
|
- tabbarList = [{
|
|
|
- icon: "icon-guanlian-fuzhi",
|
|
|
- label: "复制"
|
|
|
- }, {
|
|
|
- icon: "icon-zhuanyi",
|
|
|
- label: "更换负责人"
|
|
|
- }, {
|
|
|
- icon: "icon-shanchu",
|
|
|
- label: "作废"
|
|
|
- }].concat(tabbarList)
|
|
|
- if (isLeader && res.data.status == '提交') {
|
|
|
- tabbarList.unshift({
|
|
|
- icon: "icon-genjin",
|
|
|
- label: '撤回'
|
|
|
- })
|
|
|
- } else {
|
|
|
- tabbarList.unshift({
|
|
|
- icon: "icon-genjin",
|
|
|
- label: '提交'
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- if (this.data.isAdmin) tabbarList = [{
|
|
|
- icon: "icon-guanlian-fuzhi",
|
|
|
- label: "审核"
|
|
|
- }, {
|
|
|
- icon: "icon-guanlian-fuzhi",
|
|
|
- label: "反审核"
|
|
|
- }].concat(tabbarList);
|
|
|
-
|
|
|
- this.setData({
|
|
|
- tabbarList,
|
|
|
- isLeader,
|
|
|
- detail: res.data,
|
|
|
- briefs: [{
|
|
|
- label: "报价类型",
|
|
|
- value: res.data.quotedpricetype
|
|
|
- }, {
|
|
|
- label: "项目",
|
|
|
- value: res.data.projectname
|
|
|
- }, {
|
|
|
- label: "客户",
|
|
|
- value: res.data.enterprisename
|
|
|
- }, {
|
|
|
- label: "是否特价",
|
|
|
- value: res.data.specialoffer == 1 ? '是' : '否'
|
|
|
- }, {
|
|
|
- label: "状态",
|
|
|
- value: res.data.status
|
|
|
- }],
|
|
|
- list1: [{
|
|
|
- label: "报价单号",
|
|
|
- value: res.data.billno
|
|
|
- }, {
|
|
|
- label: "报价类型",
|
|
|
- value: res.data.quotedpricetype
|
|
|
- }, {
|
|
|
- label: "是否特价",
|
|
|
- value: res.data.specialoffer == 1 ? '是' : '否'
|
|
|
- }, {
|
|
|
- label: "项目",
|
|
|
- value: res.data.projectname
|
|
|
- }, {
|
|
|
- label: "客户",
|
|
|
- value: res.data.enterprisename
|
|
|
- }, {
|
|
|
- label: "客户联系人",
|
|
|
- value: res.data.contactsname
|
|
|
- }, {
|
|
|
- label: "联系人手机号",
|
|
|
- value: res.data.contactsphonenumber
|
|
|
- }, {
|
|
|
- label: "报价日期",
|
|
|
- value: res.data.billdate
|
|
|
- }, {
|
|
|
- label: "有效期",
|
|
|
- value: ""
|
|
|
- }, {
|
|
|
- label: "状态",
|
|
|
- value: res.data.status
|
|
|
- }, {
|
|
|
- label: "负责人",
|
|
|
- value: res.data.leader[0].name
|
|
|
- }],
|
|
|
- list2: [{
|
|
|
- label: "创建人",
|
|
|
- value: res.data.createby
|
|
|
- }, {
|
|
|
- label: "创建时间",
|
|
|
- value: res.data.createdate
|
|
|
- }, {
|
|
|
- label: "最近编辑人",
|
|
|
- value: res.data.changeby
|
|
|
- }, {
|
|
|
- label: "最近编辑时间",
|
|
|
- value: res.data.changedate
|
|
|
- }, {
|
|
|
- label: "报价人",
|
|
|
- value: res.data.submitby
|
|
|
- }, {
|
|
|
- label: "报价时间",
|
|
|
- value: res.data.submitdate
|
|
|
- }, {
|
|
|
- label: "审核人",
|
|
|
- value: res.data.checkby
|
|
|
- }, {
|
|
|
- label: "审核时间",
|
|
|
- value: res.data.checkdate
|
|
|
- }, {
|
|
|
- label: "转手次数",
|
|
|
- value: res.data.leader[0].leadernum
|
|
|
- }],
|
|
|
- tabsList: this.data.tabsList
|
|
|
- });
|
|
|
+ this.setPreview(res);
|
|
|
/* 更新列表数据 */
|
|
|
let page = getCurrentPages().find(v => v.__route__ == 'packageA/offers/index');
|
|
|
if (page) {
|
|
|
let i = page.data.list.findIndex(v => v.sa_quotedpriceid == this.data.sa_quotedpriceid);
|
|
|
- if (i != -1) page.setData({
|
|
|
+ if (i != -1 && page.data.list[i].status != res.data.status) page.setData({
|
|
|
[`list[${i}].status`]: res.data.status
|
|
|
})
|
|
|
}
|
|
|
@@ -200,6 +74,157 @@ Page({
|
|
|
this.partialRenewal();
|
|
|
})
|
|
|
},
|
|
|
+ /* 设置显示字段 */
|
|
|
+ setPreview(res) {
|
|
|
+ //底部操作
|
|
|
+ let tabbarList = [{
|
|
|
+ icon: "icon-genjin",
|
|
|
+ label: "跟进"
|
|
|
+ }],
|
|
|
+ isLeader = res.data.createuserid == wx.getStorageSync('userMsg').userid;
|
|
|
+ if (isLeader || this.data.isAdmin) {
|
|
|
+ //负责人/管理员默认权限功能
|
|
|
+ tabbarList = [{
|
|
|
+ icon: "icon-tabxiangmupinggu",
|
|
|
+ label: '打印'
|
|
|
+ }, {
|
|
|
+ icon: "icon-guanlian-fuzhi",
|
|
|
+ label: "复制"
|
|
|
+ }, {
|
|
|
+ icon: "icon-zhuanyi",
|
|
|
+ label: "更换负责人"
|
|
|
+ }, {
|
|
|
+ icon: "icon-shanchu",
|
|
|
+ label: "作废"
|
|
|
+ }].concat(tabbarList)
|
|
|
+ //负责人 新建状态可以提交 提交状态可以撤回 负责人可以打印
|
|
|
+ if (isLeader) {
|
|
|
+ if (res.data.status == '新建') tabbarList.unshift({
|
|
|
+ icon: "icon-genjin",
|
|
|
+ label: '提交'
|
|
|
+ })
|
|
|
+ if (res.data.status == '提交') tabbarList.unshift({
|
|
|
+ icon: "icon-genjin",
|
|
|
+ label: '撤回'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //拥有管理权限 提交状态可以审核 审核状态可以反审核
|
|
|
+ if (this.data.isAdmin && (res.data.status == '审核' || res.data.status == '提交')) tabbarList.unshift(res.data.status == '审核' ? {
|
|
|
+ icon: "icon-guanlian-fuzhi",
|
|
|
+ label: "反审核"
|
|
|
+ } : {
|
|
|
+ icon: "icon-guanlian-fuzhi",
|
|
|
+ label: "审核"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ let briefs = [{
|
|
|
+ label: "报价类型",
|
|
|
+ value: res.data.quotedpricetype
|
|
|
+ }, {
|
|
|
+ label: "项目",
|
|
|
+ value: res.data.projectname
|
|
|
+ }, {
|
|
|
+ label: "客户",
|
|
|
+ value: res.data.enterprisename
|
|
|
+ }, {
|
|
|
+ label: "是否特价",
|
|
|
+ value: res.data.specialoffer == 1 ? '是' : '否'
|
|
|
+ }, {
|
|
|
+ label: "状态",
|
|
|
+ value: res.data.status
|
|
|
+ }];
|
|
|
+ //客户报价移除项目字段
|
|
|
+ if (res.data.quotedpricetype == '客户报价') briefs.splice(1, 1);
|
|
|
+ let list1 = [{
|
|
|
+ label: "报价单号",
|
|
|
+ value: res.data.billno
|
|
|
+ }, {
|
|
|
+ label: "报价类型",
|
|
|
+ value: res.data.quotedpricetype
|
|
|
+ }, {
|
|
|
+ label: "产品系列",
|
|
|
+ value: res.data.itemtype
|
|
|
+ }, {
|
|
|
+ label: "电话",
|
|
|
+ value: res.data.telephone
|
|
|
+ }, {
|
|
|
+ label: "项目名称",
|
|
|
+ value: res.data.projectname
|
|
|
+ }, {
|
|
|
+ label: "项目编号",
|
|
|
+ value: res.data.projectnum
|
|
|
+ }, {
|
|
|
+ label: "客户",
|
|
|
+ value: res.data.enterprisename
|
|
|
+ }, {
|
|
|
+ label: "客户联系人",
|
|
|
+ value: res.data.contactsname
|
|
|
+ }, {
|
|
|
+ label: "联系人手机号",
|
|
|
+ value: res.data.contactsphonenumber
|
|
|
+ }, {
|
|
|
+ label: "报价日期",
|
|
|
+ value: res.data.billdate
|
|
|
+ }, {
|
|
|
+ label: "有效期",
|
|
|
+ value: res.data.begdate + ' - ' + res.data.enddate
|
|
|
+ }, {
|
|
|
+ label: "总金额",
|
|
|
+ value: res.data.sumamount
|
|
|
+ }, {
|
|
|
+ label: "是否特价",
|
|
|
+ value: res.data.specialoffer == 1 ? '是' : '否'
|
|
|
+ }, {
|
|
|
+ label: "状态",
|
|
|
+ value: res.data.status
|
|
|
+ }, {
|
|
|
+ label: "负责人",
|
|
|
+ value: res.data.leader[0].name
|
|
|
+ }, {
|
|
|
+ label: "备注",
|
|
|
+ value: res.data.remarks
|
|
|
+ }];
|
|
|
+ //客户报价移除项目字段
|
|
|
+ if (res.data.quotedpricetype == '客户报价') list1.splice(4, 2);
|
|
|
+ this.setData({
|
|
|
+ detail: res.data,
|
|
|
+ tabbarList,
|
|
|
+ isLeader,
|
|
|
+ briefs,
|
|
|
+ list1,
|
|
|
+ list2: [{
|
|
|
+ label: "创建人",
|
|
|
+ value: res.data.createby
|
|
|
+ }, {
|
|
|
+ label: "创建时间",
|
|
|
+ value: res.data.createdate
|
|
|
+ }, {
|
|
|
+ label: "最近编辑人",
|
|
|
+ value: res.data.changeby
|
|
|
+ }, {
|
|
|
+ label: "最近编辑时间",
|
|
|
+ value: res.data.changedate
|
|
|
+ }, {
|
|
|
+ label: "提交人",
|
|
|
+ value: res.data.submitby
|
|
|
+ }, {
|
|
|
+ label: "提交时间",
|
|
|
+ value: res.data.submitdate
|
|
|
+ }, {
|
|
|
+ label: "审核人",
|
|
|
+ value: res.data.checkby
|
|
|
+ }, {
|
|
|
+ label: "审核时间",
|
|
|
+ value: res.data.checkdate
|
|
|
+ }, {
|
|
|
+ label: "作废原因",
|
|
|
+ value: res.data.deletereason
|
|
|
+ }, {
|
|
|
+ label: "转手次数",
|
|
|
+ value: res.data.leader[0].leadernum
|
|
|
+ }],
|
|
|
+ });
|
|
|
+ },
|
|
|
//tabs 切换
|
|
|
tabsChange({
|
|
|
detail
|