|
@@ -2,25 +2,18 @@
|
|
|
<view class="center">
|
|
|
<view class="c-list">
|
|
|
<view class="xinxiup">
|
|
|
- <view class="c-row b-b">
|
|
|
- <text class="tit">合同编号:</text>
|
|
|
- <view class="con-list">
|
|
|
- <text>{{goods.contractNo}}({{goods.goodsName}})</text>
|
|
|
+ <view>{{title}}</view>
|
|
|
+ <view v-for="item in list">
|
|
|
+ <view class="c-row b-b">
|
|
|
+ <text class="tit">{{item.appendixName}}</text>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- <view class="c-row b-b">
|
|
|
- <text class="tit">买方名称:</text>
|
|
|
- <view class="con-list">
|
|
|
- <text>{{goods.contracter}}</text>
|
|
|
+ <view class="c-row b-b">
|
|
|
+ <text class="tit">{{item.appendixSize}}</text>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- <view class="c-row">
|
|
|
- <text class="tit">累计收发:</text>
|
|
|
- <view class="con-list">
|
|
|
- <text style="font-size: 18px">{{sendout}}<text class="hair">发</text>{{collect}}<text
|
|
|
- class="collect">收</text></text>
|
|
|
- <!-- <text>{{goods.level}}收</text> -->
|
|
|
+ <view class="c-row b-b">
|
|
|
+ <text class="tit">{{item.appendixPath}}</text>
|
|
|
</view>
|
|
|
+ <u-button @click="download(item.appendixPath)">下载</u-button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -32,15 +25,79 @@
|
|
|
name: "trust",
|
|
|
data() {
|
|
|
return {
|
|
|
- list:[]
|
|
|
+ list:[],
|
|
|
+ title:""
|
|
|
};
|
|
|
},
|
|
|
- onLoad(addressUrl) {
|
|
|
- if(addressUrl){
|
|
|
- this.list = addressUrl.toString().split(',')
|
|
|
- console.log(this.list)
|
|
|
- }
|
|
|
+ onLoad(param) {
|
|
|
+ var that = this
|
|
|
+ this.$api.doRequest('get', '/appendix/query/getFileList', {appendixIds:param.addressUrl}).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ that.list = res.data.data
|
|
|
+ that.title = "共"+that.list.length+"个附件"
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.data.message,
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(res => {
|
|
|
+ if(res.errmsg){
|
|
|
+ uni.showToast({
|
|
|
+ title: res.errmsg,
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ uni.showToast({
|
|
|
+ title: "系统异常,请联系管理员",
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
+ methods: {
|
|
|
+ download(path){
|
|
|
+ uni.downloadFile({
|
|
|
+ url: path,
|
|
|
+ success: function (res) {
|
|
|
+ var filePath = res.tempFilePath;
|
|
|
+ uni.saveFile({
|
|
|
+ tempFilePath: filePath,
|
|
|
+ success: function (res) {
|
|
|
+ var savedFilePath = res.savedFilePath;
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '下载成功,是否打开文件?',
|
|
|
+ showCancel: true,
|
|
|
+ success: (e) => {
|
|
|
+ if (e.confirm) {
|
|
|
+ uni.openDocument({
|
|
|
+ filePath: savedFilePath,
|
|
|
+ success: function (res) {
|
|
|
+ uni.showToast({
|
|
|
+ title: "打开成功",
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: () => {},
|
|
|
+ complete: () => {}
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|