Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
肖康
/
cloudSystem
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c023df18
authored
May 30, 2023
by
韩达
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
PI及合同上传、删除
parent
f9dfb9b2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
136 additions
and
21 deletions
src/ajax/index.js
src/views/OrderTrack/goodsDetail.vue
src/ajax/index.js
View file @
c023df18
...
@@ -16,8 +16,8 @@ export let NODE_ENVS_MSG = "/";//消息系统
...
@@ -16,8 +16,8 @@ export let NODE_ENVS_MSG = "/";//消息系统
switch
(
envs
)
{
switch
(
envs
)
{
case
'development'
:
case
'development'
:
//开发环境
//开发环境
NODE_ENVS
=
'http://cloud.liexindev.net'
;
//
NODE_ENVS = 'http://cloud.liexindev.net';
//
NODE_ENVS = 'http://cloud.hd.liexinlocal.com';
NODE_ENVS
=
'http://cloud.hd.liexinlocal.com'
;
NODE_ENVS_MSG
=
'http://192.168.1.252:16543'
;
NODE_ENVS_MSG
=
'http://192.168.1.252:16543'
;
break
;
break
;
case
'test'
:
case
'test'
:
...
@@ -33,7 +33,7 @@ switch (envs) {
...
@@ -33,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
//axios.defaults.withCredentials = true; // 携带cookie
//loading 默认加载loading 传1 不加载
//loading 默认加载loading 传1 不加载
param
=
param
&&
typeof
param
===
'object'
?
param
:
{};
param
=
param
&&
typeof
param
===
'object'
?
param
:
{};
...
@@ -59,6 +59,11 @@ export const http = (method, url, param, loading) => {
...
@@ -59,6 +59,11 @@ export const http = (method, url, param, loading) => {
}
else
if
(
method
===
'get'
||
method
==
'GET'
)
{
}
else
if
(
method
===
'get'
||
method
==
'GET'
)
{
config
.
params
=
param
;
config
.
params
=
param
;
}
}
if
(
responseType
){
config
.
responseType
=
responseType
;
}
return
axios
(
config
);
return
axios
(
config
);
}
}
...
...
src/views/OrderTrack/goodsDetail.vue
View file @
c023df18
...
@@ -31,24 +31,50 @@
...
@@ -31,24 +31,50 @@
<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=
"lang"
placeholder=
"中文"
style=
"margin-left:10px;width: 5%;"
>
<el-select
v-model=
"selectedLang"
placeholder=
""
style=
"margin-left:10px;width: 5%;"
>
<el-option
label=
"中文"
value=
"1"
></el-option>
<el-option
v-for=
"option in langOptions"
:label=
"option.label"
:value=
"option.value"
:key=
"option.value"
></el-option>
<el-option
label=
"英文"
value=
"2"
></el-option>
</el-select>
</el-select>
</div>
</div>
<div
class=
"data-box th-all"
style=
"margin-bottom:20px;"
v-if=
"tableData"
>
<div
class=
"data-box th-all"
style=
"margin-bottom:20px;"
>
<el-table
:data=
"tableData"
border
>
<el-table
:data=
"contractData"
border
>
<el-table-column
prop=
"quote_sn"
label=
"语言"
min-width=
"30"
></el-table-column>
<el-table-column
prop=
"languageType"
label=
"语言"
min-width=
"30"
></el-table-column>
<el-table-column
prop=
"goods_name"
label=
"合同编号"
min-width=
"100"
></el-table-column>
<el-table-column
prop=
"contractSn"
label=
"合同编号"
min-width=
"100"
></el-table-column>
<el-table-column
prop=
"brand_name"
label=
"生成时间"
min-width=
"80"
></el-table-column>
<el-table-column
prop=
"contractBuildTime"
label=
"生成时间"
min-width=
"80"
></el-table-column>
<el-table-column
prop=
"purchase_qty"
label=
"合同附件"
min-width=
"150"
></el-table-column>
<el-table-column
label=
"合同附件"
min-width=
"150"
>
<el-table-column
prop=
"price_without_tax"
label=
"回传时间"
width=
"150"
></el-table-column>
<template
slot-scope=
"scope"
>
<el-table-column
prop=
"total_amount"
label=
"上传人"
width=
"120"
></el-table-column>
<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"
>
<el-table-column
fixed=
"right"
label=
"操作"
width=
"150"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
@
click=
"handleClick(scope.row)"
type=
"primary"
size=
"mini"
class=
"yunyin-btn"
>
上传PI
</el-button>
<!-- 订单状态不是“完成,作废”,合同状态为有效 -->
<!--
<el-button
@
click=
"handleClick(scope.row)"
type=
"primary"
size=
"mini"
class=
"yunyin-btn"
>
上传合同
</el-button>
<el-button
@
click=
"handleClick(scope.row)"
type=
"primary"
size=
"mini"
class=
"yunyin-btn"
>
删除合同
</el-button>
-->
<!-- 采购组织为“深贸电子”时,下载猎芯合同有中文,英文两种选择;列表有中文,英文两行,列表按钮分别为“上传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
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -75,24 +101,54 @@
...
@@ -75,24 +101,54 @@
</template>
</template>
<
script
>
<
script
>
import
Vue
from
'vue'
;
import
Vue
from
'vue'
;
import
Tool
from
'../../tool'
import
Menu
from
"@/components/menu.vue"
;
import
Menu
from
"@/components/menu.vue"
;
import
{
Col
,
Message
,
Pagination
,
Row
,
Table
,
TableColumn
,
Select
,
Option
}
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
.
prototype
.
$message
=
Message
;
Vue
.
use
(
Pagination
);
Vue
.
use
(
Pagination
);
Vue
.
use
(
TableColumn
).
use
(
Table
).
use
(
Row
).
use
(
Col
).
use
(
Select
).
use
(
Option
);
Vue
.
use
(
TableColumn
).
use
(
Table
).
use
(
Row
).
use
(
Col
).
use
(
Select
).
use
(
Option
)
.
use
(
Link
).
use
(
Upload
)
;
export
default
{
export
default
{
name
:
"orderTrackGoodsDetail"
,
name
:
"orderTrackGoodsDetail"
,
data
()
{
data
()
{
return
{
return
{
token
:
Tool
.
getCookie
(
'token'
),
supplier_id
:
0
,
infos
:
{},
infos
:
{},
tableData
:
""
,
tableData
:
""
,
purchase_id
:
""
,
purchase_id
:
""
,
lang
:
"1"
contractData
:
[],
langOptions
:
[],
selectedLang
:
''
,
uploadUrl
:
NODE_ENVS
+
'/api/purContract/updateOrderContract'
,
fileData
:
{
token
:
this
.
token
,
contract_id
:
0
,
oss_file_id
:
''
,
},
};
};
},
},
created
()
{
created
()
{
this
.
getData
(
this
.
$route
.
query
.
purchase_id
);
this
.
getData
(
this
.
$route
.
query
.
purchase_id
);
// 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
;
}
this
.
supplier_id
=
localStorage
.
getItem
(
'supplier_id'
);
},
},
watch
:
{
watch
:
{
$route
(
to
,
from
)
{
$route
(
to
,
from
)
{
...
@@ -111,9 +167,11 @@ export default {
...
@@ -111,9 +167,11 @@ export default {
this
.
$http
(
'post'
,
"/api/purchase/purOrderDetail"
,
{
this
.
$http
(
'post'
,
"/api/purchase/purOrderDetail"
,
{
id
:
id
id
:
id
}).
then
(
res
=>
{
}).
then
(
res
=>
{
console
.
log
(
res
);
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
this
.
infos
=
res
.
data
.
purchase_info
;
this
.
infos
=
res
.
data
.
purchase_info
;
this
.
tableData
=
res
.
data
.
purchase_item_list
||
[];
this
.
tableData
=
res
.
data
.
purchase_item_list
||
[];
this
.
contractData
=
res
.
data
.
pur_contract_list
||
[];
}
else
{
}
else
{
this
.
$message
({
this
.
$message
({
message
:
res
.
msg
,
message
:
res
.
msg
,
...
@@ -123,11 +181,63 @@ export default {
...
@@ -123,11 +181,63 @@ 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
()
{
downloadContract
()
{
return
true
;
// var that = this;
console
.
log
(
this
.
selectedLang
);
this
.
$http
(
'get'
,
"/api/purContract/pdfHk"
,
{
id
:
this
.
$route
.
query
.
purchase_id
},
true
,
'blob'
).
then
(
res
=>
{
// 包装成 Blob 对象
const
blob
=
new
Blob
([
res
.
data
],
{
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
:
{
components
:
{
Menu
Menu
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment