Files
scrq-hd/.svn/pristine/ee/eed3d1fe2fb13a5d29cfbbd7ca07b27499af5777.svn-base
2025-07-03 10:34:04 +08:00

867 lines
24 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<!-- 评审产品工单 -->
<div class="app-container" >
<div class="main">
<div class="query" ref="query">
<el-form
:model="queryParams"
ref="queryParams"
:inline="true"
label-width="100px"
>
<el-form-item>
<el-input
v-model="queryParams.key"
placeholder="key"
clearable
size="small"
style="width: 230px"
/>
</el-form-item>
<el-form-item>
<el-input
v-model="queryParams.name"
placeholder="名称"
clearable
size="small"
style="width: 230px"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="Query"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
</div>
<el-divider></el-divider>
<div>
<div>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-button
type="info"
icon="el-icon-upload2"
size="mini"
@click="startClick"
:disabled="buttonEnable"
v-hasPermi="['fixure_add']"
>发起评审
</el-button>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="info"
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['plan:RvOrderProd:handleImport']"
>导入EXCEL
</el-button>
</el-col> -->
<el-col :span="1.5">
<el-button
type="info"
icon="el-icon-upload2"
size="mini"
@click="approvelistClick"
:disabled="buttonEnable"
v-hasPermi="['plan:RvOrderWork:history']"
>查看审批记录
</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="primary"
round
icon="el-icon-plus"
size="mini"
@click="outFixure"
:disabled="buttonEnable"
v-hasPermi="['fixure_access']"
>取用
</el-button>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="primary"
round
icon="el-icon-plus"
size="mini"
@click="createOp"
:disabled="buttonEnable"
v-hasPermi="['system:user:add']"
>提交取用
</el-button>
</el-col>-->
<!-- <el-col :span="1.5">
<el-button
type="success"
icon="el-icon-plus"
size="mini"
@click="queryInOutNote"
v-hasPermi="['fixure_outrecords']"
>出入库记录
</el-button>
</el-col> -->
<el-popover
style="float: right"
placement="bottom-end"
title="自定义显示列"
width="250"
@show="initPopover"
trigger="hover"
>
<headConfig
ref="test"
@fathers="fathers"
:propThis="propThis"
></headConfig>
<el-button
style="margin-right:5px;"
size="mini"
type="primary"
class="el-icon-caret-bottom"
slot="reference"
>自定义列</el-button
>
</el-popover>
</el-row>
<el-row :gutter="10" style="margin: 10px 0px;" class="mb8" v-if="isSortShow">
<el-col>
<el-select
ref="select"
@click.native="notSelect"
style="width: 100%"
v-model="seqence"
:multiple="true"
placeholder=""
>
<el-option
v-for="(item,index) in seqenceOptions"
:key="index"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-col>
</el-row>
<el-table
@sort-change="sortChange"
:data="tableData"
highlight-current-row
@current-change="handleCurrentChange"
border
:height="tableHeight"
v-loading="loading"
class="tableStyle"
>
<el-table-column label="序号" header-align="center" type="index"
width="80"></el-table-column>
<el-table-column label="审批记录" header-align="center" :show-overflow-tooltip="true"
width="100">
<template slot-scope="scope">
<i style="color: blue;text-decoration:underline; cursor:pointer;" @click="approvelistClick( scope.row)">审批记录</i>
</template>
</el-table-column>
<el-table-column
v-for="(item, index) in realList"
:sortable="item.notSort == true ? false : `custom`"
:prop="item.tableProp"
:key="index"
:align="item.align"
header-align="center"
:min-width="item.width"
:label="item.tableTitle"
:show-overflow-tooltip="item.show_overflow_tooltip"
:formatter="formatter(item.tableProp)"
>
</el-table-column>
</el-table>
<el-pagination
style="margin-top: 10px;height: 20px"
@size-change="handleSizeChange"
@current-change="handleCurrentChange2"
:current-page="currentPage"
:page-sizes="[10, 20, 50, 100, 200, 500, 1000]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
>
</el-pagination>
</div>
</div>
</div>
<el-dialog
title="审批记录"
:visible.sync="isApprovelistShow"
v-if="isApprovelistShow"
width="840px"
append-to-body
>
<el-table
:data="approvelistTableData"
highlight-current-row
border
style="width: 100%">
<el-table-column type="index" align="center" label="序号" width="80"></el-table-column>
<el-table-column prop="comment" align="center" label="备注" width="250"></el-table-column>
<el-table-column prop="taskName" align="center" label="任务节点" width="180"></el-table-column>
<el-table-column prop="assigneeName" align="center" label="审批人" width="90"></el-table-column>
<el-table-column prop="startDt" align="center" label="开始时间" width="150"></el-table-column>
<el-table-column prop="endDt" align="center" label="结束时间" width="150"></el-table-column>
<el-table-column prop="duration" align="center" label="审批耗时" width="150" :formatter="durationFormatter"></el-table-column>
</el-table>
</el-dialog>
<!-- 部署模型对话框 -->
<el-dialog
:title="uploadTitle"
:visible.sync="isUploadShow"
v-if="isUploadShow"
width="400px"
append-to-body
>
<el-upload
ref="upload"
:limit="1000"
:headers="uploadHeaders"
:action="upload.url"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:on-error="handleFileError"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处,或
<em>点击上传</em>
</div>
<div class="el-upload__tip" style="color: red" slot="tip">
<el-link type="success" @click.prevent="down">下载模板</el-link>
</div>
<div class="el-upload__tip" style="color: red" slot="tip">
提示仅允许导入“xls”或“xlsx”格式文件
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm">确 定</el-button>
<el-button @click="isUploadShow = false">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { g_method } from '@/utils/g_method'
import {
getUser,
} from "@/api/system/user";
import { getToken } from '@/utils/auth'
export default {
name: "fixure",
components:{
},
data() {
return {
durationFormatter:function(row)
{
if(new Date(row.endDt).getTime()!=0)
{
let ms=new Date(row.endDt).getTime()-new Date(row.startDt).getTime()
return g_method.msToText(ms) //将毫秒数转化为X分X秒
}
else return ""
},
uploadFileMsg:'',//上传文件时给用户的提示信息
uploadFileNumber:0,//剩余上传的文件数量
approvelistTableData:[],//审批记录tableData
isApprovelistShow:false,//审批记录对话框是否显示
tableName:'RvOrderProd',
uploadHeaders:{},
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: "",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers:this.uploadHeaders,
// 上传的地址
url: [process.env.VUE_APP_BASE_API]+"/plan/plan/rv/order/prod/import",
},
uploadTitle : "订单评审表导入",
isUploadShow:false,
rules: {
key: [
{ required: true, message: 'key不能为空', trigger: 'blur' }
],
name: [
{ required: true, message: '名称不能为空', trigger: 'blur' }
],
},
addDialogOpen:false,//创建新模型配置对话框是否显示
isModelerShow:false,
form:{
key:"",
name:"",
description:""
},//新模型配置对话框里的表格
//table格式化
formatter:(tableProp)=>
{
},
getRowKeys: (row) => {
//获取当前行id
// console.log(row)
return row.id; //这里看这一行中需要根据哪个属性值是id
},
buttonEnableP: true,
buttonEnableD: true,
expands: [],
printInfo: false,
multipleSelectionTable: [],
multipleSelection: [],
childrenList: [],
childrenStates: [],
subLoading: false,
indexShow: false,
tableHeight: 0,
showMore: false,
editNow: false,
currentRow: null,
buttonEnable: true,
List: [],
realList: [],
isAdd: null,
total: null,
propThis: this,
pageSize: 20,
currentPage: 1,
tableData: [],
queryParams: {},
loading: false,
warehouseOptions: [],
seqenceOptions: [],
seqence: [],
isSortShow: false,
};
},
async mounted() {
this.uploadHeaders={'Authorization' : 'Bearer ' + getToken()}
let tempList = this.$headerConfig.getList(this.tableName);
tempList.forEach((data, index) => {
if (data.notSort) return;
let temp = {
value: null,
label: null,
};
temp.value = data.tableProp.replace("Show", "") + " ascending";
temp.label = data.tableTitle + " 升序";
this.seqenceOptions.push(temp);
let tempD = {
value: null,
label: null,
};
tempD.value = data.tableProp.replace("Show", "") + " descending";
tempD.label = data.tableTitle + " 降序";
this.seqenceOptions.push(tempD);
});
this.$nextTick(() => {
this.tableHeight =470
this.$forceUpdate
//window.innerHeight - this.$refs.query.offsetHeight - 255;
});
// this.dropDownBoxStatus();
this.getList();
const params = {
tableName: this.tableName,
};
//调接口
this.$headerConfig.getRealList(params).then(async (_data) => {
console.log(data,'d')
let data=undefined
if(_data!=undefined)data=_data.config?_data.data:_data
if (data!=undefined && data.data && data.data.data && data.data.data !== null) {
let temp = JSON.parse(data.data.data);
this.realList = temp.headerList;
this.List = temp.List;
} else {
this.List = this.$headerConfig.getList(this.tableName);
console.log(this.List,'1309')
this.realList = this.List;
let temp = {
headerList: this.realList,
List: this.List,
};
const params = {
tableName: this.tableName,
configure: JSON.stringify(temp),
};
this.$headerConfig.updateRealList(params).then((value) => {
console.log(value);
});
}
this.indexShow = true;
});
},
methods: {
notSelect() {
this.$refs.select.blur();
},
sortChange({ column, prop, order }) {
console.log(prop);
let sTemp = {
value: null,
label: null,
};
let value = prop.replace("Show", "") + " " + order;
let judgeValue = value.split(" ");
// this.seqence.push(value)
if (this.seqence.length === 0) {
this.seqence.push(value);
console.log(this.seqence);
} else {
for (let i = 0; i < this.seqence.length; i++) {
let judgeSeqence = this.seqence[i].split(" ");
if (judgeValue[0] === judgeSeqence[0]) {
if (judgeValue[1] === "null") {
return;
}
this.seqence.splice(i, 1, value);
console.log(this.seqence);
return;
}
if (i + 1 === this.seqence.length) {
this.seqence.push(value);
console.log(this.seqence);
}
}
}
},
handleCurrentChange2(val) {
// this.currentRow = val;
console.log(val);
this.currentPage = val;
this.getList();
},
handleSizeChange(val) {
this.pageSize = val;
this.getList();
},
initPopover() {
const params = {
tableName: this.tableName,
};
this.$refs.test.init();
},
fathers(data) {
this.List = data.configure.List;
const params = {
tableName: this.tableName,
configure: JSON.stringify(data.configure),
};
this.realList = data.configure.headerList;
this.$headerConfig.updateRealList(params).then((value) => {
console.log(value);
});
},
getList() {
//获取列表(评审订单)
this.buttonEnable = true;
this.loading = true;
const orders = [];
this.seqence.map((val) => {
orders.push(
val.replace("ascending", "asc").replace("descending", "desc")
);
});
const params = {
pageSize: this.pageSize,
pageNum: this.currentPage,
key: this.queryParams.key,
name: this.queryParams.name,
orders,
};
console.log(params,'param666s');
this.$flowDefine.rvWorklist(params).then((_data) => {
let resp=_data.config?_data.data:_data
console.log("哈哈哈哈::", resp);
this.total = resp.data.recordsTotal;
console.log(this.total,'total')
resp.data.data.forEach(o=>{})
let _tableData = resp.data.data;
console.log(_tableData,'1056')
//时间格式转换
_tableData.forEach((row)=>{
})
this.tableData=_tableData
this.tableData.map((data) => {
});
this.loading = false;
});
},
startClick(){
// 发起评审点击
console.log(this.currentRow,'1350')
if(this.currentRow==null ){
this.$message.warning('请选择一行数据!')
this.buttonEnable=true
return
}
this.$confirm("是否发起评审?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$flowDefine.rvStart(this.currentRow.id ).then((data) => {
if ( data.data.code == 200) {
this.$message.success("发起评审成功");
this.getList();
}
else{
console.log(data,'1336')
this.$message.error(data.data.msg);
}
});
})
.catch(() => {});
},
handleDelete() {
this.$confirm("是否删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$flowDefine.remove(this.currentRow.deploymentId ).then((data) => {
if (data.code ==200 || data.data.code === 200) {
this.$message.success("删除成功");
this.getList();
}
});
})
.catch(() => {});
},
suspendOrActiveApply() {
//暂停或激活
this.$flowDefine.suspendOrActiveApply(this.currentRow).then((data) => {
if (data.code ==200 || data.data.code === 200) {
this.$message.success("转换成功");
this.getList();
}
});
},
openDetailAdd() {
// 创建新模型
this.addDialogOpen=true
//this.isModelerShow=true
},
async submitForm()
//新建对话框 确定按钮点击
{
},
async approvelistClick(row)
//查看审批记录
{
let currentRow
if(row!=undefined){currentRow=row}//表格内点击链接
else{currentRow=this.currentRow}//点击按钮
if(currentRow==null ){
this.$message.warning('请选择一行数据!')
this.buttonEnable=true
return
}
this.$flowDefine.approvelist(currentRow.processInstanceId).then(async (data) => {
console.log(data,'审批记录data')
if (data.code ==200 || data.data.code == 200) {
console.log(data,'审批记录data')
this. approvelistTableData=data.data.data
this.isApprovelistShow=true
await this.g_method.asyncForEach(this.approvelistTableData,
async (o)=>{
if(o.assignee==null){
o.assigneeName=""
return
}
let response=await getUser(o.assignee)
o.assigneeName=response.data.nickName
}
)
this.approvelistTableData=JSON.parse(JSON.stringify(this.approvelistTableData))
}
});
},
cancel()
{
console.log('cancel')
this.addDialogOpen=false
},
closeSubPage(){
//子页面点击关闭
this.isModelerShow=false
},
Query() {
console.log(this.queryParams);
this.currentPage = 1;
this.getList();
},
resetQuery() {
this.queryParams = {};
this.seqence = [];
},
handleCurrentChange(val) {
console.log(val);
this.currentRow = val;
this.buttonEnable = false;
this.buttonEnableD = false;
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
let resp=response
console.log(response,file,'11401')
this.uploadFileNumber--//uploadFileNumber减1 直到减为0
console.log(this.uploadFileNumber,' 1641 ',file.name)
if(resp.code==200)
{
let sucessMsg=resp.data && resp.data[0]?resp.data[0]:'导入成功'
this.uploadFileMsg=this.uploadFileMsg+"<p style='color:#00F'>"+file.name+sucessMsg+"</p>"
}
else{
this.uploadFileMsg=this.uploadFileMsg+"<p style='color:#FF0000'>"+file.name+'导入失败,原因:'+resp.msg+"</p>"
}
if(this.uploadFileNumber<=0){
this.$alert(this.uploadFileMsg, "导入结果", {
dangerouslyUseHTMLString: true,
});
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
}
this.getList();
// console.log(response,'1000')
// if(response.code==200){
// this.$message.success('上传成功!')
// }
// else{
// this.$alert(response.data || response.msg, "导入结果", {
// dangerouslyUseHTMLString: true,
// });
// }
// this.isUploadShow = false;
// this.upload.isUploading = false;
// this.$refs.upload.clearFiles();
// this.getList();
},
// 文件上传失败处理
handleFileError(response, file, fileList) {
console.log(response,'response')
this.$refs.upload.clearFiles();
this.$message.error(response.msg || response.data.msg)
},
// 提交上传文件
submitFileForm() {
if(!this.$refs.upload.uploadFiles.length){this.$message.warning('文件数量必须大于0');return;}
this.uploadFileNumber=this.$refs.upload.uploadFiles.length
this.uploadFileMsg=""
console.log(this.uploadFileNumber,'1613')
this.$refs.upload.submit();
},
down() {
//下载模板
window.location.href = "./../down/ECN.xlsx";
},
handleImport() {
this.upload.url= [process.env.VUE_APP_BASE_API]+"/plan/plan/rv/order/prod/import",
this.upload.title = "导入";
this.upload.open = true;
this.isUploadShow=true
},
},
watch: {
seqence: function () {
this.getList();
var oldIsSortShow = this.isSortShow
//判断是否显示排序条件
if(this.seqence.length > 0 ){
this.isSortShow = true
}else{
this.isSortShow = false
}
//判断table高度
if(oldIsSortShow != this.isSortShow){
if (this.isSortShow) {
this.tableHeight = this.tableHeight - 47;
} else {
this.tableHeight = this.tableHeight + 47;
}
}
},
},
};
</script>
<style scoped lang="scss">
>>> .el-table__expanded-cell:hover {
/*padding:20px 0px;*/
background-color: white !important;
}
>>> .el-table--striped .el-table__body tr.el-table__row--striped.current-row td,
>>> .el-table__body tr.current-row > td {
background-color: #8ac1ff !important;
cursor: pointer;
}
>>> .el-table__body tr:hover > td {
background-color: #e9edf3;
cursor: pointer;
}
>>> .el-link.el-link--default {
color: white;
}
>>> .el-form-item {
margin-bottom: 10px;
}
.el-divider {
margin-top: 0px;
}
.mb8 >>> .el-select .el-input__inner {
border: 0px;
}
.mb8 >>> .el-select .el-input__inner {
border: 0px;
padding-right: 35px;
}
>>> .el-input__suffix-inner {
display: none;
}
>>> .el-form-item {
margin-bottom: 10px;
}
>>> .el-table__body-wrapper{
height:375px!important;
}
.el-divider {
margin-top: 0px;
margin-bottom: 5px;
}
>>> .el-table .el-table__header-wrapper th {
padding: 5px 0;
}
>>> .el-table__body-wrapper{
height:90%!important;
}
>>> .vue-treeselect__control {
height: 30px !important;
line-height: 30px !important;
}
>>> .vue-treeselect--single .vue-treeselect__input-container {
height: 30px !important;
line-height: 30px !important;
}
// >>> .el-input-group__append{
// padding: 5px;
// }
>>> .el-input-group__append .el-select,
.el-input-group__append .el-button,
.el-input-group__prepend .el-select,
.el-input-group__prepend .el-button {
margin-left: -28px !important;
margin-right: -33px !important;
}
.icon_arrow >>> .el-button--mini {
margin-left: 0px !important;
margin-right: 5px !important;
}
// .query >>> .el-button--mini{
// padding-bottom:0px;
// }
</style>