| | |
| | | "name" : "智云LMES", |
| | | "appid" : "__UNI__B002F49", |
| | | "description" : "", |
| | | "versionName" : "2.0.56", |
| | | "versionCode" : 256, |
| | | "versionName" : "2.0.57", |
| | | "versionCode" : 257, |
| | | "transformPx" : false, |
| | | /* 5+App特有相关 */ |
| | | "app-plus" : { |
| | |
| | | <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> |
| | |
| | | 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: "首件检验单", |
| | |
| | | let {count, data, Message} = res.data |
| | | |
| | | if(count == 1) { |
| | | |
| | | CommonUtils.showTips({ |
| | | message: `审核成功` |
| | | }) |
| | | if(mode==1){ |
| | | this.showDialog(item["hmainid"]); |
| | | } |
| | | this.$forceUpdate() |
| | | setTimeout(() => { |
| | | this.cmdSearch() |
| | |
| | | }) |
| | | |
| | | }, |
| | | |
| | | //反审核提交意见 |
| | | 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(() => { |
| | |
| | | } |
| | | ) |
| | | }, |
| | | //红外扫条码 |
| | | 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 |
| | | |