qq_41295110
2026-02-26 423c1948a631cff298e6348cc55626f5149c111a
pages/ZLGL/checkFlowList/QC_CheckBillflowList.vue
@@ -69,8 +69,10 @@
            <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="Reject(item)">驳回</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="op3" size="mini" plain @tap.stop="selected(item)">查看明细</button>
               <button class="op5" size="mini" plain @tap.stop="operations = -1">取消操作</button>
            </view>
         </uni-card>
@@ -98,8 +100,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: "首件检验单",
@@ -109,10 +120,13 @@
            listData: [],
            showList: [],
            page: 1,
            HSourceBillTypeList: {首件检验单:'8505',末件检验单:'8507'},
            HSourceBillTypeList: {首件检验单:'8505',末件检验单:'8507',采购订单:'1102',销售订单:'1401',特批单:'1422'},
            arrayHSourceBillTypeName: [
                "首件检验单",
                "末件检验单",
               "采购订单",
               "销售订单",
               "特批单"
            ],
            }
        },
@@ -240,6 +254,30 @@
                   CurUserName: getUserInfo()["Czymc"],
                  CurUserID:getUserInfo()["Czybm"],
               }
            }else if(this.hform.HSourceBillType=='1102'){
               url = 'Cg_POOrderBill/AuditCg_POOrderBill_Flow',
               ajaxData= {
                  HInterID: item["hmainid"],
                   IsAudit: mode,
                   CurUserName: getUserInfo()["Czymc"],
                  CurUserID:getUserInfo()["Czybm"],
               }
            }else if(this.hform.HSourceBillType=='1401'){
               url = 'Xs_SeOrderBill/AuditXs_SeOrderBill_Flow',
               ajaxData= {
                  HInterID: item["hmainid"],
                   IsAudit: mode,
                   CurUserName: getUserInfo()["Czymc"],
                  CurUserID:getUserInfo()["Czybm"],
               }
            }else if(this.hform.HSourceBillType=='1422'){
               url = 'Xs_ExceptiveCheckRequestBill/AuditXs_ExceptiveCheckRequestBill',
               ajaxData= {
                  HInterID: item["hmainid"],
                   IsAudit: mode,
                   CurUserName: getUserInfo()["Czymc"],
                  //CurUserID:getUserInfo()["Czybm"],
               }
            }
                try{
                    let res = await CommonUtils.doRequest2Sync({
@@ -255,13 +293,19 @@
                    let {count, data, Message} = res.data
                    
                    if(count == 1) {
                        CommonUtils.showTips({
                            message: `审核成功`
                        })
                  if(mode==1){
                     this.showDialog(item["hmainid"]);
                  }else{
                     setTimeout(() => {
                        this.cmdSearch()
                     }, 2000)
                  }
                        this.$forceUpdate()
                        setTimeout(() => {
                            this.cmdSearch()
                        }, 2000)
                    }else {
                        CommonUtils.showTips({
                            title: '温馨提示',
@@ -287,6 +331,18 @@
               }
            }else if(this.hform.HSourceBillType=='8507'){
               url = 'QC_ProcessCheckBill/RejectCheckFlow',
               ajaxData= {
                  HInterID: item["hmainid"],
                  CurUserID:getUserInfo()["Czybm"],
               }
            }else if(this.hform.HSourceBillType=='1401'){
               url = 'Xs_SeOrderBill/RejectCheckFlow_POOrderBill',
               ajaxData= {
                  HInterID: item["hmainid"],
                  CurUserID:getUserInfo()["Czybm"],
               }
            }else if(this.hform.HSourceBillType=='1102'){
               url = 'Cg_POOrderBill/RejectCheckFlow_POOrderBill',
               ajaxData= {
                  HInterID: item["hmainid"],
                  CurUserID:getUserInfo()["Czybm"],
@@ -337,8 +393,153 @@
                })
            },
            //反审核提交意见
         async showDialog(HInterID) {
           uni.showModal({
            title: '请提交反审核意见',
            editable: true,
            placeholderText: '请输入内容',
            success: async (result) => {
              if (result.confirm) {
               try {
                   let res = await 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: "意见提交成功"
                       })
                       this.cmdSearch();
                   } else {
                       uni.showToast({
                           icon: 'none',
                           title: Message
                       })
                   }
               } catch (err) {
                   console.warn(err);
                   uni.showToast({
                       title: '接口请求失败:' + err,
                       icon: 'none'
                   })
               }
              }
            }
           })
         },
         async selected(item)
         {
            if(this.hform.HSourceBillType=='1401')  //销售
            {
               console.log(item)
               uni.navigateTo({
                  url: '/pages/xiaoshoudingdan/xiaoshoudingdanListEdit?linterid=' + item.hmainid + '&HBillNo=' + item.单据号
               })
            }else if(this.hform.HSourceBillType=='1102') //采购
            {
               console.log(item)
               uni.navigateTo({
                  url: '/pages/caigoudingdan/caigoudingdanListEdit?linterid=' + item.hmainid + '&HBillNo=' + item.单据号
               })
            }else if(this.hform.HSourceBillType=='1422') //采购
            {
               console.log(item)
               uni.navigateTo({
                  url: '/pages/tepidan/TePiDanEdit?linterid=' + item.hmainid + '&HBillNo=' + item.单据号
               })
            }
         },
         // 上传文件
         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(() => {
                this.cmdSearch()