20 changed files with 7389 additions and 0 deletions
-
19src/api/machine/machineProject.js
-
32src/api/machine/machineProjectIncome.js
-
3src/api/orderIssure/soIssueNotify.js
-
3src/api/user.js
-
144src/components/selector/user/userChooseComponent.vue
-
1314src/views/modules/auth/authMachineProject.vue
-
924src/views/modules/machine/machineProject.vue
-
544src/views/modules/machine/machineProjectDetail.vue
-
145src/views/modules/machine/modules/machineProjectAuthTable.vue
-
230src/views/modules/machine/modules/machineProjectCloseAuthForm.vue
-
150src/views/modules/machine/modules/machineProjectCloseTable.vue
-
255src/views/modules/machine/modules/machineProjectDetailForm.vue
-
340src/views/modules/machine/modules/machineProjectForm.vue
-
240src/views/modules/machine/modules/machineProjectIncomeTable.vue
-
214src/views/modules/machine/modules/machineProjectPlanDetailForm.vue
-
263src/views/modules/machine/modules/machineProjectPlanTable.vue
-
190src/views/modules/machine/modules/machineProjectTaskDetailForm.vue
-
262src/views/modules/machine/modules/machineProjectTaskTable.vue
-
1776src/views/modules/orderIssure/soIssueNotify/searchConfirmIssureNotify.vue
-
341src/views/modules/oss/ossProjectComponents.vue
@ -0,0 +1,19 @@ |
|||||
|
import {createAPI} from "../../utils/httpRequest"; |
||||
|
|
||||
|
export const queryMachinePage = (data) => createAPI(`/machine/project/machineList`,'get',data) |
||||
|
|
||||
|
export const queryMachineList = (data) => createAPI(`/quote`,'post',data) |
||||
|
export const saveMachine = (data) => createAPI(`/machine/project/machineAdd`,'post',data) |
||||
|
|
||||
|
export const updateMachine = (data) => createAPI(`/machine/project/machineEdit`,'put',data) |
||||
|
export const getMachineById = (data) => createAPI(`/machine/project/getMachineById`,'get',data) |
||||
|
|
||||
|
|
||||
|
export const machineDelete = (data) => createAPI(`/machine/project/machineDelete/${data.id}`,'post',data) |
||||
|
|
||||
|
export const projectUpdateStatus = (data) => createAPI(`/machine/project/machineProjectUpdateStatus`,'post',data) |
||||
|
export const searchUserAuthMachineProjectApplicationInfo = (data) => createAPI(`/machine/project/searchUserAuthMachineProjectApplicationInfo`,'get',data) |
||||
|
export const updateProjectAuthHist = data => createAPI(`/machine/project/updateProjectAuthHist`,'post',data) |
||||
|
export const queryMachineProjectAuthList = data => createAPI(`/machine/project/searchMachineProjectAuthRecords`,'get',data) |
||||
|
|
||||
|
export const sendTextLoraWatch = data => createAPI(`/pms/eam/sendTextLoraWatch`,'post',data) |
||||
@ -0,0 +1,32 @@ |
|||||
|
import { createAPI } from "../../utils/httpRequest"; |
||||
|
|
||||
|
export const queryMachineProjectIncomeList = (data) => createAPI(`/machine/projectIncome/incomeList`, 'get', data) |
||||
|
export const saveMachineProjectIncome = (data) => createAPI(`/machine/projectIncome/projectIncomeAdd`, 'post', data) |
||||
|
export const updateMachineProjectIncome = (data) => createAPI(`/machine/projectIncome/projectIncomeEdit`, 'put', data) |
||||
|
export const deleteProjectIncome = (data) => createAPI(`/machine/projectIncome/projectIncomeDelete/${data.id}`,'post',data) |
||||
|
|
||||
|
export const queryMachineProjectPlanList = (data) => createAPI(`/machine/projectPlan/planList`, 'get', data) |
||||
|
export const saveMachineProjectPlan = (data) => createAPI(`/machine/projectPlan/projectPlanAdd`, 'post', data) |
||||
|
export const updateMachineProjectPlan = (data) => createAPI(`/machine/projectPlan/projectPlanEdit`, 'put', data) |
||||
|
export const deleteProjectPlan = (data) => createAPI(`/machine/projectPlan/projectPlanDelete/${data.id}`,'post',data) |
||||
|
|
||||
|
export const queryMachineProjectTaskList = (data) => createAPI(`/machine/projectTask/taskList`, 'get', data) |
||||
|
export const saveMachineProjectTask = (data) => createAPI(`/machine/projectTask/projectTaskAdd`, 'post', data) |
||||
|
export const updateMachineProjectTask = (data) => createAPI(`/machine/projectTask/projectTaskEdit`, 'put', data) |
||||
|
export const deleteProjectTask = (data) => createAPI(`/machine/projectTask/projectTaskDelete/${data.id}`,'post',data) |
||||
|
|
||||
|
|
||||
|
export const queryMachineProjectCloseList = (data) => createAPI(`/machine/projectClose/closeList`, 'get', data) |
||||
|
export const saveMachineProjectClose = (data) => createAPI(`/machine/projectClose/projectCloseAdd`, 'post', data) |
||||
|
export const updateMachineProjectClose = (data) => createAPI(`/machine/projectClose/projectCloseEdit`, 'put', data) |
||||
|
export const deleteProjectClose = (data) => createAPI(`/machine/projectClose/projectCloseDelete/${data.id}`,'post',data) |
||||
|
export const projectCloseAuthSearch = data => createAPI(`/machine/projectClose/projectCloseAuthSearch`,'post',data) |
||||
|
export const saveBatchProjectClose = (data) => createAPI(`/machine/projectClose/saveBatchProjectClose`, 'post', data) |
||||
|
export const projectCloseUpdateStatus = (data) => createAPI(`/machine/projectClose/projectCloseUpdateStatus`, 'post', data) |
||||
|
|
||||
|
export const currencyList = (data) => createAPI(`/currency/queryList`, 'post', data) |
||||
|
|
||||
|
export const projectIncomeUpload = (data) => createAPI(`/machine/projectIncome/upload`,'post',data) |
||||
|
export const projectIncomeQueryOss = (data) => createAPI(`/machine/projectIncome/queryOssFile`,'post',data) |
||||
|
|
||||
|
|
||||
@ -0,0 +1,144 @@ |
|||||
|
<template> |
||||
|
<el-dialog :title="title" v-drag :visible.sync="openVisible" :append-to-body='true' :close-on-click-modal="false" |
||||
|
width="800px"> |
||||
|
<el-form :model="user" label-position="top"> |
||||
|
<el-row :gutter="10"> |
||||
|
<el-col :span="4"> |
||||
|
<el-form-item label="用户编号"> |
||||
|
<el-input v-model="user.username"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="4"> |
||||
|
<el-form-item label="用户描述"> |
||||
|
<el-input v-model="user.userDisplay"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="4"> |
||||
|
<el-form-item label="是否在用" style="width: 100%;"> |
||||
|
<el-select v-model="user.status"> |
||||
|
<el-option label="全部" value=""></el-option> |
||||
|
<el-option label="在用" value="1"></el-option> |
||||
|
<el-option label="停用" value="0"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label=" "> |
||||
|
<el-button type="primary" v-if="isPage" @click="handleQueryUserByPage">查询</el-button> |
||||
|
<el-button type="primary" v-else @click="handleQueryUserList">查询</el-button> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<el-table v-loading="queryLoading" :data="dataList" style="width: 100%" :height="height" border |
||||
|
@row-dblclick="handleDblClick" @header-dragend="handleColumnResize"> |
||||
|
<el-table-column label="用户编号" prop="username"></el-table-column> |
||||
|
<el-table-column label="用户描述" prop="userDisplay"></el-table-column> |
||||
|
<el-table-column label="用户状态" prop="statusType"></el-table-column> |
||||
|
</el-table> |
||||
|
<el-pagination v-if="isPage" @size-change="handleSizeChange" @current-change="handlePageChange" |
||||
|
:current-page="current" :page-sizes="[20, 50, 100, 200, 500]" :page-size="size" :total="total" |
||||
|
layout="total,sizes, prev, pager, next, jumper"> |
||||
|
</el-pagination> |
||||
|
</el-dialog> |
||||
|
</template> |
||||
|
<script> |
||||
|
import { |
||||
|
userChooseComponentList, |
||||
|
userChooseComponentPage, |
||||
|
} from '../../../api/user' |
||||
|
|
||||
|
export default { |
||||
|
name: 'userChooseComponent', |
||||
|
model: {}, |
||||
|
props: { |
||||
|
isPage: { |
||||
|
type: Boolean, |
||||
|
default: false, |
||||
|
}, |
||||
|
title: { |
||||
|
type: String, |
||||
|
default: '', |
||||
|
}, |
||||
|
height: { |
||||
|
type: [Number, String], |
||||
|
default: 300, |
||||
|
}, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
user: { |
||||
|
userNo: '', |
||||
|
userDesc: '', |
||||
|
status: '', |
||||
|
}, |
||||
|
dataList: [], |
||||
|
current: 1, |
||||
|
size: 20, |
||||
|
total: 0, |
||||
|
queryLoading: false, |
||||
|
openVisible: false, |
||||
|
} |
||||
|
}, |
||||
|
watch: {}, |
||||
|
computed: {}, |
||||
|
created() {}, |
||||
|
methods: { |
||||
|
userInit() { |
||||
|
this.openVisible = true |
||||
|
this.getUserList() |
||||
|
}, |
||||
|
handleColumnResize(newWidth, oldWidth, column, event) { |
||||
|
let inData = this.columnList.filter( |
||||
|
(item) => item.columnProp === column.property |
||||
|
)[0] |
||||
|
inData.columnWidth = newWidth |
||||
|
updateColumnSize(inData).then(({ data }) => { |
||||
|
if (data.code === 0) { |
||||
|
console.log('栏位宽度保存成功!') |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
getUserList() { |
||||
|
if (this.isPage) { |
||||
|
this.handleQueryUserByPage() |
||||
|
} else { |
||||
|
this.handleQueryUserList() |
||||
|
} |
||||
|
}, |
||||
|
handleQueryUserByPage() { |
||||
|
this.user.pageSize = this.pageSize |
||||
|
this.user.pageIndex = this.pageIndex |
||||
|
this.user.site = this.$store.state.user.site |
||||
|
this.queryLoading = true |
||||
|
userChooseComponentPage(this.user) |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.dataList = data.page.records |
||||
|
this.pageIndex = data.page.current |
||||
|
this.pageSize = data.page.size |
||||
|
this.totalPage = data.page.total |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
this.queryLoading = false |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.error(error) |
||||
|
this.queryLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
handleQueryUserList() { |
||||
|
this.user.site = this.$store.state.user.site |
||||
|
userChooseComponentList(this.user).then((res) => { |
||||
|
if (res && res.data.code === 0) { |
||||
|
this.$set(this, 'dataList', res.data.list) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
handleDblClick(row) { |
||||
|
this.$emit('selectFinish', row) |
||||
|
}, |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
1314
src/views/modules/auth/authMachineProject.vue
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,924 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<!-- <el-form :model="queryForm" label-position="top" label-width="100px" style="max-width: 1100px">--> |
||||
|
<!-- <el-row :gutter="15">--> |
||||
|
<!-- <el-col :span="3">--> |
||||
|
<!-- <el-form-item label="申请批次号">--> |
||||
|
<!-- <el-input v-model="queryForm.quotationBatchNo"></el-input>--> |
||||
|
<!-- </el-form-item>--> |
||||
|
<!-- </el-col>--> |
||||
|
<!-- <el-col :span="3">--> |
||||
|
<!-- <el-form-item label="客户编码" v-if="!isComponent">--> |
||||
|
<!-- <el-input v-model="queryForm.customerNo"></el-input>--> |
||||
|
<!-- </el-form-item>--> |
||||
|
<!-- </el-col>--> |
||||
|
<!-- <el-col :span="3">--> |
||||
|
<!-- <el-form-item label="客户名称" v-if="!isComponent">--> |
||||
|
<!-- <el-input v-model="queryForm.customerDesc"></el-input>--> |
||||
|
<!-- </el-form-item>--> |
||||
|
<!-- </el-col>--> |
||||
|
<!-- <el-col :span="3">--> |
||||
|
<!-- <el-form-item label="项目料号" v-if="!isComponent">--> |
||||
|
<!-- <el-input v-model="queryForm.partNo"></el-input>--> |
||||
|
<!-- </el-form-item>--> |
||||
|
<!-- </el-col>--> |
||||
|
<!-- <el-col :span="3">--> |
||||
|
<!-- <el-form-item label="物料描述" v-if="!isComponent">--> |
||||
|
<!-- <el-input v-model="queryForm.partDesc"></el-input>--> |
||||
|
<!-- </el-form-item>--> |
||||
|
<!-- </el-col>--> |
||||
|
<!-- <el-col :span="6" v-if="!isComponent">--> |
||||
|
<!-- <el-form-item label="要求完成日期">--> |
||||
|
<!-- <div style="display: flex">--> |
||||
|
<!-- <el-date-picker style="width: 47%" v-model="queryForm.startDate" type="date" value-format='yyyy-MM-dd' format='yyyy-MM-dd'></el-date-picker>--> |
||||
|
<!-- <div style="width: 6%;text-align: center">-</div>--> |
||||
|
<!-- <el-date-picker style="width: 47%" v-model="queryForm.endDate" type="date" value-format='yyyy-MM-dd' format='yyyy-MM-dd'></el-date-picker>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- </el-form-item>--> |
||||
|
<!-- </el-col>--> |
||||
|
<!-- <el-col :span="3" v-if="!isComponent">--> |
||||
|
<!-- <el-form-item label=" ">--> |
||||
|
|
||||
|
<!-- </el-form-item>--> |
||||
|
<!-- </el-col>--> |
||||
|
<!-- <el-col :span="3">--> |
||||
|
<!-- <el-form-item label="批次序号">--> |
||||
|
<!-- <el-input-number :controls="false" :min="0" style="width: 100%" v-model="queryForm.quotationItemNo"></el-input-number>--> |
||||
|
<!-- </el-form-item>--> |
||||
|
<!-- </el-col>--> |
||||
|
<!-- <el-col :span="3">--> |
||||
|
<!-- <el-form-item label="项目编码">--> |
||||
|
<!-- <el-input v-model="queryForm.projectNo"></el-input>--> |
||||
|
<!-- </el-form-item>--> |
||||
|
<!-- </el-col>--> |
||||
|
<!-- <el-col :span="3">--> |
||||
|
<!-- <el-form-item label="项目名称">--> |
||||
|
<!-- <el-input v-model="queryForm.projectDesc"></el-input>--> |
||||
|
<!-- </el-form-item>--> |
||||
|
<!-- </el-col>--> |
||||
|
<!-- <el-col :span="3">--> |
||||
|
<!-- <el-form-item label="报价专员" v-if="!isComponent">--> |
||||
|
<!-- <el-input v-model="queryForm.quoterName"></el-input>--> |
||||
|
<!-- </el-form-item>--> |
||||
|
<!-- </el-col>--> |
||||
|
<!-- <el-col :span="3">--> |
||||
|
<!-- <el-form-item label="优先等级" v-if="!isComponent">--> |
||||
|
<!-- <dict-data-select v-model="queryForm.priorityLevel" clearable :use-default-value="false" dict-type="priority_Level"/>--> |
||||
|
<!-- </el-form-item>--> |
||||
|
<!-- </el-col>--> |
||||
|
<!-- <el-col :span="3">--> |
||||
|
<!-- <el-form-item :label="'状态'">--> |
||||
|
<!-- <el-select v-model="queryForm.quotationStatus" style="width: 100%">--> |
||||
|
<!-- <el-option label="全部" value=""></el-option>--> |
||||
|
<!-- <el-option label="草稿" value="草稿"></el-option>--> |
||||
|
<!-- <el-option label="下达" value="下达"></el-option>--> |
||||
|
<!-- </el-select>--> |
||||
|
<!-- </el-form-item>--> |
||||
|
<!-- </el-col>--> |
||||
|
<!-- <el-col :span="3">--> |
||||
|
<!-- <el-form-item label=" ">--> |
||||
|
<!-- <el-button type="primary" @click="handleQuery">查询</el-button>--> |
||||
|
<!-- </el-form-item>--> |
||||
|
<!-- </el-col>--> |
||||
|
<!-- </el-row>--> |
||||
|
<!-- </el-form>--> |
||||
|
<!-- 查询条件 --> |
||||
|
<el-form :inline="true" label-position="top" :model="queryForm" @keyup.enter.native="handleQuery()"> |
||||
|
<el-form-item :label="'BU'"> |
||||
|
<el-select v-model="queryForm.buNo" placeholder="请选择" clearable style="width: 120px"> |
||||
|
<el-option label="全部" value=""></el-option> |
||||
|
<el-option v-for="i in userBuList" :key="i.buNo" :label="i.buDesc" :value="i.buNo"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="项目编码"> |
||||
|
<el-input v-model="queryForm.projectNo" clearable style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="项目名称"> |
||||
|
<el-input v-model="queryForm.projectName" clearable style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'状态'"> |
||||
|
<el-select v-model="queryForm.sstatus" style="width: 120px"> |
||||
|
<el-option label="全部" value=""></el-option> |
||||
|
<el-option label="草稿" value="草稿"></el-option> |
||||
|
<el-option label="审核中" value="审核中"></el-option> |
||||
|
<el-option label="已驳回" value="已驳回"></el-option> |
||||
|
<el-option label="进行中" value="进行中"></el-option> |
||||
|
<el-option label="结案" value="结案"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<!-- <el-form-item :label="'PjM'"> |
||||
|
<span style="cursor: pointer" slot="label" @click="getBaseList(2004,1)"><a herf="#">PjM</a></span> |
||||
|
<el-input v-model="queryForm.requesterName" clearable style="width: 120px"></el-input> |
||||
|
</el-form-item> --> |
||||
|
<el-form-item :label="'开始时间'"> |
||||
|
<el-date-picker style="width: 120px" v-model="queryForm.startDate" type="date" value-format="yyyy-MM-dd" |
||||
|
placeholder="选择日期"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label=" "> |
||||
|
<div style="text-align: center;"><i class="el-icon-right"></i></div> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="' '"> |
||||
|
<el-date-picker style="width: 120px" v-model="queryForm.endDate" type="date" value-format="yyyy-MM-dd" |
||||
|
placeholder="选择日期"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
<!-- <el-form-item :label="'优先等级'"> |
||||
|
<dict-data-select v-model="queryForm.priorityLevel" clearable style="width: 120px" :use-default-value="false" |
||||
|
dict-type="priority_Level"/> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-form :inline="true" label-position="top" :model="queryForm" @keyup.enter.native="handleQuery()"> |
||||
|
<el-form-item label="客户编码"> |
||||
|
<span style="cursor: pointer" slot="label" @click="getBaseList(509,2)"><a herf="#">客户编码</a></span> |
||||
|
<el-input v-model="queryForm.customerNo" clearable style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'客户名称'"> |
||||
|
<el-input v-model="queryForm.customerDesc" clearable style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'报价专员'"> |
||||
|
<span style="cursor: pointer" slot="label" @click="getBaseList(2002,1)"><a herf="#">报价专员</a></span> |
||||
|
<el-input v-model="queryForm.quoterName" clearable style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'要求报价日期'"> |
||||
|
<el-date-picker |
||||
|
style="width: 120px" |
||||
|
v-model="queryForm.requiredCompletionStartDate" |
||||
|
type="date" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
placeholder="选择日期"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label=" "> |
||||
|
<div style="text-align: center;"><i class="el-icon-right"></i></div> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="' '"> |
||||
|
<el-date-picker |
||||
|
style="width: 120px" |
||||
|
v-model="queryForm.requiredCompletionEndDate" |
||||
|
type="date" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
placeholder="选择日期"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> --> |
||||
|
|
||||
|
<el-form-item :label="' '"> |
||||
|
<el-button @click="handleQuery()">查询</el-button> |
||||
|
<el-button @click="handleAdd()">新增</el-button> |
||||
|
<!-- <el-button @click="handleHu()">呼叫</el-button> --> |
||||
|
</el-form-item> |
||||
|
|
||||
|
</el-form> |
||||
|
<div style="height: 100%;overflow: auto"> |
||||
|
<el-table :data="dataList" border v-loading="queryLoading" height="78vh" @row-dblclick="handleDblClick" |
||||
|
:row-style="rowStyle" ref="mainTable" @row-click="inquiryClickRow" @current-change="changeCurrentRow"> |
||||
|
<el-table-column type="index" width="55" align="center" label="序号"></el-table-column> |
||||
|
<el-table-column v-for="(item,index) in columns" :key="index" :sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" :fixed="item.fixed===''?false:item.fixed" :min-width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="scope.column.property == 'projectIncome'"> |
||||
|
<el-tooltip class="item" effect="dark" :content="scope.row.projectIncome" placement="top"> |
||||
|
<div>{{ formatContent(scope.row.projectIncome) }}</div> |
||||
|
</el-tooltip> |
||||
|
</span> |
||||
|
<span v-else>{{scope.row[scope.column.property]}}</span> |
||||
|
</template> |
||||
|
<!-- <template slot-scope="scope"> |
||||
|
<div v-if="item.columnProp !== 'status' && item.columnProp !== 'priorityLevel'"> |
||||
|
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span> |
||||
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
||||
|
style="width: 100px; height: 80px"/></span> |
||||
|
</div> |
||||
|
<div v-else-if="item.columnProp === 'status'"> |
||||
|
<span v-if="!item.columnHidden"> |
||||
|
<span v-if="scope.row.status === 'C'">草稿</span> |
||||
|
<span v-if="scope.row.status === 'B'">下达</span> |
||||
|
<span v-if="scope.row.status === 'A'">已转报价</span> |
||||
|
<span v-if="scope.row.status === 'D'">已驳回</span> |
||||
|
</span> |
||||
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
||||
|
style="width: 100px; height: 80px"/></span> |
||||
|
</div> |
||||
|
<div v-else-if="item.columnProp === 'priorityLevel'"> |
||||
|
<span v-if="!item.columnHidden"> |
||||
|
<span v-if="scope.row.priorityLevel === 'A'">普通</span> |
||||
|
<span v-if="scope.row.priorityLevel === ' B'">重要</span> |
||||
|
<span v-if="scope.row.priorityLevel === ' C'">紧急</span> |
||||
|
</span> |
||||
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
||||
|
style="width: 100px; height: 80px"/></span> |
||||
|
</div> |
||||
|
</template> --> |
||||
|
</el-table-column> |
||||
|
<el-table-column v-if="!isComponent" fixed="right" header-align="center" align="center" width="140" label="操作"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-link style="cursor: pointer" v-if="scope.row.sstatus == '草稿' || scope.row.sstatus == '已驳回'" |
||||
|
@click="handleEdit(scope.row)">修改</el-link> |
||||
|
<el-link style="cursor: pointer" v-if="scope.row.sstatus == '草稿' || scope.row.sstatus == '已驳回'" |
||||
|
@click="handleUpdateStatus(scope.row)">下达</el-link> |
||||
|
<el-link style="cursor: pointer" v-if="scope.row.sstatus == '草稿' || scope.row.sstatus == '已驳回'" |
||||
|
@click="handleRemove(scope.row)">删除</el-link> |
||||
|
<el-link style="cursor: pointer" v-if="scope.row.sstatus == '进行中'" |
||||
|
@click="chooseCloseUser(scope.row)">选择结案人员</el-link> |
||||
|
|
||||
|
<el-link style="cursor: pointer" @click="handleDetails(scope.row)">详情</el-link> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
<el-pagination @size-change="handleSizeChange" @current-change="handlePageChange" :current-page="pageIndex" |
||||
|
:page-sizes="[ 50, 100, 200, 500]" :page-size="pageSize" :total="totalPage" |
||||
|
layout="total,sizes, prev, pager, next, jumper"> |
||||
|
</el-pagination> |
||||
|
<MachineProjectForm ref="machineProjectForm" v-if="machineProjectVisible" @selectFinished="machineProjectFinished"> |
||||
|
</MachineProjectForm> |
||||
|
<MachineProjectDetail ref="machineProjectDetail" v-if="machineProjectDetailVisible" |
||||
|
@selectFinished="machineProjectFinished"></MachineProjectDetail> |
||||
|
<MachineProjectCloseAuthForm ref="machineProjectCloseAuth" v-if="machineProjectCloseAuthVisible" |
||||
|
@SelectFinished="machineProjectFinished"></MachineProjectCloseAuthForm> |
||||
|
|
||||
|
<!-- 页签 --> |
||||
|
<!-- <el-tabs style="margin-top: 0px; width: 100%; height: 40vh;" v-model="activeTable" class="customer-tab" type="border-card" @tab-click="tabClick"> |
||||
|
<el-tab-pane label="产品明细" name="inquiryPart"> |
||||
|
<el-table |
||||
|
@header-dragend="handleColumnResize" |
||||
|
height="37vh" |
||||
|
:data="inquiryPartDataList" |
||||
|
border |
||||
|
ref="secondaryTable" |
||||
|
v-loading="dataListLoading" |
||||
|
style="width: 100%;margin-top: 5px"> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in machineColumnList" :key="index" |
||||
|
:sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" |
||||
|
:header-align="item.headerAlign" |
||||
|
:align="item.align" |
||||
|
:fixed="item.fixed === ''?false:item.fixed" |
||||
|
:min-width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span> |
||||
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
||||
|
style="width: 100px; height: 80px"/></span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-tab-pane> |
||||
|
</el-tabs> --> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import DictDataSelect from '../sys/dict-data-select.vue' |
||||
|
import { getSiteAndBuByUserName } from '../../../api/qc/qc' |
||||
|
import { |
||||
|
getTableDefaultListLanguage, |
||||
|
getTableUserListLanguage, |
||||
|
updateColumnSize, |
||||
|
} from '../../../api/table' |
||||
|
import OssComponents from '../oss/ossComponents.vue' |
||||
|
import { |
||||
|
queryMachinePage, |
||||
|
machineDelete, |
||||
|
projectUpdateStatus, |
||||
|
sendTextLoraWatch |
||||
|
} from '../../../api/machine/machineProject' |
||||
|
import MachineProjectForm from './modules/machineProjectForm' |
||||
|
import BuSelect from '../../../components/selector/select/BuSelect.vue' |
||||
|
import MachineProjectDetail from './machineProjectDetail.vue' |
||||
|
import MachineProjectCloseAuthForm from './modules/machineProjectCloseAuthForm.vue' |
||||
|
|
||||
|
export default { |
||||
|
name: 'machineProject', |
||||
|
components: { |
||||
|
OssComponents, |
||||
|
DictDataSelect, |
||||
|
MachineProjectForm, |
||||
|
BuSelect, |
||||
|
MachineProjectDetail, |
||||
|
MachineProjectCloseAuthForm, |
||||
|
}, |
||||
|
props: { |
||||
|
isComponent: { |
||||
|
type: Boolean, |
||||
|
default: false, |
||||
|
}, |
||||
|
height: { |
||||
|
type: [String, Number], |
||||
|
default: '76vh', |
||||
|
}, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
pageIndex: 1, |
||||
|
pageSize: 50, |
||||
|
totalPage: 0, |
||||
|
userBuList: [], |
||||
|
activeTable: 'inquiryPart', |
||||
|
machineProjectVisible: false, |
||||
|
machineProjectDetailVisible: false, |
||||
|
machineProjectCloseAuthVisible: false, |
||||
|
queryForm: { |
||||
|
site: this.$store.state.user.site, |
||||
|
customerNo: '', |
||||
|
customerDesc: '', |
||||
|
id: '', |
||||
|
rfqNo: '', |
||||
|
bu: '', |
||||
|
requestStartDate: '', |
||||
|
requestEndDate: '', |
||||
|
requiredCompletionStartDate: '', |
||||
|
requiredCompletionEndDate: '', |
||||
|
status: '', |
||||
|
quoterName: '', |
||||
|
requesterName: '', |
||||
|
priorityLevel: '', |
||||
|
partNo: '', |
||||
|
partDesc: '', |
||||
|
page: 1, |
||||
|
limit: 10, |
||||
|
menuId: this.$route.meta.menuId, |
||||
|
}, |
||||
|
dataList: [], |
||||
|
inquiryPartDataList: [], |
||||
|
queryLoading: false, |
||||
|
dataListLoading: false, |
||||
|
columns: [ |
||||
|
/* { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1BuDesc', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'id', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '序号', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 80 |
||||
|
}, */ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1BuDesc', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'buDesc', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: 'BU', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 80, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1CustomerNo', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'projectNo', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '项目编号', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1CustomerDesc', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'projectName', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: '项目名称', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1RequesterName', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'projectIncome', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: '项目收益', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 180, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1QuoterName', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'projectBudget', |
||||
|
headerAlign: 'center', |
||||
|
align: 'right', |
||||
|
columnLabel: '项目总预算', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 80, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1RequiredCompletionDate', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'projectActualExpenses', |
||||
|
headerAlign: 'center', |
||||
|
align: 'right', |
||||
|
columnLabel: '项目总实际开销', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1CustomerInquiryNo', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'responsiblePerson', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: '项目负责人', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1RequestDate', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'startDate', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '项目开始时间', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1RequestDate', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'endDate', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '结案时间', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1Status', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'sstatus', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '状态', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1CreateDate', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'createDate', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '创建时间', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1CreateBy', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'createBy', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '创建人', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 80, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1UpdateDate', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'updateDate', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '更新时间', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1UpdateBy', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'updateBy', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '更新人', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 80, |
||||
|
}, |
||||
|
], |
||||
|
machineColumnList: [], |
||||
|
quoteLoading: false, |
||||
|
// ======== 选中的当前行数据 ======== |
||||
|
inquiryCurrentRow: {}, |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.getSiteAndQueryBuByUserName() |
||||
|
this.handleQuery() |
||||
|
this.getTableUserColumn(this.$route.meta.menuId + 'table1', 1) |
||||
|
}, |
||||
|
methods: { |
||||
|
// 动态列开始 获取 用户保存的 格式列 |
||||
|
async getTableUserColumn(tableId, columnId) { |
||||
|
let queryTableUser = { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
tableId: tableId, |
||||
|
status: true, |
||||
|
languageCode: this.$i18n.locale, |
||||
|
} |
||||
|
await getTableUserListLanguage(queryTableUser).then(({ data }) => { |
||||
|
if (data.rows.length > 0) { |
||||
|
switch (columnId) { |
||||
|
case 1: |
||||
|
this.columns = data.rows |
||||
|
break |
||||
|
} |
||||
|
} else { |
||||
|
this.getColumnList(tableId, columnId) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 获取 tableDefault 列 |
||||
|
async getColumnList(tableId, columnId) { |
||||
|
let queryTable = { |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
tableId: tableId, |
||||
|
languageCode: this.$i18n.locale, |
||||
|
} |
||||
|
await getTableDefaultListLanguage(queryTable).then(({ data }) => { |
||||
|
if (!data.rows.length === 0) { |
||||
|
switch (columnId) { |
||||
|
case 1: |
||||
|
this.columns = data.rows |
||||
|
break |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
handleColumnResize(newWidth, oldWidth, column, event) { |
||||
|
let inData = this.columnList.filter( |
||||
|
(item) => item.columnProp === column.property |
||||
|
)[0] |
||||
|
inData.columnWidth = newWidth |
||||
|
updateColumnSize(inData).then(({ data }) => { |
||||
|
if (data.code === 0) { |
||||
|
console.log('栏位宽度保存成功!') |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 获取用户的bu |
||||
|
getSiteAndQueryBuByUserName() { |
||||
|
let tempData = { |
||||
|
username: this.$store.state.user.name, |
||||
|
} |
||||
|
getSiteAndBuByUserName(tempData).then(({ data }) => { |
||||
|
if (data.code === 0) { |
||||
|
this.userBuList = data.rows |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
handleQuery() { |
||||
|
this.queryForm.pageSize = this.pageSize |
||||
|
this.queryForm.pageIndex = this.pageIndex |
||||
|
this.queryLoading = true |
||||
|
queryMachinePage(this.queryForm) |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.dataList = data.page.records |
||||
|
this.pageIndex = data.page.current |
||||
|
this.pageSize = data.page.size |
||||
|
this.totalPage = data.page.total |
||||
|
//判断是否全部存在数据 |
||||
|
//if (this.totalPage > 0) { |
||||
|
// this.$refs.mainTable.setCurrentRow(this.dataList[0]) |
||||
|
// this.refreshCurrentTabTable() |
||||
|
// this.inquiryClickRow(this.dataList[0]) |
||||
|
//} |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
this.queryLoading = false |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.error(error) |
||||
|
this.queryLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
handleSizeChange(val) { |
||||
|
this.pageSize = val |
||||
|
this.pageIndex = 1 |
||||
|
this.handleQuery() |
||||
|
}, |
||||
|
handlePageChange(val) { |
||||
|
this.pageIndex = val |
||||
|
this.handleQuery() |
||||
|
}, |
||||
|
handleAdd() { |
||||
|
this.machineProjectVisible = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.machineProjectForm.add() |
||||
|
}) |
||||
|
}, |
||||
|
handleEdit(record) { |
||||
|
this.machineProjectVisible = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.machineProjectForm.edit(record) |
||||
|
}) |
||||
|
}, |
||||
|
handleRemove(row) { |
||||
|
this.$confirm('确认删除该项目信息吗?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning', |
||||
|
}) |
||||
|
.then(() => { |
||||
|
this.handleRemoveMachine(row) |
||||
|
}) |
||||
|
.catch(() => {}) |
||||
|
}, |
||||
|
handleRemoveMachine(row) { |
||||
|
let params = { |
||||
|
id: row.id, |
||||
|
} |
||||
|
machineDelete(params) |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.$message.success(data.msg) |
||||
|
this.handleQuery() |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.error(error) |
||||
|
}) |
||||
|
}, |
||||
|
chooseCloseUser(record) { |
||||
|
this.machineProjectCloseAuthVisible = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.machineProjectCloseAuth.projectCloseInit(record) |
||||
|
}) |
||||
|
}, |
||||
|
handleDetails(record) { |
||||
|
this.machineProjectDetailVisible = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.machineProjectDetail.projectDetailInit(record) |
||||
|
}) |
||||
|
}, |
||||
|
handleUpdateStatus(record) { |
||||
|
this.$confirm(`确定要下达该项目信息吗?`, '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning', |
||||
|
callback: () => {}, |
||||
|
beforeClose: (action, ctx, close) => { |
||||
|
if (action !== 'confirm') { |
||||
|
close() |
||||
|
return |
||||
|
} |
||||
|
ctx.confirmButtonLoading = true |
||||
|
|
||||
|
record.enSstatus = '审核中' |
||||
|
let params = { |
||||
|
...record, |
||||
|
} |
||||
|
projectUpdateStatus(params) |
||||
|
.then((res) => { |
||||
|
if (res.data && res.data.code === 0) { |
||||
|
this.$message.success(res.data.msg) |
||||
|
this.handleQuery() |
||||
|
close() |
||||
|
} else { |
||||
|
this.$message.warning(res.data.msg) |
||||
|
} |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.warning(error) |
||||
|
}) |
||||
|
.finally(() => { |
||||
|
ctx.confirmButtonLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
}) |
||||
|
/* .then(() => { |
||||
|
console.log("11111111"); |
||||
|
|
||||
|
this.handleQuery() |
||||
|
record.enSstatus = '审核中' |
||||
|
let params = { |
||||
|
...record, |
||||
|
} |
||||
|
projectUpdateStatus(params) |
||||
|
.then((res) => { |
||||
|
if (res.data && res.data.code === 0) { |
||||
|
this.$message.success(res.data.msg) |
||||
|
this.handleQuery() |
||||
|
} else { |
||||
|
this.$message.warning(res.data.msg) |
||||
|
} |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.warning(error) |
||||
|
}) |
||||
|
}) */ |
||||
|
}, |
||||
|
machineProjectFinished() { |
||||
|
this.handleQuery() |
||||
|
}, |
||||
|
handleDblClick(row) { |
||||
|
this.handleDetails(row) |
||||
|
}, |
||||
|
|
||||
|
// ======== 页签切换相关方法 ======== |
||||
|
/** |
||||
|
* 列表表格选择替换 |
||||
|
* @param tab |
||||
|
* @param event |
||||
|
*/ |
||||
|
tabClick(tab, event) { |
||||
|
// 刷新列表数据 |
||||
|
this.refreshCurrentTabTable() |
||||
|
}, |
||||
|
|
||||
|
// ======== 列表操作方法 ======== |
||||
|
/** |
||||
|
* 单机选中询价信息 |
||||
|
* @param row |
||||
|
*/ |
||||
|
inquiryClickRow(row) { |
||||
|
this.inquiryCurrentRow = JSON.parse(JSON.stringify(row)) |
||||
|
}, |
||||
|
/** |
||||
|
* 当前值发生变化的时候修改 |
||||
|
* @param row |
||||
|
* @param oldRow |
||||
|
*/ |
||||
|
changeCurrentRow(row, oldRow) { |
||||
|
// 判断是否是获取焦点的事件 |
||||
|
if (row) { |
||||
|
this.inquiryCurrentRow = JSON.parse(JSON.stringify(row)) |
||||
|
//刷新当前页表 |
||||
|
this.refreshCurrentTabTable() |
||||
|
} |
||||
|
}, |
||||
|
/** |
||||
|
* 刷新页签的table数据 |
||||
|
*/ |
||||
|
refreshCurrentTabTable() { |
||||
|
if (this.activeTable === 'inquiryPart') { |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
rowStyle({ row }) { |
||||
|
if (this.inquiryCurrentRow.id === row.id) { |
||||
|
return { 'background-color': '#E8F7F6', cursor: 'pointer' } |
||||
|
} |
||||
|
}, |
||||
|
formatContent(content, length = 15) { |
||||
|
if (content && content.length > length) { |
||||
|
return content.substr(0, length) + '...' |
||||
|
} |
||||
|
return content |
||||
|
}, |
||||
|
handleHu(){ |
||||
|
let params={ |
||||
|
site:this.$store.state.user.site |
||||
|
} |
||||
|
sendTextLoraWatch(params) |
||||
|
.then((res) => { |
||||
|
if (res) { |
||||
|
console.log(res); |
||||
|
|
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped lang="scss"> |
||||
|
/deep/ .customer-tab .el-tabs__content { |
||||
|
padding: 0px !important; |
||||
|
} |
||||
|
///deep/ .customer-tab .el-tabs__content { |
||||
|
// |
||||
|
//} |
||||
|
.el-table /deep/ .cell { |
||||
|
height: auto; |
||||
|
line-height: 1.5; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,544 @@ |
|||||
|
<template> |
||||
|
<div style="height: 100%;overflow: auto"> |
||||
|
<el-dialog title="详情" v-drag :close-on-click-modal="false" :visible.sync="saveVisible" width="60%" |
||||
|
@close="closeDetail"> |
||||
|
<!-- 页签 --> |
||||
|
<el-tabs v-model="activeTable" @tab-click="getTabs"> |
||||
|
<el-tab-pane label="项目预算" name="projectIncome"> |
||||
|
<!-- <el-button @click="addIncome()" :disabled="this.model.sstatus != '草稿'">新增</el-button> --> |
||||
|
<div style="height: 100%;overflow: auto"> |
||||
|
<!-- <el-table :data="dataList" border v-loading="queryLoading" height="33vh" @row-dblclick="handleDblClick" |
||||
|
:row-style="rowStyle" ref="mainTable"> |
||||
|
<el-table-column type="index" width="55" align="center" label="序号"></el-table-column> |
||||
|
<el-table-column v-for="(item,index) in columns" :key="index" :sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" :header-align="item.headerAlign" |
||||
|
:show-overflow-tooltip="item.showOverflowTooltip" :align="item.align" |
||||
|
:fixed="item.fixed===''?false:item.fixed" :min-width="item.columnWidth" |
||||
|
:label="item.columnLabel"></el-table-column> |
||||
|
<el-table-column label="备注" width="180" align="left" headerAlign="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-tooltip class="item" effect="dark" :content="scope.row.remark" placement="top"> |
||||
|
<div>{{ formatContent(scope.row.remark) }}</div> |
||||
|
</el-tooltip> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
|
||||
|
<el-table-column v-if="model.sstatus =='草稿'" header-align="center" align="center" width="140" label="操作"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-link style="cursor: pointer" @click="editIncome(scope.row)">修改</el-link> |
||||
|
<el-link style="cursor: pointer" @click="removeIncome(scope.row)">删除</el-link> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> --> |
||||
|
<MachineProjectIncome :projectIncome="dataList" :project="model" @IncomeFinished="getIncomeList" |
||||
|
:auth-flag="false" :height="'33vh'"></MachineProjectIncome> |
||||
|
</div> |
||||
|
</el-tab-pane> |
||||
|
<el-tab-pane label="项目计划" name="projectPlan"> |
||||
|
<div style="height: 100%;overflow: auto;"> |
||||
|
<MachineProjectPlan :projectPlan="projectPlan" :project="model" @planFinished="getPlanList" |
||||
|
:auth-flag="false" :height="'33vh'"></MachineProjectPlan> |
||||
|
</div> |
||||
|
</el-tab-pane> |
||||
|
<el-tab-pane label="项目任务" name="projectTask"> |
||||
|
<div style="height: 100%;overflow: auto;"> |
||||
|
<MachineProjectTask :projectTask="projectTask" :project="model" @taskFinished="getTaskList" |
||||
|
:auth-flag="false" :height="'33vh'"></MachineProjectTask> |
||||
|
</div> |
||||
|
</el-tab-pane> |
||||
|
<el-tab-pane label="结案确认" name="projectClose"> |
||||
|
<div style="height: 100%;overflow: auto;"> |
||||
|
<MachineProjectCloseTable :projectClose="projectClose" :project="model" @taskFinished="getCloseList" |
||||
|
:auth-flag="false" :height="'33vh'"></MachineProjectCloseTable> |
||||
|
</div> |
||||
|
</el-tab-pane> |
||||
|
<el-tab-pane label="审核记录" name="projectAuth"> |
||||
|
<div style="height: 100%;overflow: auto;"> |
||||
|
<MachineProjectAuthTable :projectAuth="projectAuth" :project="model" @taskFinished="getAuthList" |
||||
|
:auth-flag="false" :height="'33vh'"></MachineProjectAuthTable> |
||||
|
</div> |
||||
|
</el-tab-pane> |
||||
|
<el-tab-pane label="相关文档" name="inquiryDocument"> |
||||
|
<div style="height: 100%;overflow: auto;"> |
||||
|
<oss-components ref="inquiryDocument" label="申请单号" style="margin-top: 5px" height="44vh" :columns="ossColumns" |
||||
|
:orderRef1="model.site" :orderRef2="model.id" :rfqNo="model.projectNo"> |
||||
|
</oss-components> |
||||
|
</div> |
||||
|
</el-tab-pane> |
||||
|
</el-tabs> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import DictDataSelect from '../sys/dict-data-select.vue' |
||||
|
import OssComponents from '../oss/ossProjectComponents.vue' |
||||
|
import BuSelect from '../../../components/selector/select/BuSelect.vue' |
||||
|
|
||||
|
import { |
||||
|
queryMachineProjectIncomeList, |
||||
|
deleteProjectIncome, |
||||
|
queryMachineProjectPlanList, |
||||
|
queryMachineProjectTaskList, |
||||
|
queryMachineProjectCloseList, |
||||
|
} from '../../../api/machine/machineProjectIncome' |
||||
|
import { queryMachineProjectAuthList } from '../../../api/machine/machineProject' |
||||
|
import MachineProjectIncome from './modules/machineProjectIncomeTable.vue' |
||||
|
import MachineProjectPlan from './modules/machineProjectPlanTable.vue' |
||||
|
import MachineProjectTask from './modules/machineProjectTaskTable.vue' |
||||
|
import MachineProjectCloseTable from './modules/machineProjectCloseTable.vue' |
||||
|
import MachineProjectAuthTable from './modules/machineProjectAuthTable.vue' |
||||
|
|
||||
|
export default { |
||||
|
name: 'machineProjectDetail', |
||||
|
components: { |
||||
|
OssComponents, |
||||
|
DictDataSelect, |
||||
|
BuSelect, |
||||
|
MachineProjectIncome, |
||||
|
MachineProjectPlan, |
||||
|
MachineProjectTask, |
||||
|
MachineProjectCloseTable, |
||||
|
MachineProjectAuthTable, |
||||
|
}, |
||||
|
props: { |
||||
|
isComponent: { |
||||
|
type: Boolean, |
||||
|
default: false, |
||||
|
}, |
||||
|
height: { |
||||
|
type: [String, Number], |
||||
|
default: '76vh', |
||||
|
}, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
model: {}, |
||||
|
projectPlan: [], |
||||
|
projectTask: [], |
||||
|
projectClose: [], |
||||
|
projectAuth: [], |
||||
|
ossColumns: [ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 101506001001, |
||||
|
serialNumber: '101506001001Table2FileName', |
||||
|
tableId: '101506001001Table2', |
||||
|
tableName: '文件信息表', |
||||
|
columnProp: 'fileName', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '文件名称', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 140, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 101506001001, |
||||
|
serialNumber: '101506001001Table2FileRemark', |
||||
|
tableId: '101506001001Table2', |
||||
|
tableName: '文件信息表', |
||||
|
columnProp: 'cadditionalInfo', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '备注', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 240, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 101506001001, |
||||
|
serialNumber: '101506001001Table2CreateDate', |
||||
|
tableId: '101506001001Table2', |
||||
|
tableName: '文件信息表', |
||||
|
columnProp: 'createDate', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '上传时间', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 140, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 101506001001, |
||||
|
serialNumber: '101506001001Table2CreatedBy', |
||||
|
tableId: '101506001001Table2', |
||||
|
tableName: '文件信息表', |
||||
|
columnProp: 'createdBy', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '上传人', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 140, |
||||
|
}, |
||||
|
], |
||||
|
saveVisible: false, |
||||
|
pageIndex: 1, |
||||
|
pageSize: 50, |
||||
|
totalPage: 0, |
||||
|
// 初始页签 |
||||
|
activeTable: 'projectIncome', |
||||
|
projectDetalVisible: false, |
||||
|
queryForm: { |
||||
|
site: this.$store.state.user.site, |
||||
|
customerNo: '', |
||||
|
customerDesc: '', |
||||
|
id: '', |
||||
|
rfqNo: '', |
||||
|
bu: '', |
||||
|
requestStartDate: '', |
||||
|
requestEndDate: '', |
||||
|
requiredCompletionStartDate: '', |
||||
|
requiredCompletionEndDate: '', |
||||
|
status: '', |
||||
|
quoterName: '', |
||||
|
requesterName: '', |
||||
|
priorityLevel: '', |
||||
|
partNo: '', |
||||
|
partDesc: '', |
||||
|
page: 1, |
||||
|
limit: 10, |
||||
|
menuId: this.$route.meta.menuId, |
||||
|
}, |
||||
|
dataList: [], |
||||
|
inquiryPartDataList: [], |
||||
|
queryLoading: false, |
||||
|
dataListLoading: false, |
||||
|
columns: [ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1BuDesc', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'incomeNo', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '费用编码', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1CustomerNo', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'incomeName', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '费用描述', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 140, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1CustomerDesc', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'incomeBudget', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '预算金额', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1RequesterName', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'actualExpenses', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '实际开销', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1QuoterName', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'currency', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '币种', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 80, |
||||
|
}, |
||||
|
/* { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1RequiredCompletionDate', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'remark', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '备注', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, */ |
||||
|
], |
||||
|
machineColumnList: [], |
||||
|
quoteLoading: false, |
||||
|
// ======== 选中的当前行数据 ======== |
||||
|
inquiryCurrentRow: {}, |
||||
|
} |
||||
|
}, |
||||
|
created() {}, |
||||
|
methods: { |
||||
|
projectDetailInit(record) { |
||||
|
this.saveVisible = true |
||||
|
this.model = record |
||||
|
this.getTabs() |
||||
|
}, |
||||
|
rowStyle({ row }) { |
||||
|
if (this.inquiryCurrentRow.id === row.id) { |
||||
|
return { 'background-color': '#E8F7F6', cursor: 'pointer' } |
||||
|
} |
||||
|
}, |
||||
|
addIncome() { |
||||
|
this.projectDetalVisible = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.machineProjectDetailForm.add(this.model) |
||||
|
}) |
||||
|
}, |
||||
|
editIncome(record) { |
||||
|
this.projectDetalVisible = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.machineProjectDetailForm.edit(record) |
||||
|
}) |
||||
|
}, |
||||
|
removeIncome(row) { |
||||
|
this.$confirm('确认删除该项目信息吗?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning', |
||||
|
}).then(() => { |
||||
|
this.handleRemoveIncome(row) |
||||
|
}) |
||||
|
}, |
||||
|
handleRemoveIncome(row) { |
||||
|
let params = { |
||||
|
id: row.id, |
||||
|
} |
||||
|
deleteProjectIncome(params) |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.$message.success(data.msg) |
||||
|
this.getIncomeList() |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.error(error) |
||||
|
}) |
||||
|
}, |
||||
|
getTabs() { |
||||
|
switch (this.activeTable) { |
||||
|
case 'projectIncome': |
||||
|
this.getIncomeList() |
||||
|
break |
||||
|
case 'projectPlan': |
||||
|
this.getPlanList() |
||||
|
break |
||||
|
case 'projectTask': |
||||
|
this.getTaskList() |
||||
|
break |
||||
|
case 'projectClose': |
||||
|
this.getCloseList() |
||||
|
break |
||||
|
case 'projectAuth': |
||||
|
this.getAuthList() |
||||
|
break |
||||
|
case 'inquiryDocument': |
||||
|
this.$refs.inquiryDocument.handleQuery() |
||||
|
break |
||||
|
default: |
||||
|
this.getIncomeList() |
||||
|
break |
||||
|
} |
||||
|
}, |
||||
|
getIncomeList() { |
||||
|
let obj = { |
||||
|
projectNo: this.model.projectNo, |
||||
|
} |
||||
|
queryMachineProjectIncomeList(obj) |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.dataList = data.list |
||||
|
//判断是否全部存在数据 |
||||
|
//if (this.totalPage > 0) { |
||||
|
// this.$refs.mainTable.setCurrentRow(this.dataList[0]) |
||||
|
// this.refreshCurrentTabTable() |
||||
|
// this.inquiryClickRow(this.dataList[0]) |
||||
|
//} |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
this.queryLoading = false |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.error(error) |
||||
|
this.queryLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
incomeFinished() { |
||||
|
this.getIncomeList() |
||||
|
}, |
||||
|
getPlanList() { |
||||
|
let obj = { |
||||
|
projectNo: this.model.projectNo, |
||||
|
} |
||||
|
queryMachineProjectPlanList(obj) |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.projectPlan = data.list |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
this.queryLoading = false |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.error(error) |
||||
|
this.queryLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
getTaskList() { |
||||
|
let obj = { |
||||
|
projectNo: this.model.projectNo, |
||||
|
} |
||||
|
queryMachineProjectTaskList(obj) |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.projectTask = data.list |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
this.queryLoading = false |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.error(error) |
||||
|
this.queryLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
getCloseList() { |
||||
|
let obj = { |
||||
|
projectNo: this.model.projectNo, |
||||
|
} |
||||
|
queryMachineProjectCloseList(obj) |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.projectClose = data.list |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
this.queryLoading = false |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.error(error) |
||||
|
this.queryLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
getAuthList() { |
||||
|
let obj = { |
||||
|
site: this.$store.state.user.site, |
||||
|
projectNo: this.model.projectNo, |
||||
|
} |
||||
|
queryMachineProjectAuthList(obj) |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.projectAuth = data.list |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
this.queryLoading = false |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.error(error) |
||||
|
this.queryLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
closeDetail() { |
||||
|
this.$emit('selectFinished') |
||||
|
}, |
||||
|
formatContent(content, length = 10) { |
||||
|
if (content && content.length > length) { |
||||
|
return content.substr(0, length) + '...' |
||||
|
} |
||||
|
return content |
||||
|
}, |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped lang="scss"> |
||||
|
/deep/ .customer-tab .el-tabs__content { |
||||
|
padding: 0px !important; |
||||
|
} |
||||
|
///deep/ .customer-tab .el-tabs__content { |
||||
|
// |
||||
|
//} |
||||
|
.MachineProjectTask { |
||||
|
z-index: 2003; |
||||
|
} |
||||
|
.el-table /deep/ .cell { |
||||
|
height: auto; |
||||
|
line-height: 1.5; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,145 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<el-table v-loading="queryLoading" border :data="projectAuth" style="width: 100%;margin-top: 5px" :height="height"> |
||||
|
<el-table-column type="index" width="55" align="center" label="序号"></el-table-column> |
||||
|
<el-table-column v-for="(item,index) in columns" :key="index" :sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" :fixed="item.fixed === ''?false:item.fixed" :min-width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
|
||||
|
</template> |
||||
|
<script> |
||||
|
export default { |
||||
|
name: 'machineProjectAuthTable', |
||||
|
components: { |
||||
|
}, |
||||
|
props: { |
||||
|
project: { |
||||
|
type: Object, |
||||
|
required: true, |
||||
|
}, |
||||
|
projectAuth: { |
||||
|
type: Array, |
||||
|
required: true, |
||||
|
}, |
||||
|
height: { |
||||
|
type: [Number, String], |
||||
|
default: 300, |
||||
|
}, |
||||
|
authFlag: { |
||||
|
type: Boolean, |
||||
|
default: false, |
||||
|
}, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
model: {}, |
||||
|
queryLoading: false, |
||||
|
saveQuoteDetailRules: { |
||||
|
}, |
||||
|
columns: [ |
||||
|
/* { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5011, |
||||
|
serialNumber: '5011Table2PartNo', |
||||
|
tableId: '5011Table2', |
||||
|
tableName: '项目任务表', |
||||
|
columnProp: 'taskNo', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '任务编码', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, */ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5011, |
||||
|
serialNumber: '5011Table2Qty', |
||||
|
tableId: '5011Table2', |
||||
|
tableName: '项目任务表', |
||||
|
columnProp: 'userDisplay', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '审核人', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5011, |
||||
|
serialNumber: '5011Table2AdjustBomUnYield', |
||||
|
tableId: '5011Table2', |
||||
|
tableName: '项目任务表', |
||||
|
columnProp: 'actAuthorizeDate', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '审核时间', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 130, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5011, |
||||
|
serialNumber: '5011Table2AdjustLabourCost', |
||||
|
tableId: '5011Table2', |
||||
|
tableName: '项目任务表', |
||||
|
columnProp: 'approveResult', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '审核结论', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5011, |
||||
|
serialNumber: '5011Table2AdjustLabourCost', |
||||
|
tableId: '5011Table2', |
||||
|
tableName: '项目任务表', |
||||
|
columnProp: 'authHistRemark', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '备注', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120, |
||||
|
}, |
||||
|
], |
||||
|
formVisible: false, |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
}, |
||||
|
|
||||
|
watch: {}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
|
||||
@ -0,0 +1,230 @@ |
|||||
|
<template> |
||||
|
<div style="width: 100%;margin-top: 5px"> |
||||
|
<el-dialog title="结案人员" :close-on-click-modal="false" v-drag @close="closeAuthGroupMemberSaveDialogFlag" |
||||
|
:visible.sync="projectCloseAuthSaveDialog" width="900px"> |
||||
|
<div style="font-size: 12px"> |
||||
|
<el-form :inline="true" label-position="top" :model="searchAuthBusinessData"> |
||||
|
<el-form-item :label="'用户名'"> |
||||
|
<el-input v-model="searchAuthBusinessData.username" clearable style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'用户名称'"> |
||||
|
<el-input v-model="searchAuthBusinessData.userDisplay" clearable style="width: 200px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="' '"> |
||||
|
<el-button type="primary" @click="authGroupBusinessSearch()">查询</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<el-container style="margin-top: 0px;"> |
||||
|
<el-main style="width: 400px; padding: 1px"> |
||||
|
<span style="font-size: 12px">可选结案人</span> |
||||
|
<el-table @header-dragend="handleColumnResize" height="400px" :data="allAuthBusinessList" border |
||||
|
ref="allAuthBusinessTable" @row-click="allAuthBusinessClickRow" @selection-change="selectionAllAuthBusiness" |
||||
|
highlight-current-row style="width: 100%"> |
||||
|
<el-table-column type="selection" header-align="center" align="center" :selectable="selectFlag" width="50"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="username" header-align="center" align="center" min-width="80" label="用户名"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="userDisplay" header-align="center" align="center" min-width="120" label="用户名称"> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-main> |
||||
|
<el-main style="width: 111px;padding: 1px"> |
||||
|
<div style="margin-top: 182px;margin-left: 18px"> |
||||
|
<el-button type="primary" @click="addAuthGroupMemberBusiness()">添加>></el-button> |
||||
|
</div> |
||||
|
<div style="margin-top: 15px;margin-left: 18px"> |
||||
|
<el-button type="primary" @click="deleteAuthGroupMemberBusiness()">删除</el-button> |
||||
|
</div> |
||||
|
</el-main> |
||||
|
<el-main style="width: 400px;padding: 1px"> |
||||
|
<span style="font-size: 12px">已有结案人</span> |
||||
|
<el-table @header-dragend="handleColumnResize" height="400px" :data="isAuthBusinessList" border |
||||
|
ref="isAuthBusinessTable" @row-click="isAuthBusinessClickRow" @selection-change="selectionIsAuthBusiness" |
||||
|
highlight-current-row style="width: 100%"> |
||||
|
<el-table-column type="selection" header-align="center" align="center" :selectable="selectFlag" width="50"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="username" header-align="center" align="center" min-width="80" label="用户名"> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="userDisplay" header-align="center" align="center" min-width="120" label="用户名称"> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-main> |
||||
|
</el-container> |
||||
|
<el-footer style="height:40px;margin-top: 20px;text-align:center"> |
||||
|
<el-button type="primary" @click="handleSaveOrUpdateClose" :loading="saveLoading">确 |
||||
|
定</el-button> |
||||
|
<el-button type="primary" @click="projectCloseAuthSaveDialog = false">关闭</el-button> |
||||
|
</el-footer> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { forEach } from 'lodash' |
||||
|
import { |
||||
|
projectCloseAuthSearch, |
||||
|
saveBatchProjectClose, |
||||
|
} from '../../../../api/machine/machineProjectIncome' |
||||
|
|
||||
|
export default { |
||||
|
name: 'machineProjectCloseAuthForm', |
||||
|
components: {}, |
||||
|
watch: {}, |
||||
|
data() { |
||||
|
return { |
||||
|
project: {}, |
||||
|
projectCloseAuthSaveDialog: false, |
||||
|
searchAuthBusinessData: { |
||||
|
site: this.$store.state.user.site, |
||||
|
userName: this.$store.state.user.name, |
||||
|
username: '', |
||||
|
userDisplay: '', |
||||
|
}, |
||||
|
allAuthBusinessList: [], |
||||
|
isAuthBusinessList: [], |
||||
|
saveLoading: false, |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
handleColumnResize(newWidth, oldWidth, column, event) { |
||||
|
let inData = this.columnList.filter( |
||||
|
(item) => item.columnProp === column.property |
||||
|
)[0] |
||||
|
inData.columnWidth = newWidth |
||||
|
updateColumnSize(inData).then(({ data }) => { |
||||
|
if (data.code === 0) { |
||||
|
console.log('栏位宽度保存成功!') |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
closeAuthGroupMemberSaveDialogFlag() { |
||||
|
this.projectCloseAuthSaveDialog = false |
||||
|
this.allAuthBusinessList = [] |
||||
|
this.isAuthBusinessList = [] |
||||
|
}, |
||||
|
/** |
||||
|
* 查询可用角色 |
||||
|
*/ |
||||
|
authGroupBusinessSearch() { |
||||
|
let obj = { |
||||
|
site: this.$store.state.user.site, |
||||
|
username: this.searchAuthBusinessData.username, |
||||
|
userDisplay: this.searchAuthBusinessData.userDisplay, |
||||
|
} |
||||
|
projectCloseAuthSearch(obj).then(({ data }) => { |
||||
|
if (data.code === 0) { |
||||
|
this.allAuthBusinessList = data.rows |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
//已有角色 |
||||
|
isAuthBusinessClickRow(row) { |
||||
|
this.$refs.isAuthBusinessTable.toggleRowSelection(row) |
||||
|
}, |
||||
|
//可选角色 |
||||
|
allAuthBusinessClickRow(row) { |
||||
|
this.$refs.allAuthBusinessTable.toggleRowSelection(row) |
||||
|
}, |
||||
|
selectionAllAuthBusiness(val) { |
||||
|
this.allAuthBusinessSelections = val |
||||
|
}, |
||||
|
selectionIsAuthBusiness(val) { |
||||
|
this.isAuthBusinessSelections = val |
||||
|
}, |
||||
|
selectFlag() { |
||||
|
return true |
||||
|
}, |
||||
|
//添加角色 |
||||
|
addAuthGroupMemberBusiness() { |
||||
|
if ( |
||||
|
this.allAuthBusinessSelections == null || |
||||
|
this.allAuthBusinessSelections.length === 0 |
||||
|
) { |
||||
|
this.$message.warning('请选择可选角色!') |
||||
|
return |
||||
|
} |
||||
|
let array = this.allAuthBusinessSelections.concat(this.isAuthBusinessList) |
||||
|
let newArray = array.filter( |
||||
|
(item, index, self) => |
||||
|
index === self.findIndex((t) => t.userId === item.userId) |
||||
|
) |
||||
|
this.isAuthBusinessList = newArray |
||||
|
|
||||
|
let ids = [] |
||||
|
for (let i = 0; i < this.allAuthBusinessSelections.length; i++) { |
||||
|
ids.push(this.allAuthBusinessSelections[i].userId) |
||||
|
} |
||||
|
for (let i = 0; i < ids.length; i++) { |
||||
|
let index = this.allAuthBusinessList.findIndex( |
||||
|
(obj) => obj.userId == ids[i] |
||||
|
) |
||||
|
if (index != -1) { |
||||
|
this.allAuthBusinessList.splice(index, 1) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
this.allAuthBusinessSelections = [] |
||||
|
this.$refs.allAuthBusinessTable.clearSelection() |
||||
|
}, |
||||
|
//删除角色 |
||||
|
deleteAuthGroupMemberBusiness() { |
||||
|
if ( |
||||
|
this.isAuthBusinessSelections == null || |
||||
|
this.isAuthBusinessSelections.length === 0 |
||||
|
) { |
||||
|
this.$message.warning('请选择已有角色!') |
||||
|
return |
||||
|
} |
||||
|
for (let i = 0; i < this.isAuthBusinessSelections.length; i++) { |
||||
|
let obj = {} |
||||
|
obj = this.isAuthBusinessSelections[i] |
||||
|
this.allAuthBusinessList.push(obj) |
||||
|
} |
||||
|
this.allAuthBusinessList.sort(function (a, b) { |
||||
|
return a.userId - b.userId |
||||
|
}) |
||||
|
|
||||
|
const difference = this.isAuthBusinessList.filter( |
||||
|
(item) => |
||||
|
!this.isAuthBusinessSelections.some( |
||||
|
(item2) => item.userId === item2.userId |
||||
|
) |
||||
|
) |
||||
|
this.isAuthBusinessList = difference |
||||
|
}, |
||||
|
projectCloseInit(record) { |
||||
|
this.projectCloseAuthSaveDialog = true |
||||
|
this.project = record |
||||
|
this.searchAuthBusinessData = {} |
||||
|
this.authGroupBusinessSearch() |
||||
|
}, |
||||
|
handleSaveOrUpdateClose() { |
||||
|
let param = { |
||||
|
site: this.project.site, |
||||
|
buNo: this.project.buNo, |
||||
|
projectNo: this.project.projectNo, |
||||
|
userList: this.isAuthBusinessList, |
||||
|
} |
||||
|
this.saveLoading = true |
||||
|
saveBatchProjectClose(param) |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.projectCloseAuthSaveDialog = false |
||||
|
this.$message.success(data.msg) |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
this.$emit('selectFinished') |
||||
|
this.saveLoading = false |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.error(error) |
||||
|
this.saveLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
</style> |
||||
@ -0,0 +1,150 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<el-table v-loading="queryLoading" border :data="projectClose" style="width: 100%;margin-top: 5px" :height="height"> |
||||
|
<el-table-column type="index" width="55" align="center" label="序号"></el-table-column> |
||||
|
<el-table-column v-for="(item,index) in columns" :key="index" :sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" :fixed="item.fixed === ''?false:item.fixed" :min-width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="操作" v-if="!authFlag && this.project.sstatus == '进行中'" align="center" width="120"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-link style="cursor: pointer" v-if="scope.row.sstatus != '已确认'" @click="handleConfirm(scope.row)">确认</el-link> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
|
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
projectCloseUpdateStatus, |
||||
|
} from '../../../../api/machine/machineProjectIncome' |
||||
|
|
||||
|
export default { |
||||
|
name: 'machineProjectPlanTable', |
||||
|
components: {}, |
||||
|
props: { |
||||
|
project: { |
||||
|
type: Object, |
||||
|
required: true, |
||||
|
}, |
||||
|
projectClose: { |
||||
|
type: Array, |
||||
|
required: true, |
||||
|
}, |
||||
|
height: { |
||||
|
type: [Number, String], |
||||
|
default: 300, |
||||
|
}, |
||||
|
authFlag: { |
||||
|
type: Boolean, |
||||
|
default: false, |
||||
|
}, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
model: {}, |
||||
|
saveQuoteDetail: {}, |
||||
|
dataList: [], |
||||
|
saveLoading: false, |
||||
|
queryLoading: false, |
||||
|
saveVisible: false, |
||||
|
saveQuoteDetailRules: {}, |
||||
|
columns: [ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5011, |
||||
|
serialNumber: '5011Table2PartNo', |
||||
|
tableId: '5011Table2', |
||||
|
tableName: '项目结案表', |
||||
|
columnProp: 'userDisplay', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '确认人员', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5011, |
||||
|
serialNumber: '5011Table2PartDesc', |
||||
|
tableId: '5011Table2', |
||||
|
tableName: '项目结案表', |
||||
|
columnProp: 'startDate', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '要求确认日期', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5011, |
||||
|
serialNumber: '5011Table2Qty', |
||||
|
tableId: '5011Table2', |
||||
|
tableName: '项目结案表', |
||||
|
columnProp: 'endDate', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '确认日期', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
}, |
||||
|
], |
||||
|
formVisible: false, |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
handleConfirm(row) { |
||||
|
this.$confirm('是否确认该信息?', '提示', { |
||||
|
confirmButtonText: '确认', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning', |
||||
|
}) |
||||
|
.then(() => { |
||||
|
this.handleConfirmProjectClose(row) |
||||
|
}) |
||||
|
.catch(() => {}) |
||||
|
}, |
||||
|
handleConfirmProjectClose(row) { |
||||
|
let params = { |
||||
|
id: row.id, |
||||
|
} |
||||
|
projectCloseUpdateStatus(params) |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.$message.success(data.msg) |
||||
|
this.taskTableFinished() |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.error(error) |
||||
|
}) |
||||
|
}, |
||||
|
taskTableFinished() { |
||||
|
this.$emit('taskFinished') |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
watch: {}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
|
||||
@ -0,0 +1,255 @@ |
|||||
|
<template> |
||||
|
<div style="height:100%"> |
||||
|
<el-dialog :title="model.id? '编辑' :'新增'" v-drag :close-on-click-modal="false" :append-to-body='true' :visible.sync="saveVisible" |
||||
|
width="500px"> |
||||
|
<el-form ref="saveForm" :model="model" :rules="saveRules" label-position="top" label-width="100px"> |
||||
|
<el-row :gutter="10"> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="费用描述" prop="incomeName" :show-message="false"> |
||||
|
<el-input v-model="model.incomeName" :disabled="detailFlag" :max="100"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="币种" prop="currency" :show-message="false"> |
||||
|
<el-select ref="currency" v-model="model.currency" placeholder="请选择" :disabled="detailFlag"> |
||||
|
<el-option v-for="i in currencyList" :key="i.currency" :label="i.currencyDesc" :value="i.currency"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="预算金额" prop="incomeBudget" :show-message="false"> |
||||
|
<el-input v-model="model.incomeBudget" :disabled="detailFlag" @input=" value=>model.incomeBudget = value.match(/\d+(\.\d{0,2})?/) ? value.match(/\d+(\.\d{0,2})?/)[0] : ''"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row :gutter="10"> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="实际开销" prop="actualExpenses" :show-message="false"> |
||||
|
<el-input v-model="model.actualExpenses" :disabled="!(detailFlag || projectStatus == '进行中')" @input=" value=>model.actualExpenses = value.match(/\d+(\.\d{0,2})?/) ? value.match(/\d+(\.\d{0,2})?/)[0] : ''"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row :gutter="10"> |
||||
|
<el-col :span="24"> |
||||
|
<el-form-item label="备注" prop="remark" class="auto" :show-message="false"> |
||||
|
<el-input v-model="model.remark" :disabled="detailFlag" :rows="3" :max="255" type="textarea"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<div slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" @click="handleSaveOrUpdateIncome" :loading="saveLoading">确 |
||||
|
定</el-button> |
||||
|
<el-button @click="saveVisible = false">取 消</el-button> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
saveMachineProjectIncome, |
||||
|
updateMachineProjectIncome, |
||||
|
currencyList, |
||||
|
} from '../../../../api/machine/machineProjectIncome' |
||||
|
import DictDataSelect from "../../sys/dict-data-select.vue"; |
||||
|
|
||||
|
export default { |
||||
|
name: 'machineProjectDetailForm', |
||||
|
components: {DictDataSelect}, |
||||
|
props: { |
||||
|
//表单禁用 |
||||
|
disabled: { |
||||
|
type: Boolean, |
||||
|
default: false, |
||||
|
required: false, |
||||
|
}, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
model: {}, |
||||
|
saveVisible: false, |
||||
|
detailFlag: false, |
||||
|
userList: [], |
||||
|
currencyList:[], |
||||
|
saveRules: { |
||||
|
incomeName: [ |
||||
|
{ required: true, message: '请输入项目表述', trigger: ['blur', 'change'] }, |
||||
|
], |
||||
|
currency: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: '请选择币种', |
||||
|
trigger: ['blur', 'change'], |
||||
|
}, |
||||
|
], |
||||
|
incomeBudget: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: '请输入预算金额', |
||||
|
trigger: ['blur', 'change'], |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
saveLoading: false, |
||||
|
confirmLoading: false, |
||||
|
validatorRules: { |
||||
|
contactsName: [{ required: true, message: '请输入姓名!' }], |
||||
|
phone: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
pattern: /^1[3456789]\d{9}$/, |
||||
|
message: '请输入正确的手机号码!', |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
url: {}, |
||||
|
visible: false, |
||||
|
disableSubmit: false, |
||||
|
loading: false, |
||||
|
projectStatus:'', |
||||
|
} |
||||
|
}, |
||||
|
computed: {}, |
||||
|
created() { |
||||
|
//备份model原始值 |
||||
|
this.modelDefault = JSON.parse(JSON.stringify(this.model)) |
||||
|
}, |
||||
|
methods: { |
||||
|
add(record) { |
||||
|
this.saveVisible = true |
||||
|
this.model = JSON.parse(JSON.stringify({})) |
||||
|
this.detailFlag = false |
||||
|
|
||||
|
this.model.site = record.site |
||||
|
this.model.buNo = record.buNo |
||||
|
this.model.projectNo = record.projectNo |
||||
|
this.model.projectName = record.projectName |
||||
|
this.projectStatus = record.sstatus |
||||
|
this.getCurrencyList() |
||||
|
}, |
||||
|
edit(record,project) { |
||||
|
this.saveVisible = true |
||||
|
this.model = JSON.parse(JSON.stringify(record)) |
||||
|
this.projectStatus = project.sstatus |
||||
|
|
||||
|
this.getDetailFlag() |
||||
|
this.getCurrencyList() |
||||
|
}, |
||||
|
getDetailFlag(){ |
||||
|
if(this.projectStatus != '草稿' && this.projectStatus != '已驳回'){ |
||||
|
this.detailFlag = true |
||||
|
}else{ |
||||
|
this.detailFlag = false |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
queryById(id) { |
||||
|
let params = { |
||||
|
id: id, |
||||
|
} |
||||
|
getMachineById(params).then((res) => { |
||||
|
this.model = res.data.record |
||||
|
}) |
||||
|
}, |
||||
|
handleSaveOrUpdateIncome() { |
||||
|
this.$refs.saveForm.validate((valid, obj) => { |
||||
|
if (valid) { |
||||
|
if (this.model.id) { |
||||
|
this.handleUpdateIncome() |
||||
|
} else { |
||||
|
this.handleSaveIncome() |
||||
|
} |
||||
|
} else { |
||||
|
let i = 1 |
||||
|
for (let key in obj) { |
||||
|
this.$message.warning(obj[key][0].message) |
||||
|
if (i === 1) { |
||||
|
return |
||||
|
} |
||||
|
i++ |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
handleSaveIncome() { |
||||
|
let params = { |
||||
|
...this.model, |
||||
|
createBy: this.$store.state.user.name, |
||||
|
} |
||||
|
|
||||
|
this.saveLoading = true |
||||
|
saveMachineProjectIncome(params) |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.saveVisible = false |
||||
|
this.$message.success(data.msg) |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
this.$emit('selectIncomeFinished') |
||||
|
this.saveLoading = false |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.error(error) |
||||
|
this.saveLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
handleUpdateIncome() { |
||||
|
let params = { |
||||
|
...this.model, |
||||
|
updateBy: this.$store.state.user.name, |
||||
|
site: this.$store.state.user.site, |
||||
|
} |
||||
|
this.saveLoading = true |
||||
|
updateMachineProjectIncome(params) |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.saveVisible = false |
||||
|
this.currentQuote = { |
||||
|
...this.currentQuote, |
||||
|
} |
||||
|
this.$message.success(data.msg) |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
this.$emit('selectIncomeFinished') |
||||
|
this.saveLoading = false |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.error(error) |
||||
|
this.saveLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
getLabel() { |
||||
|
this.$nextTick(() => { |
||||
|
this.model.responsiblePerson = |
||||
|
this.$refs.responsiblePerson.selectedLabel |
||||
|
}) |
||||
|
}, |
||||
|
getCurrencyList() { |
||||
|
let params = { |
||||
|
site: this.$store.state.user.site, |
||||
|
active: 'Y', |
||||
|
} |
||||
|
currencyList(params).then((res) => { |
||||
|
if (res && res.data.code === 0) { |
||||
|
this.$set(this, 'currencyList', res.data.list) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
.auto /deep/ .el-form-item__content { |
||||
|
height: auto; |
||||
|
line-height: 1.5; |
||||
|
} |
||||
|
|
||||
|
.el-table /deep/ .cell { |
||||
|
height: auto; |
||||
|
line-height: 1.5; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,340 @@ |
|||||
|
<template> |
||||
|
<div style="height:100%"> |
||||
|
<el-dialog :title="model.id? '编辑' :'新增'" v-drag :close-on-click-modal="false" :visible.sync="saveVisible" |
||||
|
width="500px"> |
||||
|
<el-form ref="saveForm" :model="model" :rules="saveRules" label-position="top" label-width="100px"> |
||||
|
<el-row :gutter="10"> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="BU" prop="buId" :show-message="false"> |
||||
|
<bu-select v-model="model.buId" :disabled="model.id > 0"></bu-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="项目名称" prop="projectName" :show-message="false"> |
||||
|
<el-input v-model="model.projectName" :disabled="detailFlag"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="项目负责人" prop="responsibleNo" :show-message="false"> |
||||
|
<span slot="label" v-if="!detailFlag"> |
||||
|
<a @click="getResponsibleList">项目负责人</a> |
||||
|
</span> |
||||
|
<el-input v-model="model.responsiblePerson" :disabled="true"></el-input> |
||||
|
<!-- <el-select ref="responsiblePerson" v-model="model.responsibleNo" @change="getLabel" placeholder="请选择"> |
||||
|
<el-option v-for="i in userList" :key="i.userId" :label="i.userDisplay" :value="i.userId"> |
||||
|
</el-option> |
||||
|
</el-select> --> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<!-- <el-row :gutter="10"> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="客户询价单号" prop="customerInquiryNo" :show-message="false"> |
||||
|
<el-input v-model="model.customerInquiryNo" :disabled="detailFlag"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="内部询价单号" prop="insideInquiryNo" :show-message="false"> |
||||
|
<span slot="label" v-if="model.id <= 0"> |
||||
|
<a @click="insideInquiryVisible = true">内部询价单号</a> |
||||
|
</span> |
||||
|
<el-input v-model="model.insideInquiryNo" @blur="handleInquiryBlur" :disabled="model.id > 0"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> --> |
||||
|
<!-- <el-row :gutter="10"> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="客户编码" prop="customerNo" :show-message="false"> |
||||
|
<span slot="label" v-if="model.id <= 0"> |
||||
|
<a @click="customerVisible = true">客户编码</a> |
||||
|
</span> |
||||
|
<el-input v-model="model.customerNo" :disabled="model.id > 0" @blur="customerNoBlur"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="16"> |
||||
|
<el-form-item label="客户描述" prop="customerDesc" :show-message="false"> |
||||
|
<el-input v-model="model.customerDesc" disabled></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="Cost Model" prop="costModel" :show-message="false"> |
||||
|
<el-select v-model="model.costModel" :disabled="detailFlag"> |
||||
|
<el-option label="2020" value="2020"></el-option> |
||||
|
<el-option label="UFIDA" value="UFIDA"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="Markup" prop="markup" :show-message="false"> |
||||
|
<el-input-number style="width: 100%" :controls="false" :step="0" v-model="model.markup" :disabled="detailFlag"></el-input-number> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="芯片价格" prop="chipPrice" :show-message="false"> |
||||
|
<el-input v-model="model.chipPrice" :disabled="detailFlag"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row :gutter="10"> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="币种" :show-message="false"> |
||||
|
<span slot="label" v-if="!detailFlag"> |
||||
|
<a @click="getBaseList(512)">币种</a> |
||||
|
</span> |
||||
|
<el-input v-model="model.currency" readonly :disabled="detailFlag"> |
||||
|
<span slot="suffix" v-show="model.currency && !detailFlag" @click="clearModalData('currency')"><i class="el-icon-circle-close" style="margin-left: 5px;cursor: pointer;"></i></span> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="报价日期" prop="quoteDate" :show-message="false"> |
||||
|
<el-date-picker style="width: 100%" :disabled="detailFlag" v-model="model.quoteDate" type="date" value-format='yyyy-MM-dd' format='yyyy-MM-dd'></el-date-picker> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row :gutter="10"> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="报价专员" prop="quoter" :show-message="false"> |
||||
|
<span slot="label" v-if="!detailFlag"> |
||||
|
<a @click="handleQuoterClick" >报价专员</a> |
||||
|
</span> |
||||
|
<el-input v-model="model.quoter" :disabled="detailFlag"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="采购专员" :show-message="false"> |
||||
|
<span slot="label" v-if="!detailFlag"> |
||||
|
<a @click="handlePurchaseClick" >采购专员</a> |
||||
|
</span> |
||||
|
<el-input v-model="model.purchase" :disabled="detailFlag"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> --> |
||||
|
<el-row :gutter="10"> |
||||
|
<el-col :span="24"> |
||||
|
<el-form-item label="项目收益" prop="remark" class="auto" :show-message="false"> |
||||
|
<el-input v-model="model.projectIncome" :disabled="detailFlag" :rows="3" type="textarea"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<div slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" v-if="!detailFlag" @click="handleSaveOrUpdateMachine" :loading="saveLoading">确 |
||||
|
定</el-button> |
||||
|
<el-button @click="saveVisible = false">取 消</el-button> |
||||
|
</div> |
||||
|
<UserChooseComponent ref="userChooseComponent" v-if="userVisible" :isPage="false" title="项目负责人" @selectFinish="selectResponsibleFinish"></UserChooseComponent> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import BuSelect from '../../../../components/selector/select/BuSelect.vue' |
||||
|
import DictDataSelect from '../../sys/dict-data-select.vue' |
||||
|
import { |
||||
|
saveMachine, |
||||
|
updateMachine, |
||||
|
getMachineById, |
||||
|
} from '../../../../api/machine/machineProject.js' |
||||
|
import { userList } from '../../../../api/user.js' |
||||
|
import UserChooseComponent from '../../../../components/selector/user/userChooseComponent.vue' |
||||
|
|
||||
|
export default { |
||||
|
name: 'machineProjectForm', |
||||
|
components: { |
||||
|
BuSelect, |
||||
|
DictDataSelect, |
||||
|
UserChooseComponent, |
||||
|
}, |
||||
|
props: { |
||||
|
//表单禁用 |
||||
|
disabled: { |
||||
|
type: Boolean, |
||||
|
default: false, |
||||
|
required: false, |
||||
|
}, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
model: {}, |
||||
|
saveVisible: false, |
||||
|
userVisible: false, |
||||
|
detailFlag: false, |
||||
|
userList: [], |
||||
|
saveRules: { |
||||
|
buId: [ |
||||
|
{ required: true, message: '请选择BU', trigger: ['blur', 'change'] }, |
||||
|
], |
||||
|
projectName: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: '请输入项目名称', |
||||
|
trigger: ['blur', 'change'], |
||||
|
}, |
||||
|
], |
||||
|
responsibleNo: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: '请选择项目负责人', |
||||
|
trigger: ['blur', 'change'], |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
saveLoading: false, |
||||
|
confirmLoading: false, |
||||
|
validatorRules: { |
||||
|
contactsName: [{ required: true, message: '请输入姓名!' }], |
||||
|
phone: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
pattern: /^1[3456789]\d{9}$/, |
||||
|
message: '请输入正确的手机号码!', |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
url: {}, |
||||
|
title: '添加联系人', |
||||
|
width: 800, |
||||
|
visible: false, |
||||
|
disableSubmit: false, |
||||
|
loading: false, |
||||
|
} |
||||
|
}, |
||||
|
computed: {}, |
||||
|
watch:{ |
||||
|
}, |
||||
|
created() { |
||||
|
//备份model原始值 |
||||
|
this.modelDefault = JSON.parse(JSON.stringify(this.model)) |
||||
|
}, |
||||
|
methods: { |
||||
|
add() { |
||||
|
this.saveVisible = true |
||||
|
this.model = {} |
||||
|
this.model = Object.assign({}, this.model) |
||||
|
this.getUserList() |
||||
|
}, |
||||
|
edit(record) { |
||||
|
this.saveVisible = true |
||||
|
this.getUserList() |
||||
|
this.model = Object.assign({}, record) |
||||
|
this.queryById(record.id) |
||||
|
}, |
||||
|
queryById(id) { |
||||
|
let params = { |
||||
|
id: id, |
||||
|
} |
||||
|
getMachineById(params).then((res) => { |
||||
|
this.model = res.data.record |
||||
|
}) |
||||
|
}, |
||||
|
getUserList() { |
||||
|
let params = { |
||||
|
site: this.$store.state.user.site, |
||||
|
status: 1, |
||||
|
} |
||||
|
userList(params).then((res) => { |
||||
|
if (res && res.data.code === 0) { |
||||
|
this.$set(this, 'userList', res.data.list) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
handleSaveOrUpdateMachine() { |
||||
|
this.$refs.saveForm.validate((valid, obj) => { |
||||
|
if (valid) { |
||||
|
if (this.model.id) { |
||||
|
this.handleUpdateMachine() |
||||
|
} else { |
||||
|
this.handleSaveMachine() |
||||
|
} |
||||
|
} else { |
||||
|
let i = 1 |
||||
|
for (let key in obj) { |
||||
|
this.$message.warning(obj[key][0].message) |
||||
|
if (i === 1) { |
||||
|
return |
||||
|
} |
||||
|
i++ |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
handleSaveMachine() { |
||||
|
let params = { |
||||
|
...this.model, |
||||
|
createBy: this.$store.state.user.name, |
||||
|
} |
||||
|
|
||||
|
this.saveLoading = true |
||||
|
saveMachine(params) |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.saveVisible = false |
||||
|
this.$message.success(data.msg) |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
this.$emit('selectFinished') |
||||
|
this.saveLoading = false |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.error(error) |
||||
|
this.saveLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
handleUpdateMachine() { |
||||
|
let params = { |
||||
|
...this.model, |
||||
|
updateBy: this.$store.state.user.name, |
||||
|
} |
||||
|
this.saveLoading = true |
||||
|
updateMachine(params) |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.saveVisible = false |
||||
|
this.currentQuote = { |
||||
|
...this.currentQuote, |
||||
|
} |
||||
|
this.$message.success(data.msg) |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
this.$emit('selectFinished') |
||||
|
this.saveLoading = false |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.error(error) |
||||
|
this.saveLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
getLabel() { |
||||
|
this.$nextTick(() => { |
||||
|
this.model.responsiblePerson = |
||||
|
this.$refs.responsiblePerson.selectedLabel |
||||
|
}) |
||||
|
}, |
||||
|
getResponsibleList(){ |
||||
|
this.userVisible = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.userChooseComponent.userInit() |
||||
|
}) |
||||
|
}, |
||||
|
selectResponsibleFinish(row){ |
||||
|
this.userVisible = false |
||||
|
this.model.responsibleNo = row.userId |
||||
|
this.model.responsiblePerson = row.userDisplay |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
.auto /deep/ .el-form-item__content { |
||||
|
height: auto; |
||||
|
line-height: 1.5; |
||||
|
} |
||||
|
|
||||
|
.el-table /deep/ .cell { |
||||
|
height: auto; |
||||
|
line-height: 1.5; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,240 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<el-button @click="addIncome()" v-if="!authFlag" |
||||
|
:disabled="this.project.sstatus != '草稿' && this.project.sstatus !='已驳回'">新增</el-button> |
||||
|
<div style="height: 100%;overflow: auto"> |
||||
|
<el-table :data="projectIncome" border v-loading="queryLoading" style="width: 100%;margin-top: 5px" |
||||
|
:height="height"> |
||||
|
<el-table-column type="index" width="55" align="center" label="序号"></el-table-column> |
||||
|
<el-table-column v-for="(item,index) in columns" :key="index" :sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" :fixed="item.fixed===''?false:item.fixed" :min-width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="scope.column.property == 'incomeName'"> |
||||
|
<el-tooltip class="item" effect="dark" :content="scope.row.incomeName" placement="top"> |
||||
|
<div>{{ formatContent(scope.row.incomeName) }}</div> |
||||
|
</el-tooltip> |
||||
|
</span> |
||||
|
<span v-else>{{scope.row[scope.column.property]}}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="备注" width="200" align="left" headerAlign="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-tooltip class="item" effect="dark" :content="scope.row.remark" placement="top"> |
||||
|
<div>{{ formatContent(scope.row.remark) }}</div> |
||||
|
</el-tooltip> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
|
||||
|
<el-table-column v-if="project.sstatus =='草稿'||project.sstatus =='进行中'||project.sstatus =='已驳回'" |
||||
|
header-align="center" align="center" width="140" label="操作"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-link style="cursor: pointer" |
||||
|
v-if="project.sstatus =='草稿'||project.sstatus =='进行中'||project.sstatus =='已驳回'" |
||||
|
@click="editIncome(scope.row)">修改</el-link> |
||||
|
<el-link style="cursor: pointer" v-if="project.sstatus =='草稿'||project.sstatus =='已驳回'" |
||||
|
@click="removeIncome(scope.row)">删除</el-link> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
<MachineProjectDetailForm ref="machineProjectDetailForm" v-if="projectDetalVisible" |
||||
|
@selectIncomeFinished="incomeFinished"></MachineProjectDetailForm> |
||||
|
</div> |
||||
|
|
||||
|
</template> |
||||
|
<script> |
||||
|
import MachineProjectDetailForm from './machineProjectDetailForm.vue' |
||||
|
import { deleteProjectIncome } from '../../../../api/machine/machineProjectIncome' |
||||
|
|
||||
|
export default { |
||||
|
name: 'machineProjectPlanTable', |
||||
|
components: { |
||||
|
MachineProjectDetailForm, |
||||
|
}, |
||||
|
props: { |
||||
|
project: { |
||||
|
type: Object, |
||||
|
required: true, |
||||
|
}, |
||||
|
projectIncome: { |
||||
|
type: Array, |
||||
|
required: true, |
||||
|
}, |
||||
|
height: { |
||||
|
type: [Number, String], |
||||
|
default: 300, |
||||
|
}, |
||||
|
authFlag: { |
||||
|
type: Boolean, |
||||
|
default: false, |
||||
|
}, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
saveQuoteDetail: {}, |
||||
|
saveLoading: false, |
||||
|
queryLoading: false, |
||||
|
saveVisible: false, |
||||
|
projectDetalVisible: false, |
||||
|
saveQuoteDetailRules: {}, |
||||
|
columns: [ |
||||
|
/* { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1BuDesc', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'incomeNo', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '费用编码', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120, |
||||
|
}, */ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1CustomerNo', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'incomeName', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: '费用描述', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 140, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1CustomerDesc', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'incomeBudget', |
||||
|
headerAlign: 'center', |
||||
|
align: 'right', |
||||
|
columnLabel: '预算金额', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1RequesterName', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'actualExpenses', |
||||
|
headerAlign: 'center', |
||||
|
align: 'right', |
||||
|
columnLabel: '实际开销', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5012, |
||||
|
serialNumber: '5012Table1QuoterName', |
||||
|
tableId: '5012Table1', |
||||
|
tableName: '项目信息', |
||||
|
columnProp: 'currencyDesc', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '币种', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 80, |
||||
|
}, |
||||
|
], |
||||
|
formVisible: false, |
||||
|
|
||||
|
quoteGroupDetail: {}, |
||||
|
drawerVisible: false, |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
addIncome() { |
||||
|
this.projectDetalVisible = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.machineProjectDetailForm.add(this.project) |
||||
|
}) |
||||
|
}, |
||||
|
editIncome(record) { |
||||
|
this.projectDetalVisible = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.machineProjectDetailForm.edit(record, this.project) |
||||
|
}) |
||||
|
}, |
||||
|
removeIncome(row) { |
||||
|
this.$confirm('确认删除该项目信息吗?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning', |
||||
|
}).then(() => { |
||||
|
this.handleRemoveIncome(row) |
||||
|
}) |
||||
|
}, |
||||
|
handleRemoveIncome(row) { |
||||
|
let params = { |
||||
|
id: row.id, |
||||
|
} |
||||
|
deleteProjectIncome(params) |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.$message.success(data.msg) |
||||
|
this.incomeFinished() |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.error(error) |
||||
|
}) |
||||
|
}, |
||||
|
incomeFinished() { |
||||
|
this.$emit('IncomeFinished') |
||||
|
}, |
||||
|
formatContent(content, length = 15) { |
||||
|
if (content && content.length > length) { |
||||
|
return content.substr(0, length) + '...' |
||||
|
} |
||||
|
return content |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
watch: {}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.auto /deep/ .el-form-item__content { |
||||
|
height: auto; |
||||
|
line-height: 1.5; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
@ -0,0 +1,214 @@ |
|||||
|
<template> |
||||
|
<div style="height:100%" class="planDetail"> |
||||
|
<el-dialog :title="model.id? '编辑' :'新增'" v-drag :close-on-click-modal="false" :append-to-body='true' :visible.sync="saveVisible" |
||||
|
width="500px"> |
||||
|
<el-form ref="saveForm" :model="model" :rules="saveRules" label-position="top" label-width="100px"> |
||||
|
<el-row :gutter="10"> |
||||
|
<el-col :span="16"> |
||||
|
<el-form-item label="计划描述" prop="planDescribe" :show-message="false"> |
||||
|
<el-input v-model="model.planDescribe" :disabled="detailFlag"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row :gutter="10"> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="计划开始时间" prop="startDate" :show-message="false"> |
||||
|
<el-date-picker style="width: 120px" v-model="model.startDate" type="date" value-format="yyyy-MM-dd" |
||||
|
placeholder="选择日期"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="计划完成时间" prop="endDate" :show-message="false"> |
||||
|
<el-date-picker style="width: 120px" v-model="model.endDate" type="date" value-format="yyyy-MM-dd" |
||||
|
placeholder="选择日期"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row :gutter="10"> |
||||
|
<el-col :span="24"> |
||||
|
<el-form-item label="备注" prop="remark" class="auto" :show-message="false"> |
||||
|
<el-input v-model="model.remark" :disabled="detailFlag" :rows="3" :max="255" type="textarea"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<div slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" v-if="!detailFlag" @click="handleSaveOrUpdatePlan" :loading="saveLoading">确 |
||||
|
定</el-button> |
||||
|
<el-button @click="saveVisible = false">取 消</el-button> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
saveMachineProjectPlan, |
||||
|
updateMachineProjectPlan, |
||||
|
} from '../../../../api/machine/machineProjectIncome' |
||||
|
export default { |
||||
|
name: 'machineProjectPlanDetailForm', |
||||
|
components: {}, |
||||
|
props: { |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
model: {}, |
||||
|
saveVisible: false, |
||||
|
detailFlag: false, |
||||
|
userList: [], |
||||
|
saveRules: { |
||||
|
buId: [ |
||||
|
{ required: true, message: '请选择BU', trigger: ['blur', 'change'] }, |
||||
|
], |
||||
|
projectName: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: '请输入项目名称', |
||||
|
trigger: ['blur', 'change'], |
||||
|
}, |
||||
|
], |
||||
|
responsibleNo: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: '请选择项目负责人', |
||||
|
trigger: ['blur', 'change'], |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
saveLoading: false, |
||||
|
validatorRules: { |
||||
|
contactsName: [{ required: true, message: '请输入姓名!' }], |
||||
|
phone: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
pattern: /^1[3456789]\d{9}$/, |
||||
|
message: '请输入正确的手机号码!', |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
url: {}, |
||||
|
visible: false, |
||||
|
disableSubmit: false, |
||||
|
loading: false, |
||||
|
} |
||||
|
}, |
||||
|
computed: {}, |
||||
|
created() { |
||||
|
//备份model原始值 |
||||
|
this.modelDefault = JSON.parse(JSON.stringify(this.model)) |
||||
|
}, |
||||
|
methods: { |
||||
|
add(record) { |
||||
|
console.log(record); |
||||
|
|
||||
|
this.saveVisible = true |
||||
|
this.model = JSON.parse(JSON.stringify({})) |
||||
|
|
||||
|
this.model.site = record.site |
||||
|
this.model.buNo = record.buNo |
||||
|
this.model.projectNo = record.projectNo |
||||
|
this.model.projectName = record.projectName |
||||
|
}, |
||||
|
edit(record) { |
||||
|
console.log("????"); |
||||
|
|
||||
|
this.saveVisible = true |
||||
|
this.model = JSON.parse(JSON.stringify(record)) |
||||
|
}, |
||||
|
queryById(id) { |
||||
|
let params = { |
||||
|
id: id, |
||||
|
} |
||||
|
getMachineById(params).then((res) => { |
||||
|
this.model = res.data.record |
||||
|
console.log('res', this.model) |
||||
|
}) |
||||
|
}, |
||||
|
handleSaveOrUpdatePlan() { |
||||
|
this.$refs.saveForm.validate((valid, obj) => { |
||||
|
if (valid) { |
||||
|
if (this.model.id) { |
||||
|
this.handleUpdatePlan() |
||||
|
} else { |
||||
|
this.handleSavePlan() |
||||
|
} |
||||
|
} else { |
||||
|
let i = 1 |
||||
|
for (let key in obj) { |
||||
|
this.$message.warning(obj[key][0].message) |
||||
|
if (i === 1) { |
||||
|
return |
||||
|
} |
||||
|
i++ |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
handleSavePlan() { |
||||
|
let params = { |
||||
|
...this.model, |
||||
|
createBy: this.$store.state.user.name, |
||||
|
} |
||||
|
|
||||
|
this.saveLoading = true |
||||
|
saveMachineProjectPlan(params) |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.saveVisible = false |
||||
|
this.$message.success(data.msg) |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
this.$emit('selectFinished') |
||||
|
this.saveLoading = false |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.error(error) |
||||
|
this.saveLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
handleUpdatePlan() { |
||||
|
let params = { |
||||
|
...this.model, |
||||
|
updateBy: this.$store.state.user.name, |
||||
|
site: this.$store.state.user.site, |
||||
|
} |
||||
|
this.saveLoading = true |
||||
|
updateMachineProjectPlan(params) |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.saveVisible = false |
||||
|
this.currentQuote = { |
||||
|
...this.currentQuote, |
||||
|
} |
||||
|
this.$message.success(data.msg) |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
this.$emit('selectFinished') |
||||
|
this.saveLoading = false |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.error(error) |
||||
|
this.saveLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
getLabel() { |
||||
|
this.$nextTick(() => { |
||||
|
this.model.responsiblePerson = |
||||
|
this.$refs.responsiblePerson.selectedLabel |
||||
|
}) |
||||
|
}, |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
.auto /deep/ .el-form-item__content { |
||||
|
height: auto; |
||||
|
line-height: 1.5; |
||||
|
|
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,263 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<el-button v-if="!authFlag" :disabled="this.project.sstatus != '进行中'" @click="addPlan()">新增</el-button> |
||||
|
<el-table v-loading="queryLoading" border :data="projectPlan" style="width: 100%;margin-top: 5px" :height="height"> |
||||
|
<el-table-column type="index" width="55" align="center" label="序号"></el-table-column> |
||||
|
<el-table-column v-for="(item,index) in columns" :key="index" :sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" :fixed="item.fixed === ''?false:item.fixed" :min-width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="scope.column.property == 'planDescribe'"> |
||||
|
<el-tooltip class="item" effect="dark" :content="scope.row.planDescribe" placement="top"> |
||||
|
<div>{{ formatContent(scope.row.planDescribe) }}</div> |
||||
|
</el-tooltip> |
||||
|
</span> |
||||
|
<span v-else-if="scope.column.property == 'remark'"> |
||||
|
<el-tooltip class="item" effect="dark" :content="scope.row.remark" placement="top"> |
||||
|
<div>{{ formatContent(scope.row.remark) }}</div> |
||||
|
</el-tooltip> |
||||
|
</span> |
||||
|
<span v-else>{{scope.row[scope.column.property]}}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="操作" v-if="!authFlag && this.project.sstatus == '进行中'" align="center" width="120"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-link style="cursor: pointer" @click="editPlan(scope.row)">修改</el-link> |
||||
|
<el-link style="cursor: pointer" @click="removePlan(scope.row)">删除</el-link> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<MachineProjectPlanDetailForm ref="machineProjectPlanDetailForm" v-if="formVisible" |
||||
|
@selectFinished="planTableFinished"></MachineProjectPlanDetailForm> |
||||
|
</div> |
||||
|
|
||||
|
</template> |
||||
|
<script> |
||||
|
import MachineProjectPlanDetailForm from './machineProjectPlanDetailForm.vue' |
||||
|
import { deleteProjectPlan } from '../../../../api/machine/machineProjectIncome' |
||||
|
|
||||
|
export default { |
||||
|
name: 'machineProjectPlanTable', |
||||
|
components: { |
||||
|
MachineProjectPlanDetailForm, |
||||
|
}, |
||||
|
props: { |
||||
|
project: { |
||||
|
type: Object, |
||||
|
required: true, |
||||
|
}, |
||||
|
projectPlan: { |
||||
|
type: Array, |
||||
|
required: true, |
||||
|
}, |
||||
|
height: { |
||||
|
type: [Number, String], |
||||
|
default: 300, |
||||
|
}, |
||||
|
authFlag: { |
||||
|
type: Boolean, |
||||
|
default: false, |
||||
|
}, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
saveQuoteDetail: {}, |
||||
|
saveLoading: false, |
||||
|
queryLoading: false, |
||||
|
saveVisible: false, |
||||
|
saveQuoteDetailRules: { |
||||
|
partNo: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: '请输入物料编码', |
||||
|
trigger: ['blur', 'change'], |
||||
|
}, |
||||
|
], |
||||
|
partDesc: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: '请输入物料名称', |
||||
|
trigger: ['blur', 'change'], |
||||
|
}, |
||||
|
], |
||||
|
qty: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: '请输入数量', |
||||
|
trigger: ['blur', 'change'], |
||||
|
}, |
||||
|
], |
||||
|
type: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: '请选择TP类型', |
||||
|
trigger: ['blur', 'change'], |
||||
|
}, |
||||
|
], |
||||
|
costModel: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: '请选择Cost Model', |
||||
|
trigger: ['blur', 'change'], |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
columns: [ |
||||
|
/* { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5011, |
||||
|
serialNumber: '5011Table2PartNo', |
||||
|
tableId: '5011Table2', |
||||
|
tableName: '项目计划表', |
||||
|
columnProp: 'planNo', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '计划编码', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, */ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5011, |
||||
|
serialNumber: '5011Table2PartDesc', |
||||
|
tableId: '5011Table2', |
||||
|
tableName: '项目计划表', |
||||
|
columnProp: 'planDescribe', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: '计划描述', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 200, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5011, |
||||
|
serialNumber: '5011Table2Qty', |
||||
|
tableId: '5011Table2', |
||||
|
tableName: '项目计划表', |
||||
|
columnProp: 'startDate', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '计划开始时间', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5011, |
||||
|
serialNumber: '5011Table2AdjustBomUnYield', |
||||
|
tableId: '5011Table2', |
||||
|
tableName: '项目计划表', |
||||
|
columnProp: 'endDate', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '计划完成时间', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 130, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5011, |
||||
|
serialNumber: '5011Table2AdjustLabourCost', |
||||
|
tableId: '5011Table2', |
||||
|
tableName: '项目计划表', |
||||
|
columnProp: 'remark', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: '备注', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120, |
||||
|
}, |
||||
|
], |
||||
|
formVisible: false, |
||||
|
|
||||
|
quoteGroupDetail: {}, |
||||
|
drawerVisible: false, |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
addPlan() { |
||||
|
this.formVisible = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.machineProjectPlanDetailForm.add(this.project) |
||||
|
}) |
||||
|
}, |
||||
|
editPlan(row) { |
||||
|
this.formVisible = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.machineProjectPlanDetailForm.edit(row) |
||||
|
}) |
||||
|
}, |
||||
|
planTableFinished() { |
||||
|
this.$emit('planFinished') |
||||
|
}, |
||||
|
removePlan(row) { |
||||
|
this.$confirm('确认删除该项目信息吗?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning', |
||||
|
}).then(() => { |
||||
|
this.handleRemovePlan(row) |
||||
|
}) |
||||
|
}, |
||||
|
handleRemovePlan(row) { |
||||
|
let params = { |
||||
|
id: row.id, |
||||
|
} |
||||
|
deleteProjectPlan(params) |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.$message.success(data.msg) |
||||
|
this.planTableFinished() |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.error(error) |
||||
|
}) |
||||
|
}, |
||||
|
formatContent(content, length = 15) { |
||||
|
if (content && content.length > length) { |
||||
|
return content.substr(0, length) + '...' |
||||
|
} |
||||
|
return content |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
watch: {}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.auto /deep/ .el-form-item__content { |
||||
|
height: auto; |
||||
|
line-height: 1.5; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,190 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<el-dialog :title="model.id? '编辑' :'新增'" v-drag :close-on-click-modal="false" :append-to-body='true' :visible.sync="saveVisible" |
||||
|
width="500px"> |
||||
|
<el-form ref="saveForm" :model="model" :rules="saveRules" label-position="top" label-width="100px"> |
||||
|
<el-row :gutter="10"> |
||||
|
<el-col :span="16"> |
||||
|
<el-form-item label="任务描述" prop="taskDescribe" :show-message="false"> |
||||
|
<el-input v-model="model.taskDescribe" :disabled="detailFlag"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row :gutter="10"> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="任务开始时间" prop="startDate" :show-message="false"> |
||||
|
<el-date-picker style="width: 120px" v-model="model.startDate" type="date" value-format="yyyy-MM-dd" |
||||
|
placeholder="选择日期"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="任务完成时间" prop="endDate" :show-message="false"> |
||||
|
<el-date-picker style="width: 120px" v-model="model.endDate" type="date" value-format="yyyy-MM-dd" |
||||
|
placeholder="选择日期"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row :gutter="10"> |
||||
|
<el-col :span="24"> |
||||
|
<el-form-item label="备注" prop="remark" class="auto" :show-message="false"> |
||||
|
<el-input v-model="model.remark" :disabled="detailFlag" :rows="3" :max="255" type="textarea"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<div slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" v-if="!detailFlag" @click="handleSaveOrUpdateTask" :loading="saveLoading">确 |
||||
|
定</el-button> |
||||
|
<el-button @click="saveVisible = false">取 消</el-button> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
saveMachineProjectTask, |
||||
|
updateMachineProjectTask, |
||||
|
} from '../../../../api/machine/machineProjectIncome' |
||||
|
export default { |
||||
|
name: 'machineProjectPlanDetailForm', |
||||
|
components: {}, |
||||
|
props: { |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
model: {}, |
||||
|
saveVisible: false, |
||||
|
detailFlag: false, |
||||
|
userList: [], |
||||
|
saveRules: { |
||||
|
buId: [ |
||||
|
{ required: true, message: '请选择BU', trigger: ['blur', 'change'] }, |
||||
|
], |
||||
|
projectName: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: '请输入项目名称', |
||||
|
trigger: ['blur', 'change'], |
||||
|
}, |
||||
|
], |
||||
|
responsibleNo: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: '请选择项目负责人', |
||||
|
trigger: ['blur', 'change'], |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
saveLoading: false, |
||||
|
url: {}, |
||||
|
visible: false, |
||||
|
disableSubmit: false, |
||||
|
loading: false, |
||||
|
} |
||||
|
}, |
||||
|
computed: {}, |
||||
|
created() { |
||||
|
//备份model原始值 |
||||
|
this.modelDefault = JSON.parse(JSON.stringify(this.model)) |
||||
|
}, |
||||
|
methods: { |
||||
|
add(record) { |
||||
|
this.saveVisible = true |
||||
|
this.model = JSON.parse(JSON.stringify({})) |
||||
|
|
||||
|
this.model.site = record.site |
||||
|
this.model.buNo = record.buNo |
||||
|
this.model.projectNo = record.projectNo |
||||
|
this.model.projectName = record.projectName |
||||
|
}, |
||||
|
edit(record) { |
||||
|
this.saveVisible = true |
||||
|
this.model = JSON.parse(JSON.stringify(record)) |
||||
|
}, |
||||
|
handleSaveOrUpdateTask() { |
||||
|
this.$refs.saveForm.validate((valid, obj) => { |
||||
|
if (valid) { |
||||
|
if (this.model.id) { |
||||
|
this.handleUpdateTask() |
||||
|
} else { |
||||
|
this.handleSaveTask() |
||||
|
} |
||||
|
} else { |
||||
|
let i = 1 |
||||
|
for (let key in obj) { |
||||
|
this.$message.warning(obj[key][0].message) |
||||
|
if (i === 1) { |
||||
|
return |
||||
|
} |
||||
|
i++ |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
handleSaveTask() { |
||||
|
let params = { |
||||
|
...this.model, |
||||
|
createBy: this.$store.state.user.name, |
||||
|
} |
||||
|
|
||||
|
this.saveLoading = true |
||||
|
saveMachineProjectTask(params) |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.saveVisible = false |
||||
|
this.$message.success(data.msg) |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
this.$emit('selectFinished') |
||||
|
this.saveLoading = false |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.error(error) |
||||
|
this.saveLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
handleUpdateTask() { |
||||
|
let params = { |
||||
|
...this.model, |
||||
|
updateBy: this.$store.state.user.name, |
||||
|
site: this.$store.state.user.site, |
||||
|
} |
||||
|
this.saveLoading = true |
||||
|
updateMachineProjectTask(params) |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.saveVisible = false |
||||
|
this.currentQuote = { |
||||
|
...this.currentQuote, |
||||
|
} |
||||
|
this.$message.success(data.msg) |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
this.$emit('selectFinished') |
||||
|
this.saveLoading = false |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.error(error) |
||||
|
this.saveLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
getLabel() { |
||||
|
this.$nextTick(() => { |
||||
|
this.model.responsiblePerson = |
||||
|
this.$refs.responsiblePerson.selectedLabel |
||||
|
}) |
||||
|
}, |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
.auto /deep/ .el-form-item__content { |
||||
|
height: auto; |
||||
|
line-height: 1.5; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,262 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<el-button v-if="!authFlag" :disabled="this.project.sstatus != '进行中'" @click="addTask()">新增</el-button> |
||||
|
<el-table v-loading="queryLoading" border :data="projectTask" style="width: 100%;margin-top: 5px" :height="height"> |
||||
|
<el-table-column type="index" width="55" align="center" label="序号"></el-table-column> |
||||
|
<el-table-column v-for="(item,index) in columns" :key="index" :sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" :fixed="item.fixed === ''?false:item.fixed" :min-width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="scope.column.property == 'taskDescribe'"> |
||||
|
<el-tooltip class="item" effect="dark" :content="scope.row.taskDescribe" placement="top"> |
||||
|
<div>{{ formatContent(scope.row.taskDescribe) }}</div> |
||||
|
</el-tooltip> |
||||
|
</span> |
||||
|
<span v-else-if="scope.column.property == 'remark'"> |
||||
|
<el-tooltip class="item" effect="dark" :content="scope.row.remark" placement="top"> |
||||
|
<div>{{ formatContent(scope.row.remark) }}</div> |
||||
|
</el-tooltip> |
||||
|
</span> |
||||
|
<span v-else>{{scope.row[scope.column.property]}}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
|
||||
|
<el-table-column label="操作" v-if="!authFlag && this.project.sstatus == '进行中'" align="center" width="120"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-link style="cursor: pointer" @click="editTask(scope.row)">修改</el-link> |
||||
|
<el-link style="cursor: pointer" @click="removeTask(scope.row)">删除</el-link> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<MachineProjectTaskDetailForm ref="machineProjectTaskDetailForm" v-if="formVisible" |
||||
|
@selectFinished="taskTableFinished"></MachineProjectTaskDetailForm> |
||||
|
</div> |
||||
|
|
||||
|
</template> |
||||
|
<script> |
||||
|
import MachineProjectTaskDetailForm from './machineProjectTaskDetailForm.vue' |
||||
|
import { deleteProjectTask } from '../../../../api/machine/machineProjectIncome' |
||||
|
|
||||
|
export default { |
||||
|
name: 'machineProjectPlanTable', |
||||
|
components: { |
||||
|
MachineProjectTaskDetailForm, |
||||
|
}, |
||||
|
|
||||
|
props: { |
||||
|
project: { |
||||
|
type: Object, |
||||
|
required: true, |
||||
|
}, |
||||
|
projectTask: { |
||||
|
type: Array, |
||||
|
required: true, |
||||
|
}, |
||||
|
height: { |
||||
|
type: [Number, String], |
||||
|
default: 300, |
||||
|
}, |
||||
|
authFlag: { |
||||
|
type: Boolean, |
||||
|
default: false, |
||||
|
}, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
model: {}, |
||||
|
saveQuoteDetail: {}, |
||||
|
dataList: [], |
||||
|
saveLoading: false, |
||||
|
queryLoading: false, |
||||
|
saveVisible: false, |
||||
|
saveQuoteDetailRules: { |
||||
|
partNo: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: '请输入物料编码', |
||||
|
trigger: ['blur', 'change'], |
||||
|
}, |
||||
|
], |
||||
|
partDesc: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: '请输入物料名称', |
||||
|
trigger: ['blur', 'change'], |
||||
|
}, |
||||
|
], |
||||
|
qty: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: '请输入数量', |
||||
|
trigger: ['blur', 'change'], |
||||
|
}, |
||||
|
], |
||||
|
type: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: '请选择TP类型', |
||||
|
trigger: ['blur', 'change'], |
||||
|
}, |
||||
|
], |
||||
|
costModel: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: '请选择Cost Model', |
||||
|
trigger: ['blur', 'change'], |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
columns: [ |
||||
|
/* { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5011, |
||||
|
serialNumber: '5011Table2PartNo', |
||||
|
tableId: '5011Table2', |
||||
|
tableName: '项目任务表', |
||||
|
columnProp: 'taskNo', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '任务编码', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, */ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5011, |
||||
|
serialNumber: '5011Table2PartDesc', |
||||
|
tableId: '5011Table2', |
||||
|
tableName: '项目任务表', |
||||
|
columnProp: 'taskDescribe', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: '任务描述', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 200, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5011, |
||||
|
serialNumber: '5011Table2Qty', |
||||
|
tableId: '5011Table2', |
||||
|
tableName: '项目任务表', |
||||
|
columnProp: 'startDate', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '任务开始时间', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5011, |
||||
|
serialNumber: '5011Table2AdjustBomUnYield', |
||||
|
tableId: '5011Table2', |
||||
|
tableName: '项目任务表', |
||||
|
columnProp: 'endDate', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '任务完成时间', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 130, |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 5011, |
||||
|
serialNumber: '5011Table2AdjustLabourCost', |
||||
|
tableId: '5011Table2', |
||||
|
tableName: '项目任务表', |
||||
|
columnProp: 'remark', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: '备注', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120, |
||||
|
}, |
||||
|
], |
||||
|
formVisible: false, |
||||
|
|
||||
|
quoteGroupDetail: {}, |
||||
|
drawerVisible: false, |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
addTask() { |
||||
|
this.formVisible = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.machineProjectTaskDetailForm.add(this.project) |
||||
|
}) |
||||
|
}, |
||||
|
editTask(row) { |
||||
|
this.formVisible = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.machineProjectTaskDetailForm.edit(row) |
||||
|
}) |
||||
|
}, |
||||
|
taskTableFinished() { |
||||
|
this.$emit('taskFinished') |
||||
|
}, |
||||
|
removeTask(row) { |
||||
|
this.$confirm('确认删除该项目信息吗?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning', |
||||
|
}).then(() => { |
||||
|
this.handleRemoveTask(row) |
||||
|
}) |
||||
|
}, |
||||
|
handleRemoveTask(row) { |
||||
|
let params = { |
||||
|
id: row.id, |
||||
|
} |
||||
|
deleteProjectTask(params) |
||||
|
.then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.$message.success(data.msg) |
||||
|
this.taskTableFinished() |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
this.$message.error(error) |
||||
|
}) |
||||
|
}, |
||||
|
formatContent(content, length = 15) { |
||||
|
if (content && content.length > length) { |
||||
|
return content.substr(0, length) + '...' |
||||
|
} |
||||
|
return content |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
watch: {}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
|
||||
1776
src/views/modules/orderIssure/soIssueNotify/searchConfirmIssureNotify.vue
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,341 @@ |
|||||
|
<script> |
||||
|
import {ossUpload, previewOssFileById, previewOssFileById2, removeOss} from "../../../api/oss/oss"; |
||||
|
import {projectIncomeUpload,projectIncomeQueryOss} from "../../../api/machine/machineProjectIncome"; |
||||
|
import XLSX from 'xlsx'; |
||||
|
import jsPDF from 'jspdf'; |
||||
|
import * as mammoth from 'mammoth'; // Ensure it's correctly imported |
||||
|
|
||||
|
export default { |
||||
|
name: "ossProjectComponents", |
||||
|
props:{ |
||||
|
orderRef1:{ |
||||
|
type:String, |
||||
|
default:'' |
||||
|
}, |
||||
|
orderRef2:{ |
||||
|
type:[Number,String], |
||||
|
default:'' |
||||
|
}, |
||||
|
rfqNo:{ |
||||
|
type:String, |
||||
|
default:'' |
||||
|
}, |
||||
|
columns:{ |
||||
|
type:Array, |
||||
|
required:true |
||||
|
}, |
||||
|
height:{ |
||||
|
type:[String,Number], |
||||
|
default:'35vh' |
||||
|
}, |
||||
|
title:{ |
||||
|
type:String, |
||||
|
default:'附件信息' |
||||
|
}, |
||||
|
label:{ |
||||
|
type:String, |
||||
|
default:'单号' |
||||
|
}, |
||||
|
disabled:{ |
||||
|
type:Boolean, |
||||
|
default:false |
||||
|
}, |
||||
|
}, |
||||
|
data(){ |
||||
|
return{ |
||||
|
dataList:[], |
||||
|
queryLoading:false, |
||||
|
uploadLoading:false, |
||||
|
selectionDataList:[], |
||||
|
ossVisible:false, |
||||
|
ossForm:{ |
||||
|
orderRef2:'', |
||||
|
rfqNo:'', |
||||
|
remark:'' |
||||
|
}, |
||||
|
fileList:[], |
||||
|
} |
||||
|
}, |
||||
|
methods:{ |
||||
|
handleSelectionChange(val){ |
||||
|
this.selectionDataList = val |
||||
|
}, |
||||
|
handleQuery(){ |
||||
|
if (!this.params.orderRef1 && !this.params.orderRef2){ |
||||
|
return; |
||||
|
} |
||||
|
let params = { |
||||
|
...this.params, |
||||
|
} |
||||
|
this.queryLoading = true; |
||||
|
projectIncomeQueryOss(params).then(({data})=>{ |
||||
|
if (data && data.code === 0){ |
||||
|
this.dataList = data.rows; |
||||
|
}else { |
||||
|
this.$message.warning(data.msg); |
||||
|
} |
||||
|
this.queryLoading = false; |
||||
|
}).catch((error)=>{ |
||||
|
this.$message.error(error); |
||||
|
this.queryLoading = false; |
||||
|
}) |
||||
|
}, |
||||
|
handleUpload(){ |
||||
|
this.ossForm.rfqNo = this.rfqNo |
||||
|
this.$nextTick(()=>{ |
||||
|
if (this.$refs.upload){ |
||||
|
this.$refs.upload.clearFiles(); |
||||
|
} |
||||
|
}) |
||||
|
this.fileList = []; |
||||
|
this.ossForm.remark = ''; |
||||
|
this.ossVisible = true |
||||
|
}, |
||||
|
onRemoveFile(file, fileList){ |
||||
|
this.fileList = fileList |
||||
|
}, |
||||
|
onChangeFile(file, fileList){ |
||||
|
this.fileList = fileList |
||||
|
}, |
||||
|
handleUploadFiles(){ |
||||
|
if (this.fileList.length === 0){ |
||||
|
this.$message.error('请选择文件'); |
||||
|
return; |
||||
|
} |
||||
|
let formData = new FormData(); |
||||
|
for (let i = 0; i < this.fileList.length; i++) { |
||||
|
formData.append('file', this.fileList[i].raw); |
||||
|
} |
||||
|
formData.append('orderRef1', this.orderRef1); |
||||
|
formData.append('orderRef2', this.orderRef2); |
||||
|
formData.append('orderRef3', this.rfqNo); |
||||
|
formData.append('createdBy', this.$store.state.user.name); |
||||
|
formData.append('cAdditionalInfo', this.ossForm.remark); |
||||
|
|
||||
|
this.uploadLoading = true; |
||||
|
projectIncomeUpload(formData).then(({data})=>{ |
||||
|
if (data && data.code === 0){ |
||||
|
this.$message.success(data.msg); |
||||
|
this.handleQuery(); |
||||
|
this.ossVisible = false; |
||||
|
}else { |
||||
|
this.$message.warning(data.msg); |
||||
|
} |
||||
|
this.uploadLoading = false; |
||||
|
}).catch((error)=>{ |
||||
|
this.$message.error(error); |
||||
|
this.uploadLoading = false; |
||||
|
}) |
||||
|
}, |
||||
|
handleRemove(row){ |
||||
|
this.$confirm('确认删除吗?', '提示').then(() => { |
||||
|
let ids = [row.id] |
||||
|
removeOss(ids).then(({data})=>{ |
||||
|
if (data && data.code === 0){ |
||||
|
this.$message.success(data.msg); |
||||
|
this.handleQuery(); |
||||
|
}else { |
||||
|
this.$message.warning(data.msg); |
||||
|
} |
||||
|
}).catch((error)=>{ |
||||
|
this.$message.error(error); |
||||
|
}) |
||||
|
}).catch(()=>{ |
||||
|
|
||||
|
}) |
||||
|
}, |
||||
|
previewFile(row){ |
||||
|
// 预览文件 |
||||
|
let type = ''; |
||||
|
let image = ['jpg', 'jpeg', 'png', 'gif', 'bmp']; |
||||
|
if (image.includes(row.fileType.toLowerCase())){ |
||||
|
type = 'image/' + row.fileType; |
||||
|
} |
||||
|
let video = ['mp4', 'avi', 'mov', 'wmv', 'flv']; |
||||
|
if (video.includes(row.fileType.toLowerCase())){ |
||||
|
type = 'video/' + row.fileType; |
||||
|
} |
||||
|
|
||||
|
let txt = ['txt']; |
||||
|
if (txt.includes(row.fileType.toLowerCase())){ |
||||
|
type = 'text/plain;charset=utf-8'; |
||||
|
} |
||||
|
let office = ['doc', 'ppt', 'pptx']; |
||||
|
if (office.includes(row.fileType.toLowerCase())){ |
||||
|
this.$message.warning(`该文件格式暂不支持预览`) |
||||
|
return |
||||
|
} |
||||
|
|
||||
|
let excel = ['xlsx','xls']; |
||||
|
if (excel.includes(row.fileType.toLowerCase())){ |
||||
|
type = 'excel'; |
||||
|
} |
||||
|
let word = ['docx']; |
||||
|
if (word.includes(row.fileType.toLowerCase())){ |
||||
|
type = 'word' |
||||
|
} |
||||
|
let pdf = ['pdf']; |
||||
|
if (pdf.includes(row.fileType.toLowerCase())){ |
||||
|
type = 'application/pdf;charset-UTF-8'; |
||||
|
} |
||||
|
|
||||
|
if (type === ''){ |
||||
|
this.$message.warning(`该文件格式暂不支持预览`) |
||||
|
return; |
||||
|
} |
||||
|
let params = { |
||||
|
id:row.id, |
||||
|
fileType:type |
||||
|
} |
||||
|
previewOssFileById2(params).then(({data}) => { |
||||
|
if (type === 'excel' || type === 'word'){ |
||||
|
type = 'application/pdf;charset=UTF-8' |
||||
|
} |
||||
|
const blob = new Blob([data], { type: type }); |
||||
|
// 创建URL来生成预览 |
||||
|
const fileURL = URL.createObjectURL(blob); |
||||
|
if (type === 'xls' || type === 'docx' || type === 'xlsx'){ |
||||
|
const { href } = this.$router.resolve({ |
||||
|
name: 'pre', |
||||
|
query:{ |
||||
|
src: fileURL, |
||||
|
type: 'pdf' // 直接传递 pdf 类型 |
||||
|
} |
||||
|
}) |
||||
|
window.open(href, '_blank') |
||||
|
}else { |
||||
|
// 在新标签页中打开文件预览 |
||||
|
const newTab = window.open(fileURL, '_blank'); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
handleDownload(){ |
||||
|
if (this.selectionDataList.length === 0){ |
||||
|
this.$message.warning('请选择要下载的附件'); |
||||
|
return; |
||||
|
} |
||||
|
for (let i = 0; i < this.selectionDataList.length; i++) { |
||||
|
let params = { |
||||
|
id:this.selectionDataList[i].id, |
||||
|
} |
||||
|
previewOssFileById(params).then((response) => { |
||||
|
const blob = new Blob([response.data], { type: response.headers['content-type'] }); |
||||
|
const link = document.createElement('a'); |
||||
|
link.href = URL.createObjectURL(blob); |
||||
|
link.setAttribute('download', this.selectionDataList[i].fileName); |
||||
|
link.target = '_blank'; // 打开新窗口预览 |
||||
|
link.click(); |
||||
|
URL.revokeObjectURL(link.href); |
||||
|
this.$refs.table.clearSelection(); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
computed:{ |
||||
|
params:{ |
||||
|
get(){ |
||||
|
return{ |
||||
|
orderRef1:this.orderRef1, |
||||
|
orderRef2:this.orderRef2, |
||||
|
orderRef3:this.rfqNo, |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
watch:{ |
||||
|
params:{ |
||||
|
handler(){ |
||||
|
this.ossForm.orderRef2 = this.orderRef2; |
||||
|
this.ossForm.rfqNo = this.rfqNo; |
||||
|
this.dataList = []; |
||||
|
this.handleQuery(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<template> |
||||
|
<div> |
||||
|
<el-button type="primary" v-if="this.orderRef1 && this.orderRef2 && !disabled" @click="handleUpload">上传附件</el-button> |
||||
|
<el-button type="primary" @click="handleDownload">下载</el-button> |
||||
|
<el-table |
||||
|
:height="height" |
||||
|
:data="dataList" |
||||
|
ref="table" |
||||
|
v-loading="queryLoading" |
||||
|
border |
||||
|
@selection-change="handleSelectionChange" |
||||
|
style="width: 100%;margin-top: 5px"> |
||||
|
<el-table-column type="selection" label="序号" align="center"/> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in columns" :key="index" |
||||
|
:sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" |
||||
|
:header-align="item.headerAlign" |
||||
|
:show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" |
||||
|
:fixed="item.fixed===''?false:item.fixed" |
||||
|
:min-width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span> |
||||
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
fixed="right" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
width="120" |
||||
|
label="操作"> |
||||
|
<template slot-scope="{row,$index}"> |
||||
|
<el-link style="cursor:pointer;" v-if="!disabled" @click="handleRemove(row)">删除</el-link> |
||||
|
<el-link style="cursor:pointer;" @click="previewFile(row)">预览</el-link> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
|
||||
|
<el-dialog :title="title" :visible.sync="ossVisible" v-drag width="400px" append-to-body :close-on-click-modal="false"> |
||||
|
<el-form ref="form" :model="ossForm" label-width="80px" label-position="top"> |
||||
|
<el-row :gutter="10"> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="项目单号"> |
||||
|
<el-input v-model="ossForm.rfqNo" readonly></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<slot></slot> |
||||
|
<el-col :span="24"> |
||||
|
<el-form-item label=" " class="auto"> |
||||
|
<el-upload drag :file-list="fileList" |
||||
|
action="#" ref="upload" |
||||
|
:on-remove="onRemoveFile" |
||||
|
:on-change="onChangeFile" |
||||
|
multiple |
||||
|
:auto-upload="false"> |
||||
|
<i class="el-icon-upload"></i> |
||||
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> |
||||
|
</el-upload> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="24"> |
||||
|
<el-form-item label="备注" class="auto"> |
||||
|
<el-input type="textarea" v-model="ossForm.remark" resize="none" :autosize="{minRows: 3, maxRows: 3}"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<span slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" :loading="uploadLoading" @click="handleUploadFiles">确定</el-button> |
||||
|
<el-button @click="ossVisible = false">关闭</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<style scoped> |
||||
|
.auto /deep/ .el-form-item__content{ |
||||
|
height: auto; |
||||
|
line-height: 1.5; |
||||
|
} |
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue