wtt
3 天以前 67ce80aec197e38cbe173071d6ad344fa070743b
出站汇报优化
4个文件已修改
193 ■■■■■ 已修改文件
manifest.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/gongxuOut/Cj_StationOutBill_Standard.vue 172 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/weiwaigxIn/Cj_StationEntrustInBill.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/weiwaigxOut/Cj_StationEntrustOutBill.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest.json
@@ -2,8 +2,8 @@
    "name" : "智云LMES",
    "appid" : "__UNI__B002F49",
    "description" : "",
    "versionName" : "3.004",
    "versionCode" : 304,
    "versionName" : "3.005",
    "versionCode" : 305,
    "transformPx" : false,
    /* 5+App特有相关 */
    "app-plus" : {
pages/gongxuOut/Cj_StationOutBill_Standard.vue
@@ -484,6 +484,7 @@
            </view> -->
            <view class="bottom-btn">
                <button v-if="hform.HIsTimeFlag==0" class="btn-a" size="mini" @tap="beginWork()">开工</button>
                <button v-if="btnType == 0 && !isEdit" class="btn-a" size="mini" @tap="submit">提交</button>
                <button v-if="btnType != 0 && !isEdit" class="btn-a" size="mini" @tap="ifEdit">修改</button>
                <button v-if="btnType != 0 && isEdit" class="btn-a" size="mini" @tap="submit">提交</button>
@@ -706,12 +707,7 @@
            }) {
                console.log(detail.value[0])
                this.hform.HIsTimeFlag = detail.value[0] || 0
                if(detail.value[0]){
                    this.getNewHRelBeginDate()
                    this.hform.HRelEndTime = getDateTime.dateTimeStr('y-m-d h:i');
                }else{
                    this.hform.HWorkTimes = 0;
                }
            },
            //通过登录用户获取默认值
            getDefValByUser() {
@@ -1210,6 +1206,10 @@
                            }else{
                                //设置主序列
                                this.setMainHSEQ();
                                //设置默认工序号
                                if(this.hform.HProcNo!=""&&this.hform.HProcNo!=null){
                                    this.getHProcNoData2(this.hform.HBarCode,this.hform.HProcNo,this.hform.HSEQNumber)
                                }
                            }
                        } else {
                            uni.showToast({
@@ -1334,9 +1334,9 @@
                if(CommonUtils.isEmpty(this.hform.HQty) == true){
                    return {pass: false, message: '提交失败: 报废数量为空'}
                }
                if(this.hform.HIsTimeFlag == 1 && CommonUtils.isEmpty(this.hform.HWorkTimes, true, true)) {
                    return {pass: false, message: '提交失败: 开启计时,但工时为0或空'}
                }
                // if(this.hform.HIsTimeFlag == 1 && CommonUtils.isEmpty(this.hform.HWorkTimes, true, true)) {
                //     return {pass: false, message: '提交失败: 开启计时,但工时为0或空'}
                // }
                return {pass: true, message: ''}
            },
            //编辑
@@ -1479,7 +1479,10 @@
                                } else if (barNo1 == 'GXLX' && data.工序号) {
                                    this.hform.HProcNo = data.工序号
                                }
                            }
                                //视图获取当前最新的工序号
                            }else if(data.工序汇报当前工序号!=null && data.工序汇报当前工序号!=""){
                                this.hform.HProcNo = data.工序汇报当前工序号
                            }
                            this.hform.HICMOInterID = data.hicmointerid
                            this.hform.HICMOBillNo = data.任务单号
                            this.hform.HMaterID = data.HMaterID
@@ -1588,10 +1591,7 @@
                            this.hform.HNotReportQty = data['未报工数量']
                            this.hform.HProcNumber = data['工序代码']
                            this.hform.HIsTimeFlag = data['是否计时'] ? 1 : 0
                            if(data['是否计时']){
                                this.hform.HRelEndTime = getDateTime.dateTimeStr('y-m-d h:i');
                                this.getNewHRelBeginDate();
                            }
                            this.hform.HSEQName = data.序列名称
                           // this.hform.HStyleNumber = data['款号']
                            // this.hform.HQty = data.合格数量
@@ -1618,59 +1618,59 @@
                });
            },
            //获取最新的报工日期
            getNewHRelBeginDate(){
                uni.request({
                    url: this.serverUrl + '/Cj_StationOutBill/get_Display',
                    data:{
                        sWhere: ` and HEmpID = N'${this.hform.HEmpID}'`,
                        user: uni.getStorageSync('HUserName'),
                        HBillSubType:'',
                    },
                    success: (res) => {
                        if(res.data.count == 1){
                            //获取列表数据
                            const listData = res.data.data
                            // 获取当前日期(去掉时间部分)
                            const today = new Date();
                            today.setHours(0, 0, 0, 0);
                            if(listData.length==0){
                                this.hform.HRelBeginTime = getDateTime.dateTimeSetHoureStr(7, 40, 0, 0,'y-m-d h:i');
                                this.hform.HWorkTimes=getDateTime.calculateHoursDiff(this.hform.HRelBeginTime,this.hform.HRelEndTime);
                            }else{
                                // 从对象数组中提取所有日期字段并找到最大值
                                const maxDate = listData.reduce((max, obj) => {
                                    const date = new Date(obj.出站时间);
                                    return date > max ? date : max;
                                }, new Date(0)); // 初始值为最小日期
                                // 比较最大日期和今天的日期部分(不比较时间)
                                const maxDateDateOnly = new Date(maxDate);
                                maxDateDateOnly.setHours(0, 0, 0, 0);
                                  // 比较最大日期和今天
                                if (maxDateDateOnly.getTime() !== today.getTime()) {
                                    // 如果不是今天,返回当前日期
                                    this.hform.HRelBeginTime = getDateTime.dateTimeSetHoureStr(7, 40, 0, 0,'y-m-d h:i');
                                    this.hform.HWorkTimes=getDateTime.calculateHoursDiff(this.hform.HRelBeginTime,this.hform.HRelEndTime);
                                }else{
                                    this.hform.HRelBeginTime = getDateTime.formatDate(maxDate);
                                    this.hform.HWorkTimes=getDateTime.calculateHoursDiff(this.hform.HRelBeginTime,this.hform.HRelEndTime);
                                }
                            }
                        }else{
                            uni.showToast({
                                title:res.data.Message,
                                icon:'none'
                            })
                        }
                    },
                    fail: (res) => {
                        console.log(res);
                        uni.showToast({
                            title:'接口请求失败',
                            icon:'none'
                        })
                    },
                });
            },
            // getNewHRelBeginDate(){
            //     uni.request({
            //         url: this.serverUrl + '/Cj_StationOutBill/get_Display',
            //         data:{
            //             sWhere: ` and HEmpID = N'${this.hform.HEmpID}'`,
            //             user: uni.getStorageSync('HUserName'),
            //             HBillSubType:'',
            //         },
            //         success: (res) => {
            //             if(res.data.count == 1){
            //                 //获取列表数据
            //                 const listData = res.data.data
            //                 // 获取当前日期(去掉时间部分)
            //                 const today = new Date();
            //                 today.setHours(0, 0, 0, 0);
            //                 if(listData.length==0){
            //                     this.hform.HRelBeginTime = getDateTime.dateTimeSetHoureStr(7, 40, 0, 0,'y-m-d h:i');
            //                     this.hform.HWorkTimes=getDateTime.calculateHoursDiff(this.hform.HRelBeginTime,this.hform.HRelEndTime);
            //                 }else{
            //                     // 从对象数组中提取所有日期字段并找到最大值
            //                     const maxDate = listData.reduce((max, obj) => {
            //                         const date = new Date(obj.出站时间);
            //                         return date > max ? date : max;
            //                     }, new Date(0)); // 初始值为最小日期
            //                     // 比较最大日期和今天的日期部分(不比较时间)
            //                     const maxDateDateOnly = new Date(maxDate);
            //                     maxDateDateOnly.setHours(0, 0, 0, 0);
            //                       // 比较最大日期和今天
            //                     if (maxDateDateOnly.getTime() !== today.getTime()) {
            //                         // 如果不是今天,返回当前日期
            //                         this.hform.HRelBeginTime = getDateTime.dateTimeSetHoureStr(7, 40, 0, 0,'y-m-d h:i');
            //                         this.hform.HWorkTimes=getDateTime.calculateHoursDiff(this.hform.HRelBeginTime,this.hform.HRelEndTime);
            //                     }else{
            //                         this.hform.HRelBeginTime = getDateTime.formatDate(maxDate);
            //                         this.hform.HWorkTimes=getDateTime.calculateHoursDiff(this.hform.HRelBeginTime,this.hform.HRelEndTime);
            //                     }
            //                 }
            //             }else{
            //                 uni.showToast({
            //                     title:res.data.Message,
            //                     icon:'none'
            //                 })
            //             }
            //         },
            //         fail: (res) => {
            //             console.log(res);
            //             uni.showToast({
            //                 title:'接口请求失败',
            //                 icon:'none'
            //             })
            //         },
            //     });
            // },
            //新增
            getNewData() {
                
@@ -1933,6 +1933,44 @@
                    }
                });
            },
            //开工按钮
            beginWork(){
                if(this.hform.lngBillKey==''||this.hform.lngBillKey==0||this.hform.lngBillSubKey==''||this.hform.lngBillSubKey==0){
                    CommonUtils.showTips({
                        title: "开工失败",
                        message: `开工失败请扫描流转卡并选择工序`,
                    });
                    return ;
                }
                uni.request({
                    url: this.serverUrl + '/Cj_StationOutBill/startTranslating',
                    method: 'GET',
                    data: {
                        HProcExchInterID: this.hform.lngBillKey,
                        HProcExchEntryID:this.hform.lngBillSubKey,
                        HOrgID:this.hform.HPRDOrgID,
                        HProcNo:this.hform.HProcNo,
                        user:uni.getStorageSync('HUserName')
                    },
                    success: (res) => {
                        uni.hideLoading();
                        if (res.data.count == 1) {
                            uni.showToast({ title: '开工成功', icon: 'none' });
                        } else {
                            CommonUtils.showTips({
                                title: "开工失败",
                                message: `${res.data.Message}`,
                            });
                        }
                    },
                    fail: () => {
                        uni.hideLoading();
                        uni.showToast({ title: '接口请求失败', icon: 'none' });
                    },
                });
            }
        }
    }
</script>
pages/weiwaigxIn/Cj_StationEntrustInBill.vue
@@ -18,7 +18,7 @@
            <view class="form-item">
                <view class="title"><text>*</text>流水号:</view>
                <view class="right" style="width: 380rpx;">
                    <input v-model="hform.HProcNo" placeholder="请输入(或扫描)流水号" @blur="getHProcNoData2(hform.HBarCode,hform.HProcNo,hform.HSEQNumber)"/>
                    <input v-model="hform.HProcNo" placeholder="请输入(或扫描)流水号" @confirm="getHProcNoData2(hform.HBarCode,hform.HProcNo,hform.HSEQNumber)"/>
                </view>
                <view class="icon-wrapper" >
                    <uni-icons type="search" size="20" @click="showBillList"></uni-icons>
@@ -724,6 +724,7 @@
                                this.arrayHSEQName[i] = res.data.data[i].HSEQName
                            }
                            this.$forceUpdate();
                            console.log(this.hform.HProcNo)
                            //没有序列号默认主序列
                            if(e==1){
                                //设置主序列
@@ -734,6 +735,10 @@
                            }else{
                                //设置主序列
                                this.setMainHSEQ();
                                //设置默认工序号
                                if(this.hform.HProcNo!=""&&this.hform.HProcNo!=null){
                                    this.getHProcNoData2(this.hform.HBarCode,this.hform.HProcNo,this.hform.HSEQNumber)
                                }
                            }
                        } else {
                            uni.showToast({
@@ -880,6 +885,9 @@
                        console.log(2,res.data);
                        if(res.data.code == 1){
                            var data = res.data.data[0]
                            if(data.委外发出当前工序号!=null && data.委外发出当前工序号!=""){
                                this.hform.HProcNo = data.委外发出当前工序号
                            }
                            this.hform.HICMOBillNo= data.任务单号
                            this.hform.HProcExchBillNo= data.单据号
                            this.hform.HICMOInterID= data.hicmointerid
pages/weiwaigxOut/Cj_StationEntrustOutBill.vue
@@ -907,6 +907,10 @@
                            }else{
                                //设置主序列
                                this.setMainHSEQ();
                                //设置默认工序号
                                if(this.hform.HProcNo!=""&&this.hform.HProcNo!=null){
                                    this.getHProcNoData2(this.hform.HBarCode,this.hform.HProcNo,this.hform.HSEQNumber)
                                }
                            }
                            this.$forceUpdate();
                        } else {
@@ -1057,6 +1061,9 @@
                        console.log(2, res.data);
                        if (res.data.code == 1) {
                            var data = res.data.data[0]
                            if(data.委外接收当前工序号!=null && data.委外接收当前工序号!=""){
                                this.hform.HProcNo = data.委外接收当前工序号
                            }
                            this.hform.HICMOBillNo = data.任务单号
                            this.hform.HICMOInterID = data.hicmointerid
                            this.hform.HMaterID = data.HMaterID