wtt
19 小时以前 4e2724cb51fe4247d9c28cdf54b45337b057da73
多级审核添加附件上传和反审核意见提交功能
3个文件已修改
192 ■■■■ 已修改文件
manifest.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/ZLGL/checkFlowList/QC_CheckBillflowList.vue 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/tiaomachaima/tiaomachaima2.vue 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest.json
@@ -2,8 +2,8 @@
    "name" : "智云LMES",
    "appid" : "__UNI__B002F49",
    "description" : "",
    "versionName" : "2.0.56",
    "versionCode" : 256,
    "versionName" : "2.0.57",
    "versionCode" : 257,
    "transformPx" : false,
    /* 5+App特有相关 */
    "app-plus" : {
pages/ZLGL/checkFlowList/QC_CheckBillflowList.vue
@@ -69,7 +69,8 @@
                <view class="op" v-if="operations == index">
                    <button class="op3" size="mini" plain @tap.stop="audit(item, 0)">审核</button>
                    <button class="op3" size="mini" plain @tap.stop="audit(item, 1)">反审核</button>
                    <button class="op3" size="mini" plain @tap.stop="fileUpload()">文件上传</button>
                    <button class="op3" size="mini" plain @tap.stop="fileUpload(item)">文件上传</button>
                    <button class="op3" size="mini" plain @tap.stop="getImage(item)">预览图片</button>
                    <!-- <button class="op3" size="mini" plain @tap.stop="Reject(item)">驳回</button> -->
                    <button class="op5" size="mini" plain @tap.stop="operations = -1">取消操作</button>
                </view>
@@ -98,8 +99,17 @@
            return {
                showDetail: -1,
                operations : -1,
                serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
                //上传参数
                uploadOptions: {},
                uploadOptions: {
                    url: CommonUtils.getServerUrl() + "/LMES/UploadFile",
                    formData: {
                        HBillNo:"",
                        HRemark: "",
                        HUserName: getUserInfo()["Czymc"]
                    }
                },
                hform: {
                    HSourceBillType:'8505',
                    HSourceBillTypeName: "首件检验单",
@@ -255,9 +265,13 @@
                    let {count, data, Message} = res.data
                    
                    if(count == 1) {
                        CommonUtils.showTips({
                            message: `审核成功`
                        })
                        if(mode==1){
                            this.showDialog(item["hmainid"]);
                        }
                        this.$forceUpdate()
                        setTimeout(() => {
                            this.cmdSearch()
@@ -337,7 +351,127 @@
                })
            },
            //反审核提交意见
            showDialog(HInterID) {
              uni.showModal({
                title: '请提交反审核意见',
                editable: true,
                placeholderText: '请输入内容',
                success: (result) => {
                  if (result.confirm) {
                    try {
                        let res = CommonUtils.doRequest2Sync({
                            url: '/LMES/AuditFlowOpinion',
                            data: {
                                "sWhere": result.content,
                                "billType":this.hform.HSourceBillType,
                                "HInterID":HInterID,
                                "type":1,
                                "user": getUserInfo()["Czymc"]
                            },
                        })
                        if (!res) {
                            return
                        }
                        let {
                            data,
                            count,
                            Message
                        } = res.data
                        if (count > 0) {
                            uni.showToast({
                                icon: 'none',
                                title: Message
                            })
                        } else {
                            uni.showToast({
                                icon: 'none',
                                title: Message
                            })
                        }
                    } catch (err) {
                        console.warn(err);
                        uni.showToast({
                            title: '接口请求失败:' + err,
                            icon: 'none'
                        })
                    }
                  }
                }
              })
            },
            // 上传文件
            fileUpload(item) {
                this.uploadOptions.formData.HBillNo = item.单据号
                this.$refs.XeUpload.upload('image', {});// image, video, file
            },
            handleUploadCallback(e) { // 文件上传回调
                console.log('file: ', e);
                if (['choose', 'success'].includes(e.type)) {
                  // 根据接口返回修改对应的response相关的逻辑
                  const tmpFiles = (e.data || []).map(({ response, tempFilePath, name, fileType }) => {
                    if(response.code=="1"){
                        CommonUtils.showTips({
                            message: "上传成功"
                        })
                    }else{
                        CommonUtils.showTips({
                            message: "上传失败"+response.Message
                        })
                    }
                  });
                }
            },
            async getImage(item) {//预览图片
                try {
                    let res = await CommonUtils.doRequest2Sync({
                        url: '/LMES/Filelist',
                        data: {
                            "HBillNo": item.单据号,
                        },
                    })
                    if (!res) {
                        return
                    }
                    let {
                        data,
                        count,
                        Message
                    } = res.data
                    if (count > 0) {
                        if(data.length>0){
                            const imageUrl = res.data.data[0]["url"];
                            //正则表达式获取服务器路径倒数第二个内容
                            const regex = /^(.*\/)[^\/]+\/[^\/]*\/?$/;
                            const match = this.serverUrl.match(regex);
                            console.log(match[1],imageUrl)
                            // 或者直接预览图片
                            uni.previewImage({
                                urls: [match[1]+imageUrl]
                            })
                        }else{
                            CommonUtils.showTips({
                                message: "无图片请先上传图片"
                            })
                        }
                    } else {
                        uni.showToast({
                            icon: 'none',
                            title: Message
                        })
                    }
                } catch (err) {
                    console.warn(err);
                    uni.showToast({
                        title: '接口请求失败:' + err,
                        icon: 'none'
                    })
                }
            }
        },
        onShow() {
            this.$nextTick(() => {
pages/tiaomachaima/tiaomachaima2.vue
@@ -257,53 +257,7 @@
                    }
                )
            },
            //红外扫条码
            getCode(HBarCode) {
                if (!HBarCode) {
                    CommonUtils.playSound(0)
                    this.refreshBarCodeState()
                    uni.showToast({
                        title: '条码不能为空',
                        icon: 'none'
                    })
                } else {
                    uni.request({
                        url: this.serverUrl + '/Gy_BarCodeBillList/page',
                        data: {
                            sWhere: ` and 条码编号=''${this.barCodeInfoMeta.barCodeNo}''`,
                            user: this.userInfo.HEmpName,
                            page: 1,
                            size: 1
                        },
                        success: (res) => {
                            console.log('扫码返回', res.data.data);
                            if (res.data.count == 1) {
                                CommonUtils.playSound(1)
                                this.barCodeInfo = res.data.data[0]
                                this.barCodeSplitInfo = []
                                // 扫描条码后重置按钮状态
                                this.resetButtonState();
                            } else {
                                CommonUtils.playSound(0)
                                this.refreshBarCodeState()
                                uni.showToast({
                                    title: res.data.Message,
                                    icon: 'none'
                                })
                            }
                        },
                        fail: (res) => {
                            CommonUtils.playSound(0)
                            this.refreshBarCodeState()
                            console.log(res);
                            uni.showToast({
                                title: '接口请求失败',
                                icon: 'none'
                            })
                        },
                    });
                }
            },
            dialogInputConfirm(val) {
                this.itemCache["HSplitNum"] = val