新购验收增加验收图片补上传功能,原bug优化
This commit is contained in:
parent
d25638b07b
commit
aea375299f
|
|
@ -1,374 +1,379 @@
|
|||
import request from '@/utils/request'
|
||||
// 查询新购任务列表
|
||||
export function listPurchaseCheckInfo(query) {
|
||||
return request({
|
||||
url: '/material/purchaseCheckInfo/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseCheckInfo/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
//新增新购任务
|
||||
export function addPurchaseCheckInfo(data) {
|
||||
return request({
|
||||
url: '/material/purchaseCheckInfo',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseCheckInfo',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
//编辑新购任务
|
||||
export function updatePurchaseCheckInfo(data) {
|
||||
return request({
|
||||
url: '/material/purchaseCheckInfo',
|
||||
method: 'put',
|
||||
data: data,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseCheckInfo',
|
||||
method: 'put',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
//任务 详情
|
||||
export function getPurchaseCheckInfo(query) {
|
||||
return request({
|
||||
url: '/material/purchaseCheckInfo/getDetails',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseCheckInfo/getDetails',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
//消息通知
|
||||
export function bmNoticeInfo(data) {
|
||||
return request({
|
||||
url: '/material/purchaseCheckInfo/bmNoticeInfo',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseCheckInfo/bmNoticeInfo',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 新购验收--验收弹窗-确认验收
|
||||
export function updatePurchaseCheckDetails(data) {
|
||||
return request({
|
||||
url: '/material/purchaseCheckDetails',
|
||||
method: 'put',
|
||||
data: data,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseCheckDetails',
|
||||
method: 'put',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 新购验收-编号管理列表
|
||||
export function listPurchaseMacodeInfo(query) {
|
||||
return request({
|
||||
url: '/material/purchaseMacode/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseMacode/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function getMacodeInfo(taskId) {
|
||||
return request({
|
||||
url: '/material/purchaseMacode/' + taskId,
|
||||
method: 'get',
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseMacode/' + taskId,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
// 新购验收-编号管理-新增
|
||||
export function addPurchaseMacode(data) {
|
||||
return request({
|
||||
url: '/material/purchaseMacode',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseMacode',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
// 修改
|
||||
export function updateMacode(data) {
|
||||
return request({
|
||||
url: '/material/purchaseMacode',
|
||||
method: 'put',
|
||||
data: data,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseMacode',
|
||||
method: 'put',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
export function delMacode(taskIds) {
|
||||
return request({
|
||||
url: '/material/purchaseMacode/' + taskIds,
|
||||
method: 'delete',
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseMacode/' + taskIds,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
|
||||
//新购验收-编号管理-绑定弹窗详情列表
|
||||
export function getMacodeList(query) {
|
||||
return request({
|
||||
url: '/material/purchaseMacode/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseMacode/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
//新购验收-编号管理-绑定弹窗详情列表
|
||||
export function getMacodeDetailList(query) {
|
||||
return request({
|
||||
url: '/material/purchaseMacode/getInfo',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseMacode/getInfo',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
//新购验收-编号管理-生成编码
|
||||
export function makeEquipmentNumber(data) {
|
||||
return request({
|
||||
url: '/material/purchaseMacode/equipmentNumber',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseMacode/equipmentNumber',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
//新购验收-编号管理-保存
|
||||
export function editPurchaseMacode(data) {
|
||||
return request({
|
||||
url: '/material/purchaseMacode',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseMacode',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
export function delMacodeList(maCode) {
|
||||
return request({
|
||||
url: '/material/purchaseMacode/' + maCode,
|
||||
method: 'delete',
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseMacode/' + maCode,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
|
||||
//新购验收-验收-通知-常用人员
|
||||
export function getNoticeUserList(query) {
|
||||
return request({
|
||||
url: '/system/person/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
return request({
|
||||
url: '/system/person/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
//新购验收-验收-通知-所有人员
|
||||
export function getAllNotificationList(query) {
|
||||
return request({
|
||||
url: '/system/person/notification',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
return request({
|
||||
url: '/system/person/notification',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
//新购验收-验收-通知-常用人员-添加
|
||||
export function addNoticeUser(data) {
|
||||
return request({
|
||||
url: '/system/person',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
return request({
|
||||
url: '/system/person',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
// 删除
|
||||
export function delNoticeUser(id) {
|
||||
return request({
|
||||
url: '/system/person/' + id,
|
||||
method: 'delete',
|
||||
})
|
||||
return request({
|
||||
url: '/system/person/' + id,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
|
||||
//新购验收-入库列表
|
||||
export function getPutInList(query) {
|
||||
return request({
|
||||
url: '/material/purchaseCheckInfo/putInList',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseCheckInfo/putInList',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
export function getPutinDetailsList(query) {
|
||||
return request({
|
||||
url: '/material/purchaseMacode/putinDetails',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseMacode/putinDetails',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
// 修改状态-审核
|
||||
export function changePutinStatus(data) {
|
||||
return request({
|
||||
url: '/material/purchaseMacode/manageStatus',
|
||||
method: 'put',
|
||||
data: data,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseMacode/manageStatus',
|
||||
method: 'put',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
//新购工机具验收单
|
||||
export function getAcceptanceForm(query) {
|
||||
return request({
|
||||
url: '/material/purchaseCheckInfo/getAcceptanceForm',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseCheckInfo/getAcceptanceForm',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
//新购工机具入库单
|
||||
export function warehousingEntry(query) {
|
||||
return request({
|
||||
url: '/material/purchaseMacode/warehousingEntry',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseMacode/warehousingEntry',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
// 配件所属上级树
|
||||
export function getAccessoryTree(data) {
|
||||
return request({
|
||||
url: '/material/select/getAccessoryTree',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
return request({
|
||||
url: '/material/select/getAccessoryTree',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
// 查询新购配件列表
|
||||
export function listPurchaseAccessory(query) {
|
||||
return request({
|
||||
url: '/material/purchaseAccessory/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseAccessory/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
//新增新购配件任务
|
||||
export function addPurchaseAccessory(data) {
|
||||
return request({
|
||||
url: '/material/purchaseAccessory',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseAccessory',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
//配件任务 详情
|
||||
export function getPurchaseAccessoryDetails(query) {
|
||||
return request({
|
||||
url: '/material/purchaseAccessory/getDetails',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseAccessory/getDetails',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
//编辑新购配件任务
|
||||
export function updatePurchaseAccessory(data) {
|
||||
return request({
|
||||
url: '/material/purchaseAccessory/edit',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseAccessory/edit',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
//验收新购配件任务
|
||||
export function checkPurchaseAccessory(data) {
|
||||
return request({
|
||||
url: '/material/purchaseAccessory/check',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseAccessory/check',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
//删除新购配件任务
|
||||
export function delPurchaseAccessory(taskIds) {
|
||||
return request({
|
||||
url: '/material/purchaseAccessory/' + taskIds,
|
||||
method: 'delete',
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseAccessory/' + taskIds,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
|
||||
//配件入库 列表
|
||||
export function getPurchaseAccessoryPutInList(query) {
|
||||
return request({
|
||||
url: '/material/purchaseAccessory/putInList',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseAccessory/putInList',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
//配件入库 配件类型下拉数据
|
||||
export function getPartList(query) {
|
||||
return request({
|
||||
url: '/material/purchaseAccessory/getPartList',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseAccessory/getPartList',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
//配件入库 配件类型下拉数据
|
||||
export function getAccessoryPutInDetailList(query) {
|
||||
return request({
|
||||
url: '/material/purchaseAccessory/putinDetails',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseAccessory/putinDetails',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
//配件入库 审批操作
|
||||
export function checkInputAccessory(data) {
|
||||
return request({
|
||||
url: '/material/purchaseAccessory/checkInput',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseAccessory/checkInput',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
//新购配件验收单
|
||||
export function getAccessoryAcceptanceForm(query) {
|
||||
return request({
|
||||
url: '/material/purchaseAccessory/getAcceptanceForm',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseAccessory/getAcceptanceForm',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
//新购配件入库单
|
||||
export function accessoryWarehousingEntry(query) {
|
||||
return request({
|
||||
url: '/material/purchaseAccessory/warehousingEntry',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseAccessory/warehousingEntry',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
export function purchaseCheckInfoRemove(maCode) {
|
||||
return request({
|
||||
url: '/material/purchaseCheckInfo/' + maCode,
|
||||
method: 'delete',
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseCheckInfo/' + maCode,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
//新增计划管理
|
||||
export function addPlanManagement(data) {
|
||||
return request({
|
||||
url: '/material/planManagement/addOrUpdate',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
return request({
|
||||
url: '/material/planManagement/addOrUpdate',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
//配件入库 配件类型下拉数据
|
||||
export function getPlanList(query) {
|
||||
return request({
|
||||
url: '/material/planManagement/getList',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
return request({
|
||||
url: '/material/planManagement/getList',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
//借调操作
|
||||
export function addOrUpdateMange(data) {
|
||||
return request({
|
||||
url: '/material/planManagement/addOrUpdateMange',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
return request({
|
||||
url: '/material/planManagement/addOrUpdateMange',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
//计划借调列表
|
||||
export function getManageList(query) {
|
||||
return request({
|
||||
url: '/material/planManagement/getManageList',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
return request({
|
||||
url: '/material/planManagement/getManageList',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
//抱杆成套数据明细
|
||||
export function getWholeSetDetails(query) {
|
||||
return request({
|
||||
url: '/material/purchaseCheckInfo/wholeSetDetails',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseCheckInfo/wholeSetDetails',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
// 查看绑定编码详情
|
||||
export function getBindCodeDetails(query) {
|
||||
return request({
|
||||
url: '/material/purchaseMacode/details',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
return request({
|
||||
url: '/material/purchaseMacode/details',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
/* 9.24 新需求 验收图片补上传功能 */
|
||||
export const postAcceptImgUploadApi = (data) => {
|
||||
return request.post('/material/purchaseCheckDetails/uploadPic', data)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,114 +1,113 @@
|
|||
<template>
|
||||
<div :class="{'hidden':hidden}" class="pagination-container">
|
||||
<el-pagination
|
||||
:background="background"
|
||||
:current-page.sync="currentPage"
|
||||
:page-size.sync="pageSize"
|
||||
:layout="layout"
|
||||
:page-sizes="pageSizes"
|
||||
:pager-count="pagerCount"
|
||||
:total="total"
|
||||
v-bind="$attrs"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
<div :class="{ hidden: hidden }" class="pagination-container">
|
||||
<el-pagination
|
||||
:background="background"
|
||||
:current-page.sync="currentPage"
|
||||
:page-size.sync="pageSize"
|
||||
:layout="layout"
|
||||
:page-sizes="pageSizes"
|
||||
:pager-count="pagerCount"
|
||||
:total="total"
|
||||
v-bind="$attrs"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { scrollTo } from '@/utils/scroll-to'
|
||||
|
||||
export default {
|
||||
name: 'Pagination',
|
||||
props: {
|
||||
total: {
|
||||
required: true,
|
||||
type: Number
|
||||
name: 'Pagination',
|
||||
props: {
|
||||
total: {
|
||||
required: true,
|
||||
type: Number,
|
||||
},
|
||||
page: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
limit: {
|
||||
type: Number,
|
||||
default: 20,
|
||||
},
|
||||
pageSizes: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [10, 30, 50, 100, 200]
|
||||
},
|
||||
},
|
||||
// 移动端页码按钮的数量端默认值5
|
||||
pagerCount: {
|
||||
type: Number,
|
||||
default: document.body.clientWidth < 992 ? 5 : 7,
|
||||
},
|
||||
layout: {
|
||||
type: String,
|
||||
default: 'total, sizes, prev, pager, next, jumper',
|
||||
},
|
||||
background: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
autoScroll: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
hidden: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
page: {
|
||||
type: Number,
|
||||
default: 1
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
limit: {
|
||||
type: Number,
|
||||
default: 20
|
||||
computed: {
|
||||
currentPage: {
|
||||
get() {
|
||||
return this.page
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('update:page', val)
|
||||
},
|
||||
},
|
||||
pageSize: {
|
||||
get() {
|
||||
return this.limit
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('update:limit', val)
|
||||
},
|
||||
},
|
||||
},
|
||||
pageSizes: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [10, 20, 30, 50]
|
||||
}
|
||||
methods: {
|
||||
handleSizeChange(val) {
|
||||
if (this.currentPage * val > this.total) {
|
||||
this.currentPage = 1
|
||||
}
|
||||
this.$emit('pagination', { page: this.currentPage, limit: val })
|
||||
if (this.autoScroll) {
|
||||
scrollTo(0, 800)
|
||||
}
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.$emit('pagination', { page: val, limit: this.pageSize })
|
||||
if (this.autoScroll) {
|
||||
scrollTo(0, 800)
|
||||
}
|
||||
},
|
||||
},
|
||||
// 移动端页码按钮的数量端默认值5
|
||||
pagerCount: {
|
||||
type: Number,
|
||||
default: document.body.clientWidth < 992 ? 5 : 7
|
||||
},
|
||||
layout: {
|
||||
type: String,
|
||||
default: 'total, sizes, prev, pager, next, jumper'
|
||||
},
|
||||
background: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
autoScroll: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
hidden: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
currentPage: {
|
||||
get() {
|
||||
return this.page
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('update:page', val)
|
||||
}
|
||||
},
|
||||
pageSize: {
|
||||
get() {
|
||||
return this.limit
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('update:limit', val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSizeChange(val) {
|
||||
if (this.currentPage * val > this.total) {
|
||||
this.currentPage = 1
|
||||
}
|
||||
this.$emit('pagination', { page: this.currentPage, limit: val })
|
||||
if (this.autoScroll) {
|
||||
scrollTo(0, 800)
|
||||
}
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.$emit('pagination', { page: val, limit: this.pageSize })
|
||||
if (this.autoScroll) {
|
||||
scrollTo(0, 800)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.pagination-container {
|
||||
background: #fff;
|
||||
padding: 32px 16px;
|
||||
background: #fff;
|
||||
padding: 32px 16px;
|
||||
}
|
||||
.pagination-container.hidden {
|
||||
display: none;
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -82,37 +82,46 @@
|
|||
label="标段工程名称"
|
||||
align="center"
|
||||
prop="lotName"
|
||||
:show-overflow-tooltip="true"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="工程类型"
|
||||
align="center"
|
||||
prop="typeName"
|
||||
:show-overflow-tooltip="true"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="费用指标(元)"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template slot-scope="{ row }">
|
||||
{{ formatCurrency(row.costIndicators || '') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="所属工程项目"
|
||||
align="center"
|
||||
prop="ownPro"
|
||||
:show-overflow-tooltip="true"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="所属上级"
|
||||
align="center"
|
||||
prop="deptName"
|
||||
:show-overflow-tooltip="true"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="联系人"
|
||||
align="center"
|
||||
prop="linkMan"
|
||||
:show-overflow-tooltip="true"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="联系电话"
|
||||
align="center"
|
||||
prop="telphone"
|
||||
:show-overflow-tooltip="true"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="状态"
|
||||
|
|
@ -222,6 +231,12 @@
|
|||
@select="select"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="费用指标(元)" prop="costIndicators">
|
||||
<el-input
|
||||
v-model="form.costIndicators"
|
||||
placeholder="请输入费用指标"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人" prop="linkMan">
|
||||
<el-input
|
||||
v-model="form.linkMan"
|
||||
|
|
@ -332,6 +347,17 @@ export default {
|
|||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
costIndicators: [
|
||||
{
|
||||
required: true,
|
||||
message: '费用指标不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
pattern: /^(?:[1-9][0-9]{0,7}|100000000)$/,
|
||||
message: '请输入大于0且不能以0开头并小于一亿的正整数',
|
||||
},
|
||||
],
|
||||
// ownPro: [
|
||||
// { required: true, message: "所属工程项目", trigger: "blur" }
|
||||
// ]
|
||||
|
|
@ -406,6 +432,7 @@ export default {
|
|||
dictType: undefined,
|
||||
status: '0',
|
||||
remark: undefined,
|
||||
costIndicators: '',
|
||||
}
|
||||
this.resetForm('form')
|
||||
},
|
||||
|
|
@ -504,6 +531,10 @@ export default {
|
|||
this.$store.dispatch('dict/cleanDict')
|
||||
})
|
||||
},
|
||||
formatCurrency(amount) {
|
||||
// 将数字转为字符串,并使用正则表达式添加逗号
|
||||
return amount.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -149,12 +149,12 @@
|
|||
prop="agreementCode"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
<!-- <el-table-column
|
||||
label="合同编号"
|
||||
align="center"
|
||||
prop="contractCode"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
/> -->
|
||||
<!-- <el-table-column
|
||||
label="协议类型"
|
||||
align="center"
|
||||
|
|
@ -166,7 +166,7 @@
|
|||
<span v-if="scope.row.protocol == 2">外部单位</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
<!-- <el-table-column
|
||||
label="附件图片"
|
||||
align="center"
|
||||
prop="fileName"
|
||||
|
|
@ -187,7 +187,7 @@
|
|||
align="center"
|
||||
prop="signTime"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
/> -->
|
||||
<el-table-column
|
||||
label="往来单位"
|
||||
align="center"
|
||||
|
|
@ -200,7 +200,7 @@
|
|||
prop="projectName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
<!-- <el-table-column
|
||||
label="开始日期"
|
||||
align="center"
|
||||
prop="planStartTime"
|
||||
|
|
@ -223,11 +223,12 @@
|
|||
align="center"
|
||||
prop="phone"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
/> -->
|
||||
<el-table-column
|
||||
label="备注"
|
||||
align="center"
|
||||
prop="remark"
|
||||
width="160"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column label="操作" align="center" width="120">
|
||||
|
|
@ -275,7 +276,7 @@
|
|||
label-width="120px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="合同编号" prop="contractCode">
|
||||
<el-input
|
||||
maxlength="50"
|
||||
|
|
@ -283,7 +284,7 @@
|
|||
placeholder="请输入合同编号"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="往来单位" prop="unitId">
|
||||
<el-select
|
||||
|
|
@ -301,9 +302,6 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工程名称" prop="projectId">
|
||||
<el-select
|
||||
|
|
@ -321,7 +319,10 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
</el-row>
|
||||
|
||||
<!-- <el-row> -->
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="协议类型" prop="protocol">
|
||||
<el-select
|
||||
v-model="form.protocol"
|
||||
|
|
@ -338,7 +339,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="联系方式" prop="phone">
|
||||
<el-input
|
||||
v-model="form.phone"
|
||||
|
|
@ -347,10 +348,10 @@
|
|||
onkeyup="this.value = this.value.replace(/[^\d]/g,'');"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col> -->
|
||||
<!-- </el-row> -->
|
||||
|
||||
<el-row>
|
||||
<!-- <el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开始日期" prop="planStartTime">
|
||||
<el-date-picker
|
||||
|
|
@ -374,9 +375,9 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
|
||||
<el-row>
|
||||
<!-- <el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="签订日期" prop="signTime">
|
||||
<el-date-picker
|
||||
|
|
@ -397,10 +398,10 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="合同照片" prop="fileName">
|
||||
<el-upload
|
||||
:http-request="
|
||||
|
|
@ -422,7 +423,7 @@
|
|||
></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
|
|
@ -435,7 +436,7 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row> </el-row>
|
||||
<!-- <el-row> </el-row> -->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer" style="text-align: center">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
|
|
@ -648,7 +649,7 @@ export default {
|
|||
this.checkUrlList = []
|
||||
this.checkUrlNameList = []
|
||||
this.open = true
|
||||
this.title = '新建'
|
||||
this.title = '新建协议'
|
||||
},
|
||||
// 图片上传
|
||||
imgUpLoad(param, name, index) {
|
||||
|
|
@ -750,7 +751,7 @@ export default {
|
|||
}
|
||||
|
||||
this.open = true
|
||||
this.title = '编辑'
|
||||
this.title = '修改协议'
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
|
|
|
|||
|
|
@ -140,14 +140,27 @@
|
|||
align="center"
|
||||
prop="checkUrlName"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div
|
||||
<template slot-scope="{ row }">
|
||||
<!-- <div
|
||||
v-for="(item, index) in scope.row.imgUrlList"
|
||||
:key="index"
|
||||
@click="openImg(item)"
|
||||
style="color: #02a7f0; cursor: pointer"
|
||||
>
|
||||
{{ scope.row.imgNameList[index] }}
|
||||
</div> -->
|
||||
|
||||
<div v-if="row.previewImgLimit === 0">-</div>
|
||||
<div v-else class="accept-img">
|
||||
<a @click.prevent="onPreviewImg(row)">
|
||||
{{ row.previewImgLimit }}
|
||||
</a>
|
||||
<a
|
||||
@click.prevent="onUploadImg(row)"
|
||||
v-if="row.previewImgLimit < 5"
|
||||
class="a-two"
|
||||
>上传验收单</a
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -247,8 +260,15 @@
|
|||
:max="form.purchaseNum"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="验收图片" prop="checkUrl">
|
||||
<el-upload
|
||||
<el-form-item label="验收图片" prop="fileListNew">
|
||||
<UploadImg
|
||||
:actionUrl="actionUrl"
|
||||
:limit="5"
|
||||
:file-list="form.fileListNew"
|
||||
@remove="onHandleRemoveNew"
|
||||
@success="onHandleSuccessNew"
|
||||
/>
|
||||
<!-- <el-upload
|
||||
:http-request="(obj) => imgUpLoad(obj, 'fileUrl')"
|
||||
action="#"
|
||||
:limit="5"
|
||||
|
|
@ -261,12 +281,11 @@
|
|||
:on-remove="handleRemove"
|
||||
:before-upload="beforeUpload"
|
||||
>
|
||||
<!-- <img v-if="imageUrl" :src="uploadUrl+imageUrl" style="width: 140px;height: 140px;" class="avatar"> -->
|
||||
<i class="el-icon-plus avatar-uploader-icon"></i>
|
||||
<div class="el-upload__tip" slot="tip"
|
||||
>请上传png、jpg、jpeg类型文件,文件个数不能超过5个,且单个文件不能超过5M</div
|
||||
>
|
||||
</el-upload>
|
||||
</el-upload> -->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer" style="text-align: center">
|
||||
|
|
@ -295,8 +314,16 @@
|
|||
>
|
||||
<!-- <el-radio v-model="aform.checkResult" label="不通过">不通过</el-radio> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="验收图片" prop="checkUrl">
|
||||
<el-upload
|
||||
<el-form-item label="验收图片" prop="fileListNew">
|
||||
<UploadImg
|
||||
:actionUrl="actionUrl"
|
||||
:limit="5"
|
||||
:file-list="aform.fileListNew"
|
||||
@remove="onHandleRemoveNew"
|
||||
@success="onHandleSuccessNew"
|
||||
/>
|
||||
|
||||
<!-- <el-upload
|
||||
:http-request="(obj) => imgUpLoad(obj, 'fileUrl')"
|
||||
action="#"
|
||||
:limit="5"
|
||||
|
|
@ -309,12 +336,11 @@
|
|||
:on-remove="handleRemove"
|
||||
:before-upload="beforeUpload"
|
||||
>
|
||||
<!-- <img v-if="imageUrl" :src="uploadUrl+imageUrl" style="width: 140px;height: 140px;" class="avatar"> -->
|
||||
<i class="el-icon-plus avatar-uploader-icon"></i>
|
||||
<div class="el-upload__tip" slot="tip"
|
||||
>请上传png、jpg、jpeg类型文件,文件个数不能超过5个,且单个文件不能超过5M</div
|
||||
>
|
||||
</el-upload>
|
||||
</el-upload> -->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer" style="text-align: center">
|
||||
|
|
@ -496,6 +522,66 @@
|
|||
<el-dialog :visible.sync="dialogVisible">
|
||||
<img width="100%" height="650px" :src="dialogImageUrl" alt />
|
||||
</el-dialog>
|
||||
|
||||
<!-- 图片查看以及上传等弹框 -->
|
||||
<el-dialog
|
||||
title="验收图片详情"
|
||||
:visible.sync="acceptImgVisible"
|
||||
v-if="acceptImgVisible"
|
||||
width="40%"
|
||||
append-to-body
|
||||
>
|
||||
<el-table :data="acceptImgList" border>
|
||||
<el-table-column
|
||||
prop="img_name"
|
||||
align="center"
|
||||
label="图片名称"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="img_type"
|
||||
align="center"
|
||||
label="图片格式"
|
||||
/>
|
||||
<el-table-column align="center" label="查看">
|
||||
<template slot-scope="{ row }">
|
||||
<ImagePreview
|
||||
:src="row.img_src"
|
||||
:width="`40px`"
|
||||
:height="`40px`"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 上传弹框 -->
|
||||
<el-dialog
|
||||
title="验收图片上传"
|
||||
:visible.sync="acceptImgUploadVisible"
|
||||
v-if="acceptImgUploadVisible"
|
||||
width="60%"
|
||||
append-to-body
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="3" class="left-tip"> 请上传验收图片 </el-col>
|
||||
<el-col :span="21">
|
||||
<UploadImg
|
||||
:actionUrl="actionUrl"
|
||||
:limit="imgLimit"
|
||||
:file-list="fileListNew"
|
||||
@remove="onHandleRemove"
|
||||
@success="onHandleSuccess"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row style="text-align: right">
|
||||
<el-button size="small" type="primary" @click="onSubmit"
|
||||
>确 定</el-button
|
||||
>
|
||||
<el-button size="small" @click="onCancel">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -516,12 +602,17 @@ import {
|
|||
getAllNotificationList,
|
||||
addNoticeUser,
|
||||
delNoticeUser,
|
||||
postAcceptImgUploadApi,
|
||||
} from '@/api/store/newBuy'
|
||||
import { imgUpLoad, fileUpLoad } from '@/api/system/upload'
|
||||
import UploadImg from './upload-img.vue'
|
||||
|
||||
export default {
|
||||
name: 'NewDevicesAccept',
|
||||
dicts: ['sys_normal_disable'],
|
||||
components: {
|
||||
UploadImg,
|
||||
},
|
||||
props: {
|
||||
isView: {
|
||||
type: Boolean,
|
||||
|
|
@ -619,6 +710,14 @@ export default {
|
|||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
|
||||
fileListNew: [
|
||||
{
|
||||
required: true,
|
||||
message: '验收图片不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
// 表单参数
|
||||
aform: {},
|
||||
|
|
@ -654,6 +753,22 @@ export default {
|
|||
],
|
||||
},
|
||||
deptName: undefined,
|
||||
|
||||
/* 验收图片等数据源 */
|
||||
acceptImgVisible: false,
|
||||
acceptImgUploadVisible: false,
|
||||
fileListNew: [],
|
||||
actionUrl: process.env.VUE_APP_BASE_API + '/system/sys/file/upload',
|
||||
/* 参数 */
|
||||
uploadImgParams: {
|
||||
id: '',
|
||||
checkUrlName: '',
|
||||
checkUrl: '',
|
||||
},
|
||||
acceptImgList: [],
|
||||
checkUrlNew: '',
|
||||
checkUrlNameNew: '',
|
||||
imgLimit: 1,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -692,6 +807,9 @@ export default {
|
|||
if (item.checkUrl) {
|
||||
item.imgUrlList = item.checkUrl.split(',')
|
||||
item.imgNameList = item.checkUrlName.split(',')
|
||||
item.previewImgLimit = item.checkUrl.split(',').length
|
||||
} else {
|
||||
item.previewImgLimit = 0
|
||||
}
|
||||
})
|
||||
this.loading = false
|
||||
|
|
@ -717,6 +835,7 @@ export default {
|
|||
checkResult: '通过',
|
||||
inputNum: undefined,
|
||||
checkUrl: undefined,
|
||||
fileListNew: [],
|
||||
}
|
||||
this.imageUrl = ''
|
||||
this.resetForm('form')
|
||||
|
|
@ -864,6 +983,7 @@ export default {
|
|||
this.$set(this.form, 'checkNum', row.purchaseNum)
|
||||
this.$set(this.form, 'checkUrl', '')
|
||||
this.$set(this.form, 'checkUrlName', '')
|
||||
this.$set(this.form, 'fileListNew', [])
|
||||
this.fileList = []
|
||||
this.checkUrlList = []
|
||||
this.checkUrlNameList = []
|
||||
|
|
@ -880,6 +1000,7 @@ export default {
|
|||
checkResult: '通过',
|
||||
checkUrl: '',
|
||||
checkUrlName: '',
|
||||
fileListNew: [],
|
||||
}
|
||||
this.imageUrl = ''
|
||||
this.openAll = true
|
||||
|
|
@ -888,8 +1009,18 @@ export default {
|
|||
/** 提交按钮 */
|
||||
submitForm: function () {
|
||||
// console.log(this.form)
|
||||
this.form.checkUrl = this.checkUrlList.join(',')
|
||||
this.form.checkUrlName = this.checkUrlNameList.join(',')
|
||||
// this.form.checkUrl = this.checkUrlList.join(',')
|
||||
// this.form.checkUrlName = this.checkUrlNameList.join(',')
|
||||
|
||||
let fileUrl = ''
|
||||
let fileName = ''
|
||||
|
||||
this.form.fileListNew.forEach((e) => {
|
||||
fileUrl += e.fileUrl + ','
|
||||
fileName += e.fileName + ','
|
||||
})
|
||||
this.form.checkUrl = fileUrl.slice(0, -1)
|
||||
this.form.checkUrlName = fileName.slice(0, -1)
|
||||
let equipments = [this.form]
|
||||
console.log(equipments)
|
||||
this.$refs['form'].validate((valid) => {
|
||||
|
|
@ -911,20 +1042,27 @@ export default {
|
|||
})
|
||||
},
|
||||
submitListForm: function () {
|
||||
// console.log(this.aform)
|
||||
this.aform.checkUrl = this.checkUrlList1.join(',')
|
||||
this.aform.checkUrlName = this.checkUrlNameList1.join(',')
|
||||
this.ids.forEach((item) => {
|
||||
item.checkNum = item.purchaseNum
|
||||
item.checkResult = this.aform.checkResult
|
||||
item.checkUrl = this.aform.checkUrl
|
||||
item.checkUrlName = this.aform.checkUrlName
|
||||
let fileUrl = ''
|
||||
let fileName = ''
|
||||
this.aform.fileListNew.map((e) => {
|
||||
fileUrl += e.fileUrl + ','
|
||||
fileName += e.fileName + ','
|
||||
})
|
||||
// console.log(this.ids)
|
||||
let equipments = this.ids
|
||||
console.log(equipments)
|
||||
this.aform.checkUrl = fileUrl.substring(fileUrl.length - 1, ',')
|
||||
this.aform.checkUrlName = fileName.substring(
|
||||
fileName.length - 1,
|
||||
',',
|
||||
)
|
||||
this.$refs['aform'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.ids.forEach((item) => {
|
||||
item.checkNum = item.purchaseNum
|
||||
item.checkResult = this.aform.checkResult
|
||||
item.checkUrl = this.aform.checkUrl
|
||||
item.checkUrlName = this.aform.checkUrlName
|
||||
})
|
||||
|
||||
let equipments = this.ids
|
||||
updatePurchaseCheckDetails(equipments).then((response) => {
|
||||
if (response.code == 200) {
|
||||
this.$message({
|
||||
|
|
@ -1039,6 +1177,100 @@ export default {
|
|||
}
|
||||
return isLt5M
|
||||
},
|
||||
|
||||
/* 查看图片详情 */
|
||||
onPreviewImg(row) {
|
||||
let previewImgList = []
|
||||
previewImgList = row.imgUrlList.map((e) => {
|
||||
return {
|
||||
img_src: e,
|
||||
img_name: '',
|
||||
img_type: '',
|
||||
}
|
||||
})
|
||||
row.imgNameList.forEach((e, index) => {
|
||||
previewImgList[index].img_name = e.split('.')[0]
|
||||
previewImgList[index].img_type = e.split('.')[1]
|
||||
})
|
||||
this.acceptImgList = previewImgList
|
||||
this.acceptImgVisible = true
|
||||
},
|
||||
/* 上传图片 */
|
||||
onUploadImg(row) {
|
||||
this.imgLimit = 5 - row.previewImgLimit
|
||||
this.uploadImgParams.id = row.id
|
||||
this.checkUrlNew = row.checkUrl
|
||||
this.checkUrlNameNew = row.checkUrlName
|
||||
this.acceptImgUploadVisible = true
|
||||
},
|
||||
|
||||
/* 移除文件 */
|
||||
onHandleRemove(file) {
|
||||
if (file.response) {
|
||||
this.fileListNew = this.fileListNew.filter(
|
||||
(e) => e.id !== file.response.data.id,
|
||||
)
|
||||
}
|
||||
},
|
||||
/* 文件上传成功 */
|
||||
onHandleSuccess(res, file) {
|
||||
if (res.code === 200) {
|
||||
console.log(file.response, '---')
|
||||
this.fileListNew.push(file.response.data)
|
||||
}
|
||||
},
|
||||
/* 确定按钮 */
|
||||
async onSubmit() {
|
||||
if (this.fileListNew.length < 1) {
|
||||
this.$message.closeAll()
|
||||
this.$message.error('请上传图片!')
|
||||
return
|
||||
}
|
||||
let fileName = ''
|
||||
let fileUrl = ''
|
||||
this.fileListNew.forEach((e) => {
|
||||
fileName += e.fileName + ','
|
||||
fileUrl += e.fileUrl + ','
|
||||
})
|
||||
this.uploadImgParams.checkUrlName = `${
|
||||
this.checkUrlNameNew
|
||||
},${fileName.slice(0, -1)}`
|
||||
this.uploadImgParams.checkUrl = `${
|
||||
this.checkUrlNew
|
||||
},${fileUrl.slice(0, -1)}`
|
||||
const res = await postAcceptImgUploadApi(this.uploadImgParams)
|
||||
if (res.code === 200) {
|
||||
this.$message.success('上传成功!')
|
||||
this.acceptImgUploadVisible = false
|
||||
this.fileListNew = []
|
||||
this.getTaskInfo()
|
||||
}
|
||||
},
|
||||
/* 取消按钮 */
|
||||
onCancel() {
|
||||
this.acceptImgUploadVisible = false
|
||||
this.fileListNew = []
|
||||
},
|
||||
|
||||
onHandleRemoveNew(file) {
|
||||
if (this.open && file.response) {
|
||||
this.form.fileListNew = this.form.fileListNew.filter(
|
||||
(e) => e.id !== file.response.data.id,
|
||||
)
|
||||
}
|
||||
},
|
||||
onHandleSuccessNew(res, file) {
|
||||
if (res.code === 200) {
|
||||
if (this.openAll) {
|
||||
this.aform.fileListNew.push(file.response.data)
|
||||
this.$refs.aform.clearValidate('fileListNew')
|
||||
}
|
||||
if (this.open) {
|
||||
this.form.fileListNew.push(file.response.data)
|
||||
this.$refs.form.clearValidate('fileListNew')
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
@ -1053,4 +1285,17 @@ export default {
|
|||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.accept-img {
|
||||
color: #409eff;
|
||||
|
||||
.a-two {
|
||||
margin-left: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.left-tip {
|
||||
font-size: 16px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,88 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-upload
|
||||
multiple
|
||||
:limit="limit"
|
||||
:headers="headers"
|
||||
:data="uploadData"
|
||||
:action="actionUrl"
|
||||
:file-list="fileList"
|
||||
:on-exceed="handleExceed"
|
||||
:on-remove="handleRemove"
|
||||
:on-success="handleSuccess"
|
||||
:before-upload="beforeUpload"
|
||||
list-type="picture-card"
|
||||
>
|
||||
<i class="el-icon-plus avatar-uploader-icon"></i>
|
||||
<div class="el-upload__tip" slot="tip"
|
||||
>请上传png、jpg、jpeg类型文件,文件个数不能超过
|
||||
{{ limit }} 个,且单个文件不能超过5M</div
|
||||
>
|
||||
</el-upload>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getToken } from '@/utils/auth'
|
||||
export default {
|
||||
props: {
|
||||
limit: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
actionUrl: {
|
||||
type: String,
|
||||
default: '#',
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
fileList: [],
|
||||
headers: {
|
||||
Authorization: 'Bearer ' + getToken(),
|
||||
},
|
||||
uploadData: {
|
||||
fileType: 'ma',
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleRemove(file) {
|
||||
this.$emit('remove', file)
|
||||
},
|
||||
handleSuccess(response, file) {
|
||||
this.$emit('success', response, file)
|
||||
},
|
||||
handleExceed() {
|
||||
this.$message.error(`最多只能上传${this.limit}个文件!`)
|
||||
},
|
||||
beforeUpload(file) {
|
||||
const isJPGorPNG =
|
||||
file.type == 'image/png' ||
|
||||
file.type == 'image/jpg' ||
|
||||
file.type == 'image/jpeg'
|
||||
const isLt5M = file.size / 1024 / 1024 < 5 // 小于 5MB
|
||||
if (!isJPGorPNG) {
|
||||
this.$message.error('只能上传 jpg、jpeg、png 、 格式的文件!')
|
||||
}
|
||||
if (!isLt5M) {
|
||||
this.$message.error('上传图片大小不能超过 5MB')
|
||||
}
|
||||
return isJPGorPNG && isLt5M
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
::v-deep .el-upload {
|
||||
width: 140px;
|
||||
height: 140px;
|
||||
line-height: 150px;
|
||||
}
|
||||
.el-upload__tip {
|
||||
font-size: 16px;
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -71,7 +71,6 @@ export default {
|
|||
/* 查询工机具 */
|
||||
queryTools(taskId) {
|
||||
this.isView = true
|
||||
|
||||
this.pageContent = '详情信息'
|
||||
this.queryTaskId = taskId
|
||||
this.isShowComponent = 'QueryTools'
|
||||
|
|
|
|||
Loading…
Reference in New Issue