#
whycq
2023-11-22 633c7e980dc5c70d96ad9591ccbc7f2d05d99146
#
5个文件已修改
516 ■■■■ 已修改文件
pages/business/plan/addPlan.vue 69 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/business/plan/addPlan3.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/business/plan/modiPlan.vue 75 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/business/plan/modiPlan3.vue 364 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/business/plan/planDetails.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/business/plan/addPlan.vue
@@ -63,26 +63,27 @@
                        <uni-combox :candidates="selList" placeholder="请选择平库货架类型"
                        v-model="baseFormData.select_2"></uni-combox>
                </uni-forms-item>
                <uni-forms-item label="是否需要跨梁" name="radio_1">
                    <uni-data-checkbox v-model="baseFormData.radio_1" :localdata="radio_1" />
                </uni-forms-item>
                <uni-forms-item label="是否需要网层板" name="radio_2">
                    <uni-data-checkbox v-model="baseFormData.radio_2" :localdata="radio_2" />
                </uni-forms-item>
                <uni-forms-item label="布局区域是否提供CAD场地图纸/场地" name="radio_7">
                    <uni-data-checkbox v-model="baseFormData.radio_7" :localdata="radio_7" />
                </uni-forms-item>
                <uni-forms-item label="地面有无电缆沟" name="radio_3">
                    <uni-data-checkbox v-model="baseFormData.radio_3" :localdata="radio_3" />
                </uni-forms-item>
                <uni-forms-item label="是否需要层板" name="radio_8">
                    <uni-data-checkbox v-model="baseFormData.radio_8" :localdata="radio_8" />
                </uni-forms-item>
                <uni-forms-item label="地面平整度和地面沉降是否满足标准" name="radio_5">
                <uni-forms-item label="布局区域是否提供CAD场地图纸/场地" name="radio_5">
                    <uni-data-checkbox v-model="baseFormData.radio_5" :localdata="radio_5" />
                </uni-forms-item>
                <uni-forms-item label="地面有无电缆沟" name="radio_4">
                    <uni-data-checkbox v-model="baseFormData.radio_4" :localdata="radio_4" />
                </uni-forms-item>
                <uni-forms-item label="是否需要层板" name="radio_9">
                    <uni-data-checkbox v-model="baseFormData.radio_9" :localdata="radio_9" />
                </uni-forms-item>
                <uni-forms-item label="地面平整度和地面沉降是否满足标准" name="radio_3">
                    <uni-data-checkbox v-model="baseFormData.radio_3" :localdata="radio_3" />
                </uni-forms-item>
                
                <uni-forms-item label="其他要求及注意点" required name="textarea_2">
@@ -248,26 +249,6 @@
                        value: 'value2'
                    }
                ],
                radio_8: [
                    {
                        text: '是',
                        value: 'value1'
                    },
                    {
                        text: '否',
                        value: 'value2'
                    }
                ],
                radio_3: [
                    {
                        text: '是',
                        value: 'value1'
                    },
                    {
                        text: '否',
                        value: 'value2'
                    }
                ],
                radio_5: [
                    {
                        text: '是',
@@ -278,7 +259,27 @@
                        value: 'value2'
                    }
                ],
                radio_7: [
                radio_4: [
                    {
                        text: '是',
                        value: 'value1'
                    },
                    {
                        text: '否',
                        value: 'value2'
                    }
                ],
                radio_9: [
                    {
                        text: '是',
                        value: 'value1'
                    },
                    {
                        text: '否',
                        value: 'value2'
                    }
                ],
                radio_3: [
                    {
                        text: '是',
                        value: 'value1'
pages/business/plan/addPlan3.vue
@@ -263,7 +263,7 @@
                //         that.baseFormData.userId = element.id
                //     }
                // }
                that.baseFormData.planType = 3
                that.baseFormData.planType = 6
                var temp 
                for (var i = 0 ; i < that.baseFormData.planNeed.length; i++) {
                    if (i == 0) {
pages/business/plan/modiPlan.vue
@@ -63,26 +63,27 @@
                        <uni-combox :candidates="selList" placeholder="请选择平库货架类型"
                        v-model="baseFormData.select_2"></uni-combox>
                </uni-forms-item>
                <uni-forms-item label="是否需要跨梁" name="radio_1">
                    <uni-data-checkbox v-model="baseFormData.radio_1" :localdata="radio_1" />
                </uni-forms-item>
                <uni-forms-item label="是否需要网层板" name="radio_2">
                    <uni-data-checkbox v-model="baseFormData.radio_2" :localdata="radio_2" />
                </uni-forms-item>
                <uni-forms-item label="布局区域是否提供CAD场地图纸/场地" name="radio_7">
                    <uni-data-checkbox v-model="baseFormData.radio_7" :localdata="radio_7" />
                </uni-forms-item>
                <uni-forms-item label="地面有无电缆沟" name="radio_3">
                    <uni-data-checkbox v-model="baseFormData.radio_3" :localdata="radio_3" />
                </uni-forms-item>
                <uni-forms-item label="是否需要层板" name="radio_8">
                    <uni-data-checkbox v-model="baseFormData.radio_8" :localdata="radio_8" />
                </uni-forms-item>
                <uni-forms-item label="地面平整度和地面沉降是否满足标准" name="radio_5">
                <uni-forms-item label="布局区域是否提供CAD场地图纸/场地" name="radio_5">
                    <uni-data-checkbox v-model="baseFormData.radio_5" :localdata="radio_5" />
                </uni-forms-item>
                <uni-forms-item label="地面有无电缆沟" name="radio_4">
                    <uni-data-checkbox v-model="baseFormData.radio_4" :localdata="radio_4" />
                </uni-forms-item>
                <uni-forms-item label="是否需要层板" name="radio_9">
                    <uni-data-checkbox v-model="baseFormData.radio_9" :localdata="radio_9" />
                </uni-forms-item>
                <uni-forms-item label="地面平整度和地面沉降是否满足标准" name="radio_3">
                    <uni-data-checkbox v-model="baseFormData.radio_3" :localdata="radio_3" />
                </uni-forms-item>
                
                <uni-forms-item label="其他要求及注意点" required name="textarea_2">
@@ -250,26 +251,6 @@
                        value: 'value2'
                    }
                ],
                radio_8: [
                    {
                        text: '是',
                        value: 'value1'
                    },
                    {
                        text: '否',
                        value: 'value2'
                    }
                ],
                radio_3: [
                    {
                        text: '是',
                        value: 'value1'
                    },
                    {
                        text: '否',
                        value: 'value2'
                    }
                ],
                radio_5: [
                    {
                        text: '是',
@@ -280,7 +261,27 @@
                        value: 'value2'
                    }
                ],
                radio_7: [
                radio_4: [
                    {
                        text: '是',
                        value: 'value1'
                    },
                    {
                        text: '否',
                        value: 'value2'
                    }
                ],
                radio_9: [
                    {
                        text: '是',
                        value: 'value1'
                    },
                    {
                        text: '否',
                        value: 'value2'
                    }
                ],
                radio_3: [
                    {
                        text: '是',
                        value: 'value1'
@@ -351,8 +352,6 @@
                    })
                }
            })
        },
        methods: {
            init() {
@@ -390,12 +389,8 @@
                                    res.data.select_2 = '其他'
                                    break;
                            }
                            // planNeed.push()
                            that.baseFormData = res.data
                        }
                        // that.saleManage = res.data
                        // that.cstmr = res.data
                        // that.cstmrId = that.cstmr.id
                    }
                })
            },
pages/business/plan/modiPlan3.vue
@@ -1,8 +1,372 @@
<template>
    <view>
        <view class="container">
            <uni-forms ref="baseForm" :modelValue="baseFormData">
                <uni-forms-item label="售前规划单名称" required name="name">
                    <uni-easyinput v-model="baseFormData.name" placeholder="请输入售前规划单名称" />
                </uni-forms-item>
                <uni-forms-item label="跟踪项目" required name="orderId" >
                    <view @click="autoLoad('order','')">
                        <uni-combox :candidates="orderIds" placeholder="请选择跟踪项目"
                        v-model="baseFormData.orderId$" @input="autoLoad('order',baseFormData.orderId$)"></uni-combox>
                    </view>
                </uni-forms-item>
                <uni-forms-item label="客户名称" required name="cstmrId">
                    <view @click="autoLoad('cstmr','')">
                        <uni-combox :candidates="cstmrs" placeholder="请选择客户名称"
                        v-model="baseFormData.cstmrId$" @input="autoLoad('cstmr',baseFormData.cstmrId$)"></uni-combox>
                    </view>
                </uni-forms-item>
                <uni-forms-item label="业务员联系方式" required name="userXmlSelPhone">
                    <uni-easyinput v-model="baseFormData.userXmlSelPhone" placeholder="请输入业务员联系方式" />
                </uni-forms-item>
                <uni-forms-item label="业务类型" required name="planType">
                    <uni-easyinput disabled placeholder="请输入业务类型" v-model="baseFormData.planType"></uni-easyinput>
                </uni-forms-item>
                <uni-forms-item label="立项"  name="beItem">
                    <uni-data-checkbox v-model="baseFormData.beItem" :localdata="beItem$" />
                </uni-forms-item>
                <uni-forms-item label="所需" name="planNeed">
                    <uni-data-checkbox v-model="baseFormData.planNeed" multiple :localdata="planNeeds" />
                </uni-forms-item>
                <uni-forms-item label="更改方案" name="change">
                    <uni-data-checkbox v-model="baseFormData.change" :localdata="changeValue" />
                </uni-forms-item>
                <uni-forms-item label="更改方案原因" name="changeReason">
                    <uni-easyinput v-model="baseFormData.changeReason" placeholder="请输入更改方案原因" />
                </uni-forms-item>
                <uni-forms-item label="规格组长奖金" name="planLeaderBonus">
                    <uni-easyinput v-model="baseFormData.planLeaderBonus" placeholder="请输入规格组长奖金" />
                </uni-forms-item>
                <uni-forms-item label="完成时间" name="finishTime">
                    <uni-datetime-picker type="date" return-type="string" v-model="baseFormData.finishTime"/>
                    </uni-data-picker>
                </uni-forms-item>
                <uni-forms-item label="更改次数" name="changeTime">
                    <uni-easyinput v-model="baseFormData.changeTime" placeholder="请输入更改次数" />
                </uni-forms-item>
                <uni-forms-item label="规格奖金" name="planBonus">
                    <uni-easyinput v-model="baseFormData.planBonus" placeholder="请输入规格奖金" />
                </uni-forms-item>
            </uni-forms>
            <button type="primary" @click="addCstmr()">添加</button>
        </view>
    </view>
</template>
<script>
    import user from '@/pages/api/user/user.js'
    import test from '../../../static/js/citys-data.js'
    export default {
        data() {
            return {
                orderIds: [],
                orderList: [],
                users: [],
                userList: [],
                cstmrs: [],
                cstmrList: [],
                baseFormData: {
                    name: '',
                    orderId: '',
                    userId: '',
                    appleTime: '',
                    cstmrId: '',
                    planType: '四向穿梭库/两向穿梭库',
                    select_2: '',
                    changeReason: '',
                    changeTime: '',
                    planBonus: '',
                    planLeaderBonus: '',
                    userXmlSelPhone: ''
                },
                rules: {
                    name: {
                        rules: [{
                            required: true,
                            errorMessage: '请输入售前规划单名称',
                        }]
                    },
                    orderId: {
                        rules: [{
                            required: true,
                            errorMessage: '请选择跟踪项目',
                        }]
                    },
                    userId: {
                        rules: [{
                            required: true,
                            errorMessage: '请选择业务员',
                        }]
                    },
                    userXmlSelPhone: {
                        rules: [{
                            required: true,
                            errorMessage: '请填写业务员联系方式',
                        }]
                    },
                    appleTime: {
                        rules: [{
                            required: true,
                            errorMessage: '请选择申请日期',
                        }]
                    },
                    cstmrId: {
                        rules: [{
                            required: true,
                            errorMessage: '请选择客户名称',
                        }]
                    },
                    planType: {
                        rules: [{
                            required: true,
                            errorMessage: '请输入业务类型',
                        }]
                    },
                },
                changeValue: [
                    {
                        text: '是',
                        value: 1
                    },
                    {
                        text: '否',
                        value: 0
                    }
                ],
                // 单选数据源
                beItem$: [{
                    text: '是',
                    value: 1
                }, {
                    text: '否(需售前技术跟进项目,与客户直接沟通等)',
                    value: 0
                }],
                citysData: [],
                citysDataTemp: '',
                planNeeds: [
                    {
                        text: '系统 方案规划设计',
                        value: '1'
                    },
                    {
                        text: '提供选材清单',
                        value: '2'
                    },
                    {
                        text: '立体库设计方案',
                        value: '3'
                    }
                ]
            }
        },
        onReady() {
                // 需要在onReady中设置规则
                this.$refs.baseForm.setRules(this.rules)
        },
        onShow() {
            // 获取省市区
            this.citysData = test.citysData
            // 获取业务员联系方式
            this.getDetail()
        },
        onLoad(option) {
            this.$nextTick(() => {
                if (JSON.stringify(option) != "{}") {
                    this.id = option.id
                    this.init()
                } else {
                    let _this = this
                    const eventChannel = this.getOpenerEventChannel();
                    eventChannel.on('cstmr', function(data) {
                        _this.id = data.data
                        _this.init()
                    })
                }
            })
        },
        methods: {
            init() {
                let that = this
                uni.request({
                    url: that.baseUrl + '/plan/' + that.id +'/auth',
                    header: {'token' : uni.getStorageSync('token')},
                    method: 'GET',
                    success(res) {
                        res = res.data
                        if (res.code === 200) {
                            let planNeed = res.data.planNeed.split('-')
                            res.data.planNeed = []
                            for (let k of planNeed) {
                                res.data.planNeed.push(k)
                            }
                            switch(res.data.select_2) {
                                case 'value1':
                                    res.data.select_2 = '横梁式'
                                    break;
                                case 'value2':
                                    res.data.select_2 = '驶入式'
                                    break;
                                case 'value3':
                                    res.data.select_2 = '悬梁式'
                                    break;
                                case 'value4':
                                    res.data.select_2 = '流利式'
                                    break;
                                case 'value5':
                                    res.data.select_2 = '重力式'
                                    break;
                                case 'value6':
                                    res.data.select_2 = '其他'
                                    break;
                            }
                            that.baseFormData = res.data
                        }
                    }
                })
            },
            async getDetail() {
                let res = await user.getDetail()
                if (res.code === 200) {
                    this.baseFormData.userXmlSelPhone = res.data.mobile
                } else if (res.code === 403) {
                    this.backLogin(res)
                }
            },
            bindPickerChange: function(e) {
                this.cstmrTypeIndex = e.detail.value
                this.baseFormData.cstmrType = this.cstmrTypes[e.detail.value].id
            },
            areaChange(e) {
                this.citysDataTemp = e.detail.value[0].value + ',' + e.detail.value[1].value + ',' + e.detail.value[2].value
            },
            autoLoad(type,condition) {
                let that = this
                that.orderIds = []
                that.users = []
                that.cstmrs = []
                var a = that.baseUrl + '/' + type + 'Query/auth'
                uni.request({
                    url: that.baseUrl + '/' + type + 'Query' +'/auth',
                    header:{'token':uni.getStorageSync('token')},
                    data: {condition:condition},
                    method: 'GET',
                    success(result) {
                        var res = result.data
                        if (res.code === 200) {
                            var element;
                            if (type == 'order') {
                                for(element of res.data) {
                                    that.orderIds.push(element.name)
                                    that.orderList.push(element)
                                }
                                return
                            }
                            if (type == 'user') {
                                for(element of res.data) {
                                    that.users.push(element.value)
                                    that.userList.push(element)
                                }
                                return
                            }
                            if (type == 'cstmr') {
                                for(element of res.data) {
                                    that.cstmrs.push(element.value)
                                    that.cstmrList.push(element)
                                }
                                return
                            }
                        }
                    }
                })
            },
            getOrderId() {
                let that = this
                uni.request({
                    url: that.baseUrl + '/order/all/get/kv',
                    header:{'token':uni.getStorageSync('token')},
                    data: {condition:condition},
                    method: 'GET',
                    success(result) {
                    }
                })
            },
            // 添加用户
            addCstmr() {
                let that = this
                var element
                for (element of that.cstmrList) {
                    if(element.value == that.baseFormData.cstmrId$) {
                        that.baseFormData.cstmrId = element.id
                    }
                }
                for (element of that.orderList) {
                    if(element.name == that.baseFormData.orderId$) {
                        that.baseFormData.orderId = element.id
                    }
                }
                that.baseFormData.planType = 6
                var temp
                for (var i = 0 ; i < that.baseFormData.planNeed.length; i++) {
                    if (i == 0) {
                        temp = that.baseFormData.planNeed[i]
                    } else {
                        temp = temp + '-' + that.baseFormData.planNeed[i]
                    }
                }
                that.baseFormData.planNeed = temp
                this.$refs.baseForm.validate().then(res=>{
                    for (let k in res) {
                        if (res[k] == undefined) {
                            res[k] = ''
                        }
                    }
                    res['id'] = that.baseFormData.id
                    uni.request({
                        url: that.baseUrl + '/plan/update/auth',
                        header:{
                            'token':uni.getStorageSync('token'),
                            'content-type':'application/x-www-form-urlencoded',
                            },
                        data: res,
                        method: 'POST',
                        success(result) {
                            var res = result.data
                            if (res.code === 200) {
                                uni.navigateBack()
                            } else if (res.code === 403) {
                                uni.showToast({title: res.msg, icon: "none", position: 'top'})
                                setTimeout(() => {
                                    uni.reLaunch({
                                        url: '../../login/login'
                                    });
                                }, 1000);
                            } else {
                                uni.showToast({title: res.msg, icon: "none",position: 'top'})
                            }
                        }
                    })
                }).catch(err =>{
                })
            }
        }
    }
</script>
<style>
    .container {
        min-height: 50rpx;
        padding: 15px;
        background-color: #fff;
        /* background-color: aqua; */
    }
</style>
pages/business/plan/planDetails.vue
@@ -31,8 +31,8 @@
            </view>
            <!-- 其他信息 -->
            <view class="container">
                <view><y-title title="其他信息"></y-title></view><view></view>
            <view class="container" v-show="info.length > 0">
                <view><y-title title="个新华配置"></y-title></view><view></view>
            </view>
            <view class="detail-box">
                <plan-detail :info="info"></plan-detail>
@@ -315,7 +315,7 @@
                    case 5:
                        url = `/pages/business/plan/modiPlan2?id=${id}`
                        break
                    case 3:
                    case 6:
                        url = `/pages/business/plan/modiPlan3?id=${id}`
                        break
                    case 7: