Browse Source

报价单修改

zhaoxiaohai 3 năm trước cách đây
mục cha
commit
2056acea35

+ 2 - 1
app.json

@@ -120,7 +120,8 @@
                 "contract/modules/objective/add",
                 "clockIn/index",
                 "clockIn/signIn",
-                "contract/modules/objective/setUp"
+                "contract/modules/objective/setUp",
+                "offers/modules/pettyExpense/update"
             ]
         }
     ],

+ 41 - 22
packageA/offers/addProjectOffer.js

@@ -29,6 +29,28 @@ Page({
             checking: "base",
             required: true
         }, {
+            label: "产品系列",
+            error: false,
+            errMsg: "",
+            type: "option",
+            optionNmae: "itemtype",
+            optionType: "checkbox", //复选   radio 单选
+            value: "",
+            placeholder: "请选择产品系列",
+            valueName: "itemtype",
+            checking: "base",
+            required: true
+        }, /* {
+            label: "电话",
+            error: false,
+            errMsg: "",
+            type: "number",
+            value: "",
+            valueName: "telephone",
+            placeholder: "固定电话 例:0573-12345678",
+            checking: "base",
+            required: false
+        }, */ {
             label: "报价日期",
             error: false,
             errMsg: "",
@@ -48,26 +70,22 @@ Page({
             valueName: "invaliddate",
             checking: "base",
             required: true
+        }, {
+            label: "备注",
+            error: false,
+            errMsg: "",
+            type: "textarea",
+            value: "",
+            placeholder: "报价单说明",
+            valueName: "remarks",
+            required: false, //必填
         }],
-        "content": {
-            "sa_quotedpriceid": 0, //报价单id
-            "sa_projectid": 0, //项目id
-            "contactsid": 0, //联系人id
-            "sys_enterpriseid": 0, //合作客户ID
-            "invaliddate": "", //有效截止日期
-            "billdate": "", //报价日期
-            discountrate: "",
-            remarks: "",
-            projectname: "",
-            address: ""
-        },
         disabled: true
     },
     onLoad(options) {
         if (options.data) {
             let data = JSON.parse(options.data);
             let form = this.data.form;
-
             if (data.sa_projectid) {
                 form[0].value = data.sa_projectid;
                 form.splice(1, 0, {
@@ -76,20 +94,18 @@ Page({
                     errMsg: "",
                     type: "route",
                     url: "/packageA/select/setclient/select",
-                    radio: true,
                     value: "",
                     params: {
                         id: 20221027143702,
                         "content": {
                             nocache: true,
                             "sa_projectid": data.sa_projectid[1][0],
-                            "pageNumber": 1,
-                            "pageSize": 20,
                             "where": {
                                 "condition": ""
                             }
                         },
                     },
+                    query: "&radio=true&idname=sys_enterpriseid",
                     placeholder: "选择客户",
                     valueName: "sys_enterpriseid",
                     checking: "base",
@@ -133,7 +149,7 @@ Page({
                         },
                     },
                     interrupt: true,
-                    query: "&radio=true",
+                    query: "&radio=true&idname=sys_enterpriseid",
                     placeholder: "选择客户",
                     valueName: "sys_enterpriseid",
                     checking: "base",
@@ -151,9 +167,12 @@ Page({
                     value: "",
                     params: {
                         "id": "20221022165503",
-                        "version": 1,
                         "content": {
+                            nocache: true,
                             "sys_enterpriseid": data.value[1][0],
+                            pageNumber: 1,
+                            pageSize: 10,
+                            pageTotal: 1,
                             "where": {
                                 "condition": "",
                                 "workaddress": 0
@@ -177,12 +196,12 @@ Page({
     },
     submit() {
         let content = {
-            ...this.data.content,
-            ...this.selectComponent("#Form").submit()
+            ...this.selectComponent("#Form").submit(),
+            sa_quotedpriceid: 0
         };
-        content.sys_enterpriseid = content.sys_enterpriseid[1][0] || 0;
-        content.sa_projectid = content.sa_projectid[1][0] || 0;
+        content.sys_enterpriseid = content.sys_enterpriseid[1] ? content.sys_enterpriseid[1][0] : 0;
         content.projectname = content.sa_projectid[0] || "";
+        content.sa_projectid = content.sa_projectid[1] ? content.sa_projectid[1][0] : 0;
         content.contactsid = content.contactsid ? content.contactsid[1][0] : 0;
         content.begdate = content.invaliddate[0];
         content.enddate = content.invaliddate[1];

+ 40 - 17
packageA/offers/addSetclientOffer.js

@@ -24,12 +24,34 @@ Page({
                 },
             },
             interrupt: true,
-            query: "&radio=true",
+            query: "&radio=true&idname=sys_enterpriseid",
             placeholder: "选择客户",
             valueName: "sys_enterpriseid",
             checking: "base",
             required: true
         }, {
+            label: "产品系列",
+            error: false,
+            errMsg: "",
+            type: "option",
+            optionNmae: "itemtype",
+            optionType: "checkbox", //复选   radio 单选
+            value: "",
+            placeholder: "请选择产品系列",
+            valueName: "itemtype",
+            checking: "base",
+            required: true
+        }, /* {
+            label: "电话",
+            error: false,
+            errMsg: "",
+            type: "number",
+            value: "",
+            valueName: "telephone",
+            placeholder: "固定电话 例:0573-12345678",
+            checking: "base",
+            required: false
+        }, */ {
             label: "报价日期",
             error: false,
             errMsg: "",
@@ -49,19 +71,16 @@ Page({
             valueName: "invaliddate",
             checking: "base",
             required: true
+        }, {
+            label: "备注",
+            error: false,
+            errMsg: "",
+            type: "textarea",
+            value: "",
+            placeholder: "报价单说明",
+            valueName: "remarks",
+            required: false, //必填
         }],
-        "content": {
-            "sa_quotedpriceid": 0, //报价单id
-            "sa_projectid": 0, //项目id
-            "contactsid": 0, //联系人id
-            "sys_enterpriseid": 0, //合作客户ID
-            "invaliddate": "", //有效截止日期
-            "billdate": "", //报价日期
-            discountrate: "",
-            remarks: "",
-            projectname: "",
-            address: ""
-        },
         disabled: true
     },
     onLoad(options) {
@@ -148,11 +167,15 @@ Page({
     },
     submit() {
         let content = {
-            ...this.data.content,
-            ...this.selectComponent("#Form").submit()
+            ...this.selectComponent("#Form").submit(),
+            "sa_quotedpriceid": 0, //报价单id
+            "sa_projectid": 0, //项目id
+            discountrate: "",
+            projectname: "",
+            address: "",
         };
-        content.sys_enterpriseid = content.sys_enterpriseid[1][0] || 0;
-        content.contactsid = content.contactsid[1][0] || 0;
+        content.sys_enterpriseid = content.sys_enterpriseid[1] ? content.sys_enterpriseid[1][0] : 0;
+        content.contactsid = content.contactsid[1] ? content.contactsid[1][0] : 0;
         content.begdate = content.invaliddate[0];
         content.enddate = content.invaliddate[1];
         delete(content.invaliddate)

+ 157 - 132
packageA/offers/detail.js

@@ -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

+ 2 - 3
packageA/offers/detail.json

@@ -2,13 +2,12 @@
     "usingComponents": {
         "Preview": "../setclient/modules/preview/index",
         "Trace": "../setclient/modules/trace/index",
-        "Project": "./modules/project/index",
-        "Setclient": "./modules/setclient/index",
         "Product": "./modules/product/index",
         "Record": "/packageA/public/record/index",
         "Files": "/packageA/public/files/index",
         "History": "./modules/history/index",
-        "Work": "/packageA/public/work/index"
+        "Work": "/packageA/public/work/index",
+        "PettyExpense":"./modules/pettyExpense/index"
     },
     "navigationBarTitleText": "报价单详情"
 }

+ 3 - 6
packageA/offers/detail.wxml

@@ -7,20 +7,17 @@
     <Yl-group slot='bottom' id='Group' add ownertable='sa_quotedprice' ownerid='{{detail.sa_quotedpriceid}}' />
 </Yl_Detail>
 <view style="height: 20rpx;" />
-
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
     <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
     <Trace slot='跟进动态' id='Trace' ownertable='sa_quotedprice' ownerid='{{detail.sa_quotedpriceid}}' />
-    <Work slot='任务' id='Work' ownertable='sa_quotedprice' ownerid='{{detail.sa_quotedpriceid}}' disabled="{{isAdmin||isLeader}}" />
-    <History slot='历史报价' id="History" isproject="{{detail.quotedpricetype=='项目报价'?1:0}}" />
     <Product slot='产品清单' id='Product' sa_projectid="{{detail.sa_projectid}}" type="{{detail.quotedpricetype}}" disabled="{{(per.query(options,'product')||isAdmin||isLeader)&&detail.status=='新建'}}" />
-    <Project slot='项目商机' id='Project' />
-    <Setclient slot='关联客户' id='Setclient' />
+    <PettyExpense slot='其他费用' id='PettyExpense' quotedpricenotes='{{detail.quotedpricenotes}}' />
+    <History slot='历史报价' id="History" isproject="{{detail.quotedpricetype=='项目报价'?1:0}}"  />
     <Record slot='操作记录' id="Record" ownertable='sa_quotedprice' ownerid='{{detail.sa_quotedpriceid}}' />
     <Files slot='附件' id="Files" ownertable='sa_quotedprice' ownerid='{{detail.sa_quotedpriceid}}' />
+    <Work slot='任务' id='Work' ownertable='sa_quotedprice' ownerid='{{detail.sa_quotedpriceid}}' disabled="{{isAdmin||isLeader}}" />
     <view style="height: 140rpx;" />
 </Yl_FunTabs>
-
 <!-- 底部 -->
 <Yl_Tabbar list='{{tabbarList}}' bind:callback="tabbarOnClick" />
 <wxs src='../../utils/wxmlQueryPer.wxs' module="per" />

+ 172 - 0
packageA/offers/modules/pettyExpense/index.js

@@ -0,0 +1,172 @@
+const _Http = getApp().globalData.http;
+let items = [],
+    countDown = null;
+Component({
+    properties: {
+        quotedpricenotes: Array
+    },
+    options: {
+        addGlobalClass: true
+    },
+    data: {
+        sa_quotedpriceid: "",
+        tabShow: false,
+        dialog: false,
+        newExplain: "",
+        content: {
+            nocache: true,
+            pageNumber: 1,
+            pageTotal: 1,
+            total: null
+        },
+    },
+    methods: {
+        /* 获取产品列表 */
+        getList(id, init) {
+            let content = this.data.content;
+            content.sa_quotedpriceid = id;
+            if (init) content.pageNumber = 1;
+            _Http.basic({
+                "id": "20230211155603",
+                content
+            }).then(res => {
+                console.log("其他费用列表", res)
+                if (res.msg != '成功') return wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                })
+                this.setData({
+                    list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
+                    "content.pageNumber": res.pageNumber + 1,
+                    "content.pageSize": res.pageSize,
+                    "content.pageTotal": res.pageTotal,
+                    "content.total": res.total,
+                    sa_quotedpriceid: id,
+                    tabShow: true
+                })
+            })
+        },
+        /* 前往新增其他费用 */
+        addExpense() {
+            wx.navigateTo({
+                url: '/packageA/offers/modules/pettyExpense/update?id=' + this.data.sa_quotedpriceid
+            });
+            getApp().globalData.saveFun = this.getList.bind(this);
+        },
+        /* 修改费用 */
+        changeExpense({
+            detail
+        }) {
+            let i = items.findIndex(v => v.index == detail.index);
+            i == -1 ? items.push(detail) : items[i] = detail;
+            clearTimeout(countDown);
+            countDown = setTimeout(this.handleChangeExpense.bind(this), 500);
+        },
+        /* 处理修改费用 */
+        handleChangeExpense() {
+            countDown = null;
+            _Http.basic({
+                "id": 20230211155503,
+                "version": 1,
+                "content": {
+                    "sa_quotedpriceid": this.data.sa_quotedpriceid,
+                    "items": items.map(v => v.item)
+                }
+            }).then(res => {
+                console.log("修改费用列表", res);
+                if (res.msg != '成功') return wx.showToast({
+                    title: res.msg,
+                    icon: "none",
+                    mask: true
+                });
+                items.forEach(v => this.data.list[v.index] = v.item);
+                this.setData({
+                    list: this.data.list
+                });
+                items = [];
+            })
+        },
+        /* 添加报价说明 */
+        addQuotedpricenotes() {
+            this.setData({
+                dialog: true
+            })
+        },
+        /* 完成情况说明输入 */
+        areaInput(e) {
+            this.setData({
+                newExplain: e.detail.value
+            })
+        },
+        /* 确认添加 */
+        onConfirm() {
+            let newExplain = this.data.newExplain;
+            if (newExplain == '') return wx.showToast({
+                title: '提交内容不可为空',
+                icon: "none",
+                mask: true
+            });
+            let page = getCurrentPages()[getCurrentPages().length - 1],
+                data = page.data.detail;
+            data.quotedpricenotes.push(newExplain);
+            _Http.basic({
+                "id": 20221020164803,
+                "version": 1,
+                "content": data
+            }).then(res => {
+                console.log("添加报价说明", res)
+                wx.showToast({
+                    title: res.msg == '成功' ? '添加成功!' : res.msg,
+                    icon: "none",
+                    mask: true
+                });
+                if (res.msg == '成功') {
+                    page.setData({
+                        "detail.quotedpricenotes": res.data.quotedpricenotes
+                    });
+                    this.setData({
+                        newExplain: ""
+                    })
+                }
+            })
+        },
+        onCancel() {
+            this.setData({
+                dialog: false
+            })
+        },
+        /* 移除说明 */
+        deleteItem(e) {
+            console.log(e)
+            wx.showModal({
+                title: '提示',
+                content: '是否确定移除该说明',
+                complete: (res) => {
+                    if (res.confirm) {
+                        let i = e.currentTarget.dataset.index;
+                        let page = getCurrentPages()[getCurrentPages().length - 1],
+                            data = page.data.detail;
+                        data.quotedpricenotes.splice(i, 1);
+                        _Http.basic({
+                            "id": 20221020164803,
+                            "version": 1,
+                            "content": data
+                        }).then(res => {
+                            console.log("删除报价说明", res)
+                            wx.showToast({
+                                title: res.msg == '成功' ? '移除成功!' : res.msg,
+                                icon: "none",
+                                mask: true
+                            });
+                            if (res.msg == '成功') {
+                                page.setData({
+                                    "detail.quotedpricenotes": res.data.quotedpricenotes
+                                });
+                            }
+                        })
+                    }
+                }
+            })
+        },
+    }
+})

+ 7 - 0
packageA/offers/modules/pettyExpense/index.json

@@ -0,0 +1,7 @@
+{
+    "component": true,
+    "usingComponents": {
+        "van-dialog": "@vant/weapp/dialog/index",
+        "List": "/packageA/offers/modules/pettyExpense/list/index"
+    }
+}

+ 37 - 0
packageA/offers/modules/pettyExpense/index.scss

@@ -0,0 +1,37 @@
+@import "../../../setclient/modules/address/head.scss";
+
+.exprow {
+    box-sizing: border-box;
+    padding: 26rpx 30rpx;
+    background-color: #fff;
+    border-bottom: 1px solid #DDDDDD;
+    display: flex;
+    width: 100vw;
+    padding-right: 0;
+
+    view {
+        flex: 1;
+        font-size: 28rpx;
+        font-family: PingFang SC-Regular, PingFang SC;
+        color: #333333;
+        word-wrap: break-word;
+        white-space: pre-wrap;
+    }
+
+    .iconfont {
+        flex-shrink: 0;
+        padding-right: 30rpx;
+        padding-left: 8rpx;
+    }
+}
+
+.textarea {
+    width: 90%;
+    height: 200rpx;
+    box-sizing: border-box;
+    padding: 20rpx 30rpx;
+    background-color: #FDF9FC;
+    margin: 20rpx auto;
+    border: 1rpx solid #EEECEF;
+    border-radius: 8rpx;
+}

+ 32 - 0
packageA/offers/modules/pettyExpense/index.wxml

@@ -0,0 +1,32 @@
+<van-tabs wx:if="{{tabShow}}" bind:change="onChange" title-active-color='#3874F6' color='#3874F6'>
+    <van-tab title="费用">
+        <view class="head">
+            <view class="count">费用</view>
+            <view class="expand">
+                <navigator url="#" class="but" bindtap="addExpense">
+                    <van-icon name="plus" />
+                </navigator>
+            </view>
+        </view>
+        <List list='{{list}}' bindchange='changeExpense' />
+    </van-tab>
+    <van-tab title="报价说明">
+        <view class="head">
+            <view class="count">报价说明</view>
+            <view class="expand">
+                <!-- wx:if="{{disabled}}" -->
+                <navigator url="#" class="but" bindtap="addQuotedpricenotes">
+                    <van-icon name="plus" />
+                </navigator>
+            </view>
+        </view>
+        <view class="exprow" wx:for="{{quotedpricenotes}}" wx:key="index">
+            <view style="margin-right: {{index>=2?'0':'30rpx'}};">{{item}}</view>
+            <text wx:if="{{index>=2}}" class="iconfont icon-guanlian-shanchu" bindtap="deleteItem" data-index="{{index}}"></text>
+        </view>
+    </van-tab>
+</van-tabs>
+
+<van-dialog use-slot title="添加报价说明" show="{{ dialog }}" show-cancel-button confirm-button-color='#3874F6' bind:confirm='onConfirm' bind:cancel='onCancel'>
+    <textarea placeholder="请填写" value="{{newExplain}}" bindinput="areaInput" class="textarea" />
+</van-dialog>

+ 47 - 0
packageA/offers/modules/pettyExpense/list/index.js

@@ -0,0 +1,47 @@
+Component({
+    properties: {
+        list: Array,
+        disabled: {
+            type: Boolean,
+            value: true
+        },
+        change: Function
+    },
+    options: {
+        addGlobalClass: true
+    },
+    methods: {
+        /* 步进器修改 */
+        onChange(e) {
+            let index = e.currentTarget.dataset.index,
+                item = this.data.list[index];
+            switch (e.type) {
+                case "blur":
+                    if (item.qty == e.detail.value - 0) return;
+                    item.qty = e.detail.value - 0;
+                    break;
+                case "plus":
+                    item.qty += 1;
+                    break;
+                case "minus":
+                    item.qty -= 1;
+                    break;
+            };
+            this.toChange(item, index)
+        },
+        onBlur(e) {
+            let index = e.currentTarget.dataset.index,
+                item = this.data.list[index];
+            if (item.price == e.detail.value - 0) return;
+            item.price = e.detail.value - 0;
+            this.toChange(item, index)
+        },
+        toChange(item, index) {
+            item.amount = ((item.qty - 0) * (item.price - 0)).toFixed();
+            this.triggerEvent("change", {
+                item,
+                index
+            })
+        }
+    }
+})

+ 6 - 0
packageA/offers/modules/pettyExpense/list/index.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "van-stepper": "@vant/weapp/stepper/index"
+    }
+}

+ 109 - 0
packageA/offers/modules/pettyExpense/list/index.scss

@@ -0,0 +1,109 @@
+.product-item {
+    background-color: #fff;
+    box-sizing: border-box;
+    border-bottom: 1rpx solid #DDDDDD;
+    margin-bottom: 20rpx;
+
+    .product {
+        padding: 20rpx 30rpx;
+        box-sizing: border-box;
+        position: relative;
+
+        .dec {
+            font-size: 24rpx;
+            font-family: PingFang SC-Regular, PingFang SC;
+            color: #999999;
+
+            .title {
+                width: 90%;
+                height: 40rpx;
+                font-size: 28rpx;
+                font-weight: 600;
+                color: #333333;
+            }
+
+            .subfield {
+                display: flex;
+                margin-top: 8rpx;
+                line-height: 34rpx;
+            }
+
+        }
+
+        .delete {
+            position: absolute;
+            width: 68rpx;
+            line-height: 68rpx;
+            right: 10rpx;
+            top: 0rpx;
+            text-align: center;
+            font-size: 32rpx;
+            color: #999;
+        }
+    }
+
+    .bot {
+        width: 690rpx;
+        height: 176rpx;
+        border-top: 1rpx solid #ddd;
+        margin: 0 auto;
+
+        .row {
+            display: flex;
+            width: 100%;
+            margin-top: 20rpx;
+
+            .stepper-input {
+                background-color: #fff;
+                border: 1px solid #ddd;
+                margin: 0;
+                box-sizing: border-box !important;
+                height: 58rpx;
+                padding: 0;
+                line-height: 58rpx;
+            }
+
+            view {
+                display: flex;
+                height: 58rpx;
+                align-items: center;
+
+                .label {
+                    width: 180rpx;
+                    font-size: 24rpx;
+                    font-family: PingFang SC-Regular, PingFang SC;
+                    color: #666666;
+                    text-align-last: justify;
+                }
+            }
+
+            .input {
+                height: 58rpx;
+                background: #FFFFFF;
+                border-radius: 8rpx;
+                border: 1rpx solid #CCCCCC;
+                font-size: 28rpx;
+                font-family: PingFang SC-Regular, PingFang SC;
+                color: #333333;
+                line-height: 44px;
+                text-align: center;
+            }
+
+            .money {
+                flex: 1;
+                display: flex;
+                font-size: 24rpx;
+                font-family: PingFang SC-Medium, PingFang SC;
+                color: #666666;
+                justify-content: flex-end;
+                margin-right: 20rpx;
+
+                text {
+                    font-size: 28rpx;
+                    color: #FF3B30;
+                    font-weight: 600;
+                }
+            }
+        }
+    }
+}

+ 36 - 0
packageA/offers/modules/pettyExpense/list/index.wxml

@@ -0,0 +1,36 @@
+<view class="product-item" wx:for="{{list}}" wx:key="sa_quotedprice_itemsid">
+    <view class="product" url="#">
+        <view class="dec">
+            <view class="title">
+                类型:{{item.itemtype||" --"}}
+            </view>
+            <view class="subfield">
+                费用明细:{{item.itemname||" --"}}
+            </view>
+            <view class="subfield">
+                单位:{{item.unitname||" --"}}
+            </view>
+        </view>
+        <view class="delete" wx:if="{{disabled}}" data-item="{{item}}" catchtap="deleteProduct">
+            <text class="iconfont icon-guanlian-shanchu" />
+        </view>
+    </view>
+    <view class="bot">
+        <view class="row">
+            <view style="margin-right: 40rpx;">
+                <view class="label">数量({{item.unitname}}):</view>
+                <van-stepper plus-class='stepper-input' minus-class='stepper-input' input-class="stepper-input" disabled="{{!disabled}}" data-index="{{index}}" input-width="120rpx" min="0" decimal-length='1' value="{{item.qty}}" bind:blur="onChange" bind:minus="onChange" bind:plus="onChange" />
+            </view>
+        </view>
+        <view class="row">
+            <view>
+                <view class="label">单价(元):</view>
+                <input class="input" style="width: 230rpx;" type="digit" disabled="{{!disabled}}" value="{{item.price}}" data-index="{{index}}" bindblur="onBlur" />
+            </view>
+            <view class="money">
+                金额:<text>¥{{item.amount}}</text>
+            </view>
+        </view>
+    </view>
+</view>
+<My_empty wx:if="{{list.length==0}}" />

+ 114 - 0
packageA/offers/modules/pettyExpense/update.js

@@ -0,0 +1,114 @@
+const _Http = getApp().globalData.http;
+let sa_quotedpriceid = null;
+Page({
+    data: {
+        form: [{
+            label: "类型",
+            error: false,
+            errMsg: "",
+            type: "option",
+            optionNmae: "quotedpriceitemtype",
+            optionType: "radio", //复选   radio 单选
+            value: "",
+            placeholder: "请选择",
+            valueName: "itemtype",
+            required: false
+        }, {
+            label: "费用明细",
+            error: false,
+            errMsg: "",
+            type: "textarea",
+            value: "",
+            placeholder: "费用明细",
+            valueName: "itemname",
+            required: false, //必填
+        }, {
+            label: "单位",
+            error: false,
+            errMsg: "",
+            type: "selector",
+            range: [{
+                    "unitid": 2,
+                    "rowindex": "1",
+                    "unitname": "个"
+                },
+                {
+                    "unitid": 3,
+                    "rowindex": "2",
+                    "unitname": "米"
+                },
+                {
+                    "unitid": 4,
+                    "rowindex": "3",
+                    "unitname": "千克"
+                },
+                {
+                    "unitid": 5,
+                    "rowindex": "4",
+                    "unitname": "克"
+                }
+            ],
+            rangeKey: "unitname",
+            rangeIndex: "",
+            value: "",
+            placeholder: "计量单位",
+            valueName: "unitname",
+            required: false, //必填
+        }, {
+            label: "单价(元)",
+            error: false,
+            errMsg: "",
+            type: "digit",
+            value: "",
+            placeholder: "单价(元)",
+            valueName: "price",
+            required: false, //必填
+        }, {
+            label: "数量",
+            error: false,
+            errMsg: "",
+            type: "digit",
+            value: "",
+            placeholder: "数量",
+            valueName: "qty",
+            required: false, //必填
+        }],
+    },
+    onLoad(options) {
+        sa_quotedpriceid = options.id;
+    },
+    submit() {
+        let content = this.selectComponent("#Form").submit();
+        for (const key in content) {
+            if (content[key]) {
+                content.sa_quotedprice_specialitemsid = 0;
+                wx.showModal({
+                    title: '提示',
+                    content: '是否确认添加本条费用明细',
+                    complete: (res) => {
+                        if (res.confirm) _Http.basic({
+                            "id": 20230211155503,
+                            "version": 1,
+                            "content": {
+                                "sa_quotedpriceid": sa_quotedpriceid,
+                                "items": [content]
+                            }
+                        }).then(res => {
+                            wx.showToast({
+                                title: res.msg == '成功' ? '添加成功' : res.msg,
+                                icon: "none",
+                                mask: true
+                            });
+                            if (res.msg == '成功') setTimeout(() => {
+                                getApp().globalData.saveFun(sa_quotedpriceid, true);
+                                getApp().globalData.saveFun = null;
+                                wx.navigateBack();
+                            }, 500);
+                        })
+                    }
+                })
+                break;
+            }
+        }
+    },
+})

+ 4 - 0
packageA/offers/modules/pettyExpense/update.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "添加费用"
+}

+ 23 - 0
packageA/offers/modules/pettyExpense/update.scss

@@ -0,0 +1,23 @@
+.new-footer {
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+    position: fixed;
+    width: 100vw;
+    height: 130rpx;
+    background: #FFFFFF;
+    box-shadow: 0px -4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+    bottom: 0;
+
+    .new-submit {
+        width: 156rpx;
+        height: 90rpx;
+        background: #3874F6;
+        border-radius: 8rpx;
+        font-size: 28rpx;
+        font-family: PingFang SC-Bold, PingFang SC;
+        font-weight: bold;
+        color: #FFFFFF;
+        margin-right: 30rpx;
+    }
+}

+ 4 - 0
packageA/offers/modules/pettyExpense/update.wxml

@@ -0,0 +1,4 @@
+<Yl_field id='Form' form='{{form}}' bind:onConfirm='onConfirm' />
+<view class="new-footer">
+    <van-button custom-class='new-submit' disabled='{{disabled}}' bindclick='submit'>提交</van-button>
+</view>

+ 11 - 1
packageA/offers/modules/product/index.js

@@ -9,6 +9,16 @@ Component({
         disabled: Boolean, //禁用
         sa_projectid: Number,
         type: String, //报价单类型
+        savePage: null, //保存页面
+    },
+    observers: {
+        sumamount(newData) {
+            let savePage = this.data.savePage;
+            let i = savePage.data.list1.findIndex(v => v.label == '总金额');
+            if (i != -1 && savePage.data.list1[i].value != (newData - 0)) savePage.setData({
+                [`list1[${i}].value`]: newData
+            })
+        }
     },
     data: {
         sumamount: 0,
@@ -70,6 +80,7 @@ Component({
                     "content.pageTotal": res.pageTotal,
                     "content.total": res.total,
                     sa_quotedpriceid: id,
+                    savePage: getCurrentPages().find(v => v.__route__ == 'packageA/offers/detail'),
                 })
                 if (res.pageNumber == 1) this.setData({
                     sumamount: (res.data[0].rowstotal[0].sumamount - 0).toFixed(2) || 0
@@ -270,7 +281,6 @@ Component({
                     })
                     return;
                 }
-
                 items.forEach(v => {
                     v.discountrate = (v.discountrate * 100).toFixed(2);
                     let i = list.findIndex(value => v.sa_quotedprice_itemsid == value.sa_quotedprice_itemsid);

+ 14 - 0
project.private.config.json

@@ -154,6 +154,20 @@
                     "query": "",
                     "launchMode": "default",
                     "scene": null
+                },
+                {
+                    "name": "报价单",
+                    "pathName": "packageA/offers/detail",
+                    "query": "sa_quotedpriceid=497",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "123123",
+                    "pathName": "packageA/offers/modules/pettyExpense/update",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
                 }
             ]
         }

+ 2 - 2
utils/Http.js

@@ -1,6 +1,6 @@
 // const baseUrl = "https://meida.cnyunl.com/yos/rest/index";
-const baseUrl = "http://61.164.207.46:8000/yos/rest/index";
-// const baseUrl = "http://122.226.136.204:8082/yos/rest/index";
+// const baseUrl = "http://61.164.207.46:8000/yos/rest/index";
+const baseUrl = "http://122.226.136.204:8082/yos/rest/index";
 
 let count = null;
 class HTTP {