Commit 84c167da by 韩达

Merge branch 'feature/handa/20230527_pur_contract' into 'master'

Feature/handa/20230527 pur contract

See merge request !24
parents 968c4252 404f5404
......@@ -1757,16 +1757,6 @@
"integrity": "sha1-/q7SVZc9LndVW4PbwIhRpsY1IPo=",
"dev": true
},
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.nlark.com/ansi-styles/download/ansi-styles-4.3.0.tgz",
"integrity": "sha1-7dgDYornHATIWuegkG7a00tkiTc=",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"cacache": {
"version": "13.0.1",
"resolved": "https://registry.npm.taobao.org/cacache/download/cacache-13.0.1.tgz?cache=0&sync_timestamp=1616431156987&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcacache%2Fdownload%2Fcacache-13.0.1.tgz",
......@@ -1793,53 +1783,6 @@
"unique-filename": "^1.1.1"
}
},
"chalk": {
"version": "4.1.1",
"resolved": "https://registry.nlark.com/chalk/download/chalk-4.1.1.tgz?cache=0&sync_timestamp=1618995367379&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fchalk%2Fdownload%2Fchalk-4.1.1.tgz",
"integrity": "sha1-yAs/qyi/Y3HmhjMl7uZ+YYt35q0=",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz",
"integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz",
"integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz",
"integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/loader-utils/download/loader-utils-2.0.0.tgz?cache=0&sync_timestamp=1584445207623&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Floader-utils%2Fdownload%2Floader-utils-2.0.0.tgz",
"integrity": "sha1-5MrOW4FtQloWa18JfhDNErNgZLA=",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz?cache=0&sync_timestamp=1571657176668&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsource-map%2Fdownload%2Fsource-map-0.6.1.tgz",
......@@ -1856,16 +1799,6 @@
"minipass": "^3.1.1"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.2.0.tgz?cache=0&sync_timestamp=1618560983872&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.2.0.tgz",
"integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"terser-webpack-plugin": {
"version": "2.3.8",
"resolved": "https://registry.npm.taobao.org/terser-webpack-plugin/download/terser-webpack-plugin-2.3.8.tgz?cache=0&sync_timestamp=1610196021147&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fterser-webpack-plugin%2Fdownload%2Fterser-webpack-plugin-2.3.8.tgz",
......@@ -1882,18 +1815,6 @@
"terser": "^4.6.12",
"webpack-sources": "^1.4.3"
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.2.0",
"resolved": "https://registry.nlark.com/vue-loader/download/vue-loader-16.2.0.tgz",
"integrity": "sha1-BGpTMI3Ufljv4g3ewe3sAnzjtG4=",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
}
}
}
},
......@@ -2477,8 +2398,8 @@
},
"async-validator": {
"version": "1.8.5",
"resolved": "https://registry.nlark.com/async-validator/download/async-validator-1.8.5.tgz",
"integrity": "sha1-3D4I7B/Q3dtn5ghC8CwM0c7G1/A=",
"resolved": "https://registry.npmjs.org/async-validator/-/async-validator-1.8.5.tgz",
"integrity": "sha512-tXBM+1m056MAX0E8TL2iCjg8WvSyXu0Zc8LNtYqrVeyoL3+esHRZ4SieE9fKQyyU09uONjnMEjrNBMqT0mbvmA==",
"requires": {
"babel-runtime": "6.x"
}
......@@ -2546,8 +2467,8 @@
},
"babel-helper-vue-jsx-merge-props": {
"version": "2.0.3",
"resolved": "https://registry.npm.taobao.org/babel-helper-vue-jsx-merge-props/download/babel-helper-vue-jsx-merge-props-2.0.3.tgz",
"integrity": "sha1-Iq69OzOQIyjlEyk6jkmSs4T58bY="
"resolved": "https://registry.npmjs.org/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz",
"integrity": "sha512-gsLiKK7Qrb7zYJNgiXKpXblxbV5ffSwR0f5whkPAaBAR4fhi6bwRZxX9wBlIc5M/v8CCkXUbXZL4N/nSE97cqg=="
},
"babel-loader": {
"version": "8.2.2",
......@@ -2634,8 +2555,8 @@
},
"babel-runtime": {
"version": "6.26.0",
"resolved": "https://registry.npm.taobao.org/babel-runtime/download/babel-runtime-6.26.0.tgz",
"integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
"resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
"integrity": "sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==",
"requires": {
"core-js": "^2.4.0",
"regenerator-runtime": "^0.11.0"
......@@ -2643,13 +2564,13 @@
"dependencies": {
"core-js": {
"version": "2.6.12",
"resolved": "https://registry.nlark.com/core-js/download/core-js-2.6.12.tgz",
"integrity": "sha1-2TM9+nsGXjR8xWgiGdb2kIWcwuw="
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz",
"integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ=="
},
"regenerator-runtime": {
"version": "0.11.1",
"resolved": "https://registry.nlark.com/regenerator-runtime/download/regenerator-runtime-0.11.1.tgz",
"integrity": "sha1-vgWtf5v30i4Fb5cmzuUBf78Z4uk="
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
"integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg=="
}
}
},
......@@ -4758,18 +4679,18 @@
}
},
"echarts": {
"version": "5.1.1",
"resolved": "https://registry.nlark.com/echarts/download/echarts-5.1.1.tgz",
"integrity": "sha1-sYbxYvAXxVXP1nsS7eZ2K9w939o=",
"version": "5.4.2",
"resolved": "https://registry.npmjs.org/echarts/-/echarts-5.4.2.tgz",
"integrity": "sha512-2W3vw3oI2tWJdyAz+b8DuWS0nfXtSDqlDmqgin/lfzbkB01cuMEN66KWBlmur3YMp5nEDEEt5s23pllnAzB4EA==",
"requires": {
"tslib": "2.0.3",
"zrender": "5.1.0"
"tslib": "2.3.0",
"zrender": "5.4.3"
},
"dependencies": {
"tslib": {
"version": "2.0.3",
"resolved": "https://registry.nlark.com/tslib/download/tslib-2.0.3.tgz?cache=0&sync_timestamp=1618846758811&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ftslib%2Fdownload%2Ftslib-2.0.3.tgz",
"integrity": "sha1-jgdBrEX8DCJuWKF7/D5kubxsphw="
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
}
}
},
......@@ -4792,9 +4713,9 @@
"dev": true
},
"element-ui": {
"version": "2.15.1",
"resolved": "https://registry.nlark.com/element-ui/download/element-ui-2.15.1.tgz",
"integrity": "sha1-raAKpuMsAndKLndWPdhGaPgTzf8=",
"version": "2.15.13",
"resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.15.13.tgz",
"integrity": "sha512-LJoatEYX6WV74FqXBss8Xfho9fh9rjDSzrDrTyREdGb1h1R3uRvmLh5jqp2JU137aj4/BgqA3K06RQpQBX33Bg==",
"requires": {
"async-validator": "~1.8.1",
"babel-helper-vue-jsx-merge-props": "^2.0.0",
......@@ -8041,8 +7962,8 @@
},
"normalize-wheel": {
"version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/normalize-wheel/download/normalize-wheel-1.0.1.tgz",
"integrity": "sha1-rsiGr/2wRQcNhWRH32Ls+GFG7EU="
"resolved": "https://registry.npmjs.org/normalize-wheel/-/normalize-wheel-1.0.1.tgz",
"integrity": "sha512-1OnlAPZ3zgrk8B91HyRj+eVv+kS5u+Z0SCsak6Xil/kmgEia50ga7zfkumayonZrImffAxPU/5WcyGhzetHNPA=="
},
"npm-run-path": {
"version": "2.0.2",
......@@ -9675,8 +9596,8 @@
},
"resize-observer-polyfill": {
"version": "1.5.1",
"resolved": "https://registry.npm.taobao.org/resize-observer-polyfill/download/resize-observer-polyfill-1.5.1.tgz",
"integrity": "sha1-DpAg3T0hAkRY1OvSfiPkAmmBBGQ="
"resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz",
"integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg=="
},
"resolve": {
"version": "1.20.0",
......@@ -10886,8 +10807,8 @@
},
"throttle-debounce": {
"version": "1.1.0",
"resolved": "https://registry.npm.taobao.org/throttle-debounce/download/throttle-debounce-1.1.0.tgz?cache=0&sync_timestamp=1604313832516&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fthrottle-debounce%2Fdownload%2Fthrottle-debounce-1.1.0.tgz",
"integrity": "sha1-UYU9o3vmihVctugns1FKPEIuic0="
"resolved": "https://registry.npmjs.org/throttle-debounce/-/throttle-debounce-1.1.0.tgz",
"integrity": "sha512-XH8UiPCQcWNuk2LYePibW/4qL97+ZQ1AN3FNXwZRBNPPowo/NRU5fAlDCSNBJIYCKbioZfuYtMhG4quqoJhVzg=="
},
"through": {
"version": "2.3.8",
......@@ -11486,6 +11407,87 @@
}
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz",
"integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-router": {
"version": "3.5.1",
"resolved": "https://registry.npm.taobao.org/vue-router/download/vue-router-3.5.1.tgz?cache=0&sync_timestamp=1617697788171&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-router%2Fdownload%2Fvue-router-3.5.1.tgz",
......@@ -12414,17 +12416,17 @@
}
},
"zrender": {
"version": "5.1.0",
"resolved": "https://registry.npm.taobao.org/zrender/download/zrender-5.1.0.tgz?cache=0&sync_timestamp=1618215776804&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fzrender%2Fdownload%2Fzrender-5.1.0.tgz",
"integrity": "sha1-tqhMOqfMxmQu4FGZAcpMCDXE2F4=",
"version": "5.4.3",
"resolved": "https://registry.npmjs.org/zrender/-/zrender-5.4.3.tgz",
"integrity": "sha512-DRUM4ZLnoaT0PBVvGBDO9oWIDBKFdAVieNWxWwK0niYzJCMwGchRk21/hsE+RKkIveH3XHCyvXcJDkgLVvfizQ==",
"requires": {
"tslib": "2.0.3"
"tslib": "2.3.0"
},
"dependencies": {
"tslib": {
"version": "2.0.3",
"resolved": "https://registry.nlark.com/tslib/download/tslib-2.0.3.tgz?cache=0&sync_timestamp=1618846758811&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ftslib%2Fdownload%2Ftslib-2.0.3.tgz",
"integrity": "sha1-jgdBrEX8DCJuWKF7/D5kubxsphw="
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
}
}
}
......
......@@ -10,8 +10,8 @@
"dependencies": {
"axios": "^0.21.1",
"core-js": "^3.6.5",
"echarts": "^5.1.1",
"element-ui": "^2.15.1",
"echarts": "^5.4.2",
"element-ui": "^2.15.13",
"vue": "^2.6.11",
"vue-clipboard2": "^0.3.1",
"vue-router": "^3.2.0"
......
......@@ -17,6 +17,7 @@ switch (envs) {
case 'development':
//开发环境
NODE_ENVS = 'http://cloud.liexindev.net';
// NODE_ENVS = 'http://cloud.hd.liexinlocal.com';
NODE_ENVS_MSG = 'http://192.168.1.252:16543';
break;
case 'test':
......@@ -32,7 +33,7 @@ switch (envs) {
}
export const http = (method, url, param, loading) => {
export const http = (method, url, param, loading, responseType) => {
//axios.defaults.withCredentials = true; // 携带cookie
//loading 默认加载loading 传1 不加载
param = param && typeof param === 'object' ? param : {};
......@@ -58,6 +59,11 @@ export const http = (method, url, param, loading) => {
} else if (method === 'get' || method == 'GET') {
config.params = param;
}
if ( responseType ){
config.responseType = responseType;
}
return axios(config);
}
......
......@@ -28,6 +28,58 @@
<div class="">币种:{{ infos.currency_val }}</div>
</el-col>
</el-row>
<div class="xktitle" style="margin-bottom:10px;">合同信息</div>
<div class="operation-button row verCenter" style="margin-bottom:10px;">
<el-button type="primary" @click="downloadContract">下载猎芯合同</el-button>
<el-select v-model="selectedLang" placeholder="" style="margin-left:10px;width: 5%;">
<el-option v-for="option in langOptions" :label="option.label" :value="option.value" :key="option.value"></el-option>
</el-select>
</div>
<div class="data-box th-all" style="margin-bottom:20px;">
<el-table :data="contractData" border>
<el-table-column prop="languageType" label="语言" min-width="30"></el-table-column>
<el-table-column prop="contractSn" label="合同编号" min-width="100"></el-table-column>
<el-table-column prop="contractBuildTime" label="生成时间" min-width="80"></el-table-column>
<el-table-column label="合同附件" min-width="150">
<template slot-scope="scope">
<el-link v-if="scope.row.contractFileUrl!=''" :href=" scope.row.contractFileUrl " target="_blank">{{ scope.row.contractFileUrl }}</el-link>
</template>
</el-table-column>
<el-table-column prop="contractReturnDate" label="回传时间" width="150"></el-table-column>
<el-table-column prop="createName" label="上传人" width="120"></el-table-column>
<el-table-column fixed="right" label="操作" width="150" align="center">
<template slot-scope="scope">
<!-- 订单状态不是“完成,作废”,合同状态为有效 -->
<!-- 采购组织为“深贸电子”时,下载猎芯合同有中文,英文两种选择;列表有中文,英文两行,列表按钮分别为“上传PI,上传合同” -->
<div v-if="infos.company_id==2 && infos.status!=4 && infos.status!=-3 && scope.row.status ==1">
<el-button type="primary" v-if=" scope.row.contractFileUrl!='' " @click="delContract(scope.row)" >
<span>删除合同</span>
</el-button>
<el-upload v-else-if=" scope.row.languageType=='中文' " :headers="{ Authorization: 'Bearer ' + token }" :data="{supplier_id:supplier_id,contract_id:scope.row.contractId,type:'upload'}" :action="uploadUrl" :on-success="handleUploadSuccess" >
<el-button type="primary">上传PI</el-button>
</el-upload>
<el-upload v-else-if=" scope.row.languageType=='英文' " :headers="{ Authorization: 'Bearer ' + token }" :data="{supplier_id:supplier_id,contract_id:scope.row.contractId,type:'upload'}" :action="uploadUrl" :on-success="handleUploadSuccess" >
<el-button type="primary">上传合同</el-button>
</el-upload>
</div>
<!-- 采购组织为“猎芯科技”时,下载猎芯合同只能选择中文,列表也只有中文一行,列表按钮为“上传合同” -->
<div v-if="infos.company_id==1 && infos.status!=4 && infos.status!=-3 && scope.row.status ==1">
<el-button type="primary" v-if=" scope.row.contractFileUrl!='' " @click="delContract(scope.row)" >
<span>删除合同</span>
</el-button>
<el-upload v-else-if=" scope.row.languageType=='中文' " :headers="{ Authorization: 'Bearer ' + token }" :data="{supplier_id:supplier_id,contract_id:scope.row.contractId,type:'upload'}" :action="uploadUrl" :on-success="handleUploadSuccess" >
<el-button type="primary">上传合同</el-button>
</el-upload>
</div>
</template>
</el-table-column>
</el-table>
</div>
<div class="xktitle" style="margin-bottom:20px;">型号明细</div>
<div class="data-box th-all" v-if="tableData">
<el-table :data="tableData" border>
......@@ -49,23 +101,39 @@
</template>
<script>
import Vue from 'vue';
import Tool from '../../tool'
import Menu from "@/components/menu.vue";
import {Col, Message, Pagination, Row, Table, TableColumn} from 'element-ui'
import {Col, Message, Pagination, Row, Table, TableColumn, Select, Option, Link, Upload} from 'element-ui';
import axios from 'axios';
import {NODE_ENVS} from "../../ajax";
Vue.prototype.$message = Message;
Vue.use(Pagination);
Vue.use(TableColumn).use(Table).use(Row).use(Col);
Vue.use(TableColumn).use(Table).use(Row).use(Col).use(Select).use(Option).use(Link).use(Upload);
export default {
name: "orderTrackGoodsDetail",
data() {
return {
token: Tool.getCookie('token'),
supplier_id: 0,
infos: {},
tableData: "",
purchase_id: ""
purchase_id: "",
contractData: [],
langOptions: [],
selectedLang: '',
uploadUrl: NODE_ENVS + '/api/purContract/updateOrderContract',
fileData: {
token: this.token,
contract_id: 0,
oss_file_id: '',
},
};
},
created() {
this.getData(this.$route.query.purchase_id);
this.supplier_id = localStorage.getItem('supplier_id');
},
watch: {
$route(to, from) {
......@@ -84,9 +152,26 @@ export default {
this.$http('post', "/api/purchase/purOrderDetail", {
id: id
}).then(res => {
console.log(res);
if (res.code === 0) {
this.infos = res.data.purchase_info;
this.tableData = res.data.purchase_item_list || [];
this.contractData = res.data.pur_contract_list || [];
// 1猎芯科技,2深茂电子
if( this.infos.company_id == 1 ){
this.langOptions = [
{ label: '中文', value: 1 },
];
this.selectedLang = 1;
}else{
this.langOptions = [
{ label: '中文', value: 2 },
{ label: '英文', value: 3 },
];
this.selectedLang = 2;
}
} else {
this.$message({
message: res.msg,
......@@ -94,8 +179,76 @@ export default {
});
}
})
},
handleUploadSuccess(file, fileList) {
if (file.code === 0) {
this.$message({
message: '上传成功',
type: 'success',
});
window.location.reload();
} else {
this.$message({
message: file.msg,
type: 'warning'
});
}
},
//下载猎芯合同
downloadContract() {
// var that = this;
console.log(this.selectedLang);
let pdf_url = ""
if( this.selectedLang == 1 ){
pdf_url = "/api/purContract/pdf";
}
if( this.selectedLang == 2 ){
pdf_url = "/api/purContract/pdfHk";
}
if( this.selectedLang == 3 ){
pdf_url = "/api/purContract/pdfUs";
}
this.$http('get', pdf_url, {
id: this.$route.query.purchase_id
}, true, 'blob').then(res => {
// 包装成 Blob 对象
const blob = new Blob([res], { type: 'application/pdf' });
// 创建 URL 对象
let pdfUrl = window.URL.createObjectURL(blob);
window.open(pdfUrl, '_blank');
})
},
// 3 删除合同
delContract(contractItem){
this.$http('post', "/api/purContract/updateOrderContract", {
contract_id:contractItem.contractId,
type:'delete',
}).then(res => {
console.log(res);
if( res.code === 0 ){
this.$message({
message: '删除成功',
type: 'success',
});
window.location.reload();
}else{
this.$message({
message: file.msg,
type: 'warning'
});
}
})
},
},
components: {
Menu
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment