Commit 344c58c8 by liangjianmin

style: 优化代码格式,提升可读性

parent 8105f669
...@@ -44,6 +44,7 @@ const InOutStockLog = resolve => require(['@/views/consignmentManagement/inOutSt ...@@ -44,6 +44,7 @@ const InOutStockLog = resolve => require(['@/views/consignmentManagement/inOutSt
const ReconciledBill = resolve => require(['@/views/billManagement/reconciledBill.vue'], resolve); const ReconciledBill = resolve => require(['@/views/billManagement/reconciledBill.vue'], resolve);
const ReconciledBillDetail = resolve => require(['@/views/billManagement/reconciledBillDetail.vue'], resolve); const ReconciledBillDetail = resolve => require(['@/views/billManagement/reconciledBillDetail.vue'], resolve);
const AllPayableBills = resolve => require(['@/views/billManagement/allPayableBills.vue'], resolve); const AllPayableBills = resolve => require(['@/views/billManagement/allPayableBills.vue'], resolve);
const fileManagement = resolve => require(['@/views/billManagement/fileManagement.vue'], resolve);
const routes = [ const routes = [
{path: '/', name: 'Index', meta: {title: '概况'}, component: Home}, {path: '/', name: 'Index', meta: {title: '概况'}, component: Home},
...@@ -87,6 +88,7 @@ const routes = [ ...@@ -87,6 +88,7 @@ const routes = [
{path: '/reconciledBill', name: 'reconciledBill', meta: {title: '对账单'}, component: ReconciledBill}, {path: '/reconciledBill', name: 'reconciledBill', meta: {title: '对账单'}, component: ReconciledBill},
{path: '/reconciledBillDetail', name: 'reconciledBillDetail', meta: {title: '对账单详情'}, component: ReconciledBillDetail}, {path: '/reconciledBillDetail', name: 'reconciledBillDetail', meta: {title: '对账单详情'}, component: ReconciledBillDetail},
{path: '/allPayableBills', name: 'allPayableBills', meta: {title: '全部应付单'}, component: AllPayableBills}, {path: '/allPayableBills', name: 'allPayableBills', meta: {title: '全部应付单'}, component: AllPayableBills},
{path: '/fileManagement', name: 'fileManagement', meta: {title: '文件管理'}, component: fileManagement},
{path: '*', redirect: '/'} {path: '*', redirect: '/'}
] ]
......
...@@ -30,18 +30,18 @@ ...@@ -30,18 +30,18 @@
</el-row> </el-row>
<div class="xktitle" style="margin-bottom:10px;">合同信息</div> <div class="xktitle" style="margin-bottom:10px;">合同信息</div>
<div class="operation-button row verCenter" style="margin-bottom:10px;"> <div class="operation-button row verCenter" style="margin-bottom:10px;">
<el-button type="primary" @click="downloadContract">下载猎芯合同</el-button> <el-button type="primary" @click="downloadContract">下载猎芯合同</el-button>
<el-select v-model="selectedLang" placeholder="" style="margin-left:10px;width: 5%;"> <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-option v-for="option in langOptions" :label="option.label" :value="option.value" :key="option.value"></el-option>
</el-select> </el-select>
</div> </div>
<div class="data-box th-all" style="margin-bottom:20px;"> <div class="data-box th-all" style="margin-bottom:20px;">
<el-table :data="contractData" border> <el-table :data="contractData" border>
<el-table-column prop="languageType" label="语言" min-width="30"></el-table-column> <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="contractSn" label="合同编号" min-width="100"></el-table-column>
<el-table-column prop="contractBuildTime" label="生成时间" min-width="80"></el-table-column> <el-table-column prop="contractBuildTime" label="生成时间" min-width="80"></el-table-column>
<el-table-column label="合同附件" min-width="150"> <el-table-column label="合同附件" min-width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link v-if="scope.row.contractFileUrl!=''" :href=" scope.row.contractFileUrl " target="_blank">{{ scope.row.contractFileUrl }}</el-link> <el-link v-if="scope.row.contractFileUrl!=''" :href=" scope.row.contractFileUrl " target="_blank">{{ scope.row.contractFileUrl }}</el-link>
</template> </template>
...@@ -54,27 +54,27 @@ ...@@ -54,27 +54,27 @@
<!-- 采购组织为“深贸电子”时,下载猎芯合同有中文,英文两种选择;列表有中文,英文两行,列表按钮分别为“上传PI,上传合同” --> <!-- 采购组织为“深贸电子”时,下载猎芯合同有中文,英文两种选择;列表有中文,英文两行,列表按钮分别为“上传PI,上传合同” -->
<div v-if="infos.company_id==2 && infos.status!=4 && infos.status!=-3 && scope.row.status ==1"> <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)" > <el-button type="primary" v-if=" scope.row.contractFileUrl!='' " @click="delContract(scope.row)">
<span>删除合同</span> <span>删除合同</span>
</el-button> </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-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-button type="primary">上传PI</el-button>
</el-upload> </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-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-button type="primary">上传合同</el-button>
</el-upload> </el-upload>
</div> </div>
<!-- 采购组织为“猎芯科技”时,下载猎芯合同只能选择中文,列表也只有中文一行,列表按钮为“上传合同” --> <!-- 采购组织为“猎芯科技”时,下载猎芯合同只能选择中文,列表也只有中文一行,列表按钮为“上传合同” -->
<div v-if="infos.company_id==1 && infos.status!=4 && infos.status!=-3 && scope.row.status ==1"> <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)" > <el-button type="primary" v-if=" scope.row.contractFileUrl!='' " @click="delContract(scope.row)">
<span>删除合同</span> <span>删除合同</span>
</el-button> </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-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-button type="primary">上传合同</el-button>
</el-upload> </el-upload>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -127,8 +127,8 @@ export default { ...@@ -127,8 +127,8 @@ export default {
fileData: { fileData: {
token: this.token, token: this.token,
contract_id: 0, contract_id: 0,
oss_file_id: '', oss_file_id: ''
}, }
}; };
}, },
created() { created() {
...@@ -159,19 +159,19 @@ export default { ...@@ -159,19 +159,19 @@ export default {
this.contractData = res.data.pur_contract_list || []; this.contractData = res.data.pur_contract_list || [];
// 1猎芯科技,2深茂电子 // 1猎芯科技,2深茂电子
if( this.infos.company_id == 1 ){ if (this.infos.company_id == 1) {
this.langOptions = [ this.langOptions = [
{ label: '中文', value: 1 }, { label: '中文', value: 1 }
]; ];
this.selectedLang = 1; this.selectedLang = 1;
}else{ } else {
this.langOptions = [ this.langOptions = [
{ label: '中文', value: 2 }, { label: '中文', value: 2 },
{ label: '英文', value: 3 }, { label: '英文', value: 3 }
]; ];
this.selectedLang = 2; this.selectedLang = 2;
} }
} else { } else {
this.$message({ this.$message({
message: res.msg, message: res.msg,
...@@ -185,7 +185,7 @@ export default { ...@@ -185,7 +185,7 @@ export default {
if (file.code === 0) { if (file.code === 0) {
this.$message({ this.$message({
message: '上传成功', message: '上传成功',
type: 'success', type: 'success'
}); });
window.location.reload(); window.location.reload();
} else { } else {
...@@ -202,42 +202,42 @@ export default { ...@@ -202,42 +202,42 @@ export default {
console.log(this.selectedLang); console.log(this.selectedLang);
let pdf_url = "" let pdf_url = ""
if( this.selectedLang == 1 ){ if (this.selectedLang == 1) {
pdf_url = "/api/purContract/pdf"; pdf_url = "/api/purContract/pdf";
} }
if( this.selectedLang == 2 ){ if (this.selectedLang == 2) {
pdf_url = "/api/purContract/pdfHk"; pdf_url = "/api/purContract/pdfHk";
} }
if( this.selectedLang == 3 ){ if (this.selectedLang == 3) {
pdf_url = "/api/purContract/pdfUs"; pdf_url = "/api/purContract/pdfUs";
} }
this.$http('get', pdf_url, { this.$http('get', pdf_url, {
id: this.$route.query.purchase_id id: this.$route.query.purchase_id
}, true, 'blob').then(res => { }, true, 'blob').then(res => {
// 包装成 Blob 对象 // 包装成 Blob 对象
const blob = new Blob([res], { type: 'application/pdf' }); const blob = new Blob([res], { type: 'application/pdf' });
// 创建 URL 对象 // 创建 URL 对象
let pdfUrl = window.URL.createObjectURL(blob); let pdfUrl = window.URL.createObjectURL(blob);
window.open(pdfUrl, '_blank'); window.open(pdfUrl, '_blank');
}) })
}, },
// 3 删除合同 // 3 删除合同
delContract(contractItem){ delContract(contractItem) {
this.$http('post', "/api/purContract/updateOrderContract", { this.$http('post', "/api/purContract/updateOrderContract", {
contract_id:contractItem.contractId, contract_id: contractItem.contractId,
type:'delete', type: 'delete'
}).then(res => { }).then(res => {
console.log(res); console.log(res);
if( res.code === 0 ){ if (res.code === 0) {
this.$message({ this.$message({
message: '删除成功', message: '删除成功',
type: 'success', type: 'success'
}); });
window.location.reload(); window.location.reload();
}else{ } else {
this.$message({ this.$message({
message: file.msg, message: file.msg,
type: 'warning' type: 'warning'
...@@ -245,10 +245,10 @@ export default { ...@@ -245,10 +245,10 @@ export default {
} }
}) })
}, }
}, },
components: { components: {
Menu 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