Browse Source

MES——> 增加SOP预览PDF

master
gaojs 7 months ago
parent
commit
27a02ecc7c
  1. 28
      src/pages/mes/workScheduling/workScheduling.vue

28
src/pages/mes/workScheduling/workScheduling.vue

@ -69,6 +69,9 @@
<u-button type="success" size="mini" @click="reportHandle(item)" class="btn" style="background-color: burlywood">报工</u-button>
<u-button type="success" size="mini" @click="completeHandle(item)" class="btn" style="background-color:chocolate">完工</u-button>
</view>
<view>
<u-button type="success" size="mini" @click="SOP(item)" class="btn" style="background-color:#888888">SOP</u-button>
</view>
</view>
<view style="height: 94rpx;padding-top: 30rpx;">
<u-loadmore :status="status" v-if="status != 'loadmore'" />
@ -333,6 +336,31 @@ function addBasicItem(item){
const objString = JSON.stringify(item);
proxy.$tab.navigateTo(`/pages/mes/workScheduling/addBasicItem/index?obj=${encodeURIComponent(objString)}`)
}
//SOP
function SOP(item){
//#ifndef H5
console.log('H5:'+item.planMasterCode)
//#endif
//#ifndef APP-PLUS
console.log('APP-PLUS:'+item.planMasterCode)
uni.downloadFile({
url: 'http://dev.ccwin-in.com:25310/admin-api/infra/file/0/show/4488ed218c1365755c97c18fcf576cf281eff8c81d052ea289b3ceea1eaf89d7.pdf',
// url: 'http://storage.xuetangx.com/public_assets/xuetangx/PDF/PlayerAPI_v1.0.6.pdf',
success: function (res) {
var filePath = res.tempFilePath;
uni.openDocument({
filePath: filePath,
fileType: 'pdf',
showMenu: true,
success: function (res) {
console.log('打开文档成功');
}
});
}
});
//#endif
}
</script>

Loading…
Cancel
Save