You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
669 lines
21 KiB
669 lines
21 KiB
<template>
|
|
<div class="box">
|
|
<div style="position: relative">
|
|
<div class="middlebox">
|
|
<div class="contenttitle">
|
|
基础字典 /
|
|
<span class="contenttitleBold">结果状态</span>
|
|
</div>
|
|
</div>
|
|
<div style="display: block; margin-top: 7px; margin-right: 110px">
|
|
<div style="background-color: #fff; padding: 15px; border-radius: 8px">
|
|
<el-table
|
|
:data="tableData"
|
|
row-key="id"
|
|
class="el-table__body-wrapper tbody"
|
|
@row-click="rowclick"
|
|
highlight-current-row
|
|
:height="window.pageHeight < 600 ? 480 : window.pageHeight - 130"
|
|
ref="tableData"
|
|
>
|
|
<el-table-column prop="id" label="编号"> </el-table-column>
|
|
<el-table-column prop="displayName" label="名称" width="180">
|
|
</el-table-column>
|
|
|
|
<el-table-column prop="reportPrompt" label="报告单提示" width="180">
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="dataInputPrompt"
|
|
label="数据录入提示"
|
|
width="180"
|
|
>
|
|
</el-table-column>
|
|
<el-table-column prop="reportBackgroundColor" label="报告单背景色">
|
|
<template slot-scope="scope">
|
|
<div
|
|
class="colorblock"
|
|
:style="
|
|
'background-color:' +
|
|
colorFormat(scope.row.reportBackgroundColor) +
|
|
';'
|
|
"
|
|
></div>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="reportFontColor" label="报告单字体色">
|
|
<template slot-scope="scope">
|
|
<div
|
|
class="colorblock"
|
|
:style="
|
|
'background-color:' +
|
|
colorFormat(scope.row.reportFontColor) +
|
|
';'
|
|
"
|
|
></div>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="dataInputBackgroundColor"
|
|
label="数据录入背景色"
|
|
>
|
|
<template slot-scope="scope">
|
|
<div
|
|
class="colorblock"
|
|
:style="
|
|
'background-color:' +
|
|
colorFormat(scope.row.dataInputBackgroundColor) +
|
|
';'
|
|
"
|
|
></div>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="dataInputFontColor"
|
|
label="数据录入字体色"
|
|
align="center"
|
|
>
|
|
<template slot-scope="scope">
|
|
<div
|
|
class="colorblock"
|
|
:style="
|
|
'background-color:' +
|
|
colorFormat(scope.row.dataInputFontColor) +
|
|
';'
|
|
"
|
|
></div>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="操作" width="" align="center">
|
|
<template>
|
|
<el-tag
|
|
class="move"
|
|
style="cursor: move;background-color: rgb(245, 245, 245);border:none"
|
|
draggable="true"
|
|
>
|
|
<i
|
|
class="el-icon-d-caret"
|
|
style="width: 1rem; height: 1rem;color: rgb(113, 113, 113)"
|
|
></i>
|
|
</el-tag>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</div>
|
|
</div>
|
|
<div
|
|
style="
|
|
margin-left: 10px;
|
|
margin-top: 3%;
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
"
|
|
>
|
|
<el-button type="" @click="editpopup" class="commonbutton"
|
|
>编辑</el-button
|
|
>
|
|
<div style="margin-top: 10px">
|
|
<el-button type="" @click="topping" class="commonbutton">置顶</el-button>
|
|
</div>
|
|
<div style="margin-top: 10px">
|
|
<el-button type="" @click="toppings" class="commonbutton">置底</el-button>
|
|
</div>
|
|
<div style="margin-top: 10px">
|
|
<el-button type="" :disabled="isshow" @click="assertion" class="commonbutton"
|
|
>排序</el-button
|
|
>
|
|
</div>
|
|
<div style="margin-top: 10px">
|
|
<el-button type="" :disabled="isshow" @click="cancellation" class="commonbutton"
|
|
>取消</el-button
|
|
>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 分页 -->
|
|
|
|
<!-- <div class="cancelorconfirm">
|
|
<el-button type="primary" :disabled="isshow" @click="assertion"
|
|
>确定排序</el-button
|
|
>
|
|
<el-button type="primary" :disabled="isshow" @click="cancellation"
|
|
>取消排序</el-button
|
|
>
|
|
</div> -->
|
|
<!-- 新增或者编辑弹框 -->
|
|
<el-dialog
|
|
:title="title == 1 ? '新增' : '修改'"
|
|
:visible.sync="dialogVisible"
|
|
width="55%"
|
|
:before-close="handleClose"
|
|
:close-on-click-modal="false"
|
|
>
|
|
<el-form :model="form" :rules="rules" ref="ruleForm" label-width="80px">
|
|
<el-row>
|
|
<!-- <el-col :span="12">
|
|
<el-form-item f
|
|
label="id"
|
|
label-width="120px"
|
|
prop="resultStatusId"
|
|
>
|
|
<el-input v-model="form.resultStatusId"></el-input>
|
|
</el-form-item>
|
|
</el-col> -->
|
|
<!-- <el-col :span="12">
|
|
<el-form-item label="名称" label-width="120px" prop="displayName">
|
|
<el-input v-model="form.displayName"></el-input>
|
|
</el-form-item>
|
|
</el-col> -->
|
|
<el-col :span="12">
|
|
<el-form-item
|
|
label="数据录入提示"
|
|
label-width="120px"
|
|
>
|
|
<el-input v-model="form.dataInputPrompt" @input="($event) => changeUpdate($event, 'dataInputPrompt')"></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item
|
|
label="报告单提示"
|
|
label-width="120px"
|
|
>
|
|
<el-input v-model="form.reportPrompt" @input="($event) => changeUpdate($event, 'reportPrompt')"></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item
|
|
label="报告单背景色"
|
|
label-width="120px"
|
|
prop="reportBackgroundColor"
|
|
>
|
|
<el-color-picker
|
|
@change="reportBackgroundColorchange"
|
|
v-model="reportBackgroundColor16"
|
|
></el-color-picker>
|
|
<!-- <el-input></el-input> -->
|
|
<!-- <input type="text" v-model="form.reportBackgroundColor"> -->
|
|
<el-input
|
|
v-model="form.reportBackgroundColor"
|
|
@input="reportBackgroundColorchange1"
|
|
disabled
|
|
style="
|
|
width: 85%;
|
|
position: absolute;
|
|
top: 0px;
|
|
margin-left: 10px;
|
|
"
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item
|
|
label="报告单字体色"
|
|
label-width="120px"
|
|
prop="reportFontColor"
|
|
>
|
|
<!-- <el-input v-model="form.reportFontColor"></el-input> -->
|
|
<el-color-picker
|
|
v-model="reportFontColor16"
|
|
@change="reportFontColorchange"
|
|
></el-color-picker>
|
|
<el-input
|
|
v-model="form.reportFontColor"
|
|
@input="reportFontColor1"
|
|
disabled
|
|
style="
|
|
width: 85%;
|
|
position: absolute;
|
|
top: 0px;h
|
|
margin-left: 10px;
|
|
"
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-form-item label="数据录入背景" label-width="100px">
|
|
<el-color-picker
|
|
v-model="dataInputBackgroundColor16"
|
|
@change="dataInputBackgroundColorchange"
|
|
></el-color-picker>
|
|
<el-input
|
|
@input="inputdataInputBackgroundColor"
|
|
v-model="form.dataInputBackgroundColor"
|
|
disabled
|
|
style="
|
|
width: 85%;
|
|
position: absolute;
|
|
top: 0px;
|
|
margin-left: 10px;
|
|
"
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
<el-form-item
|
|
label="数据录入字体"
|
|
label-width="120px"
|
|
prop="dataInputFontColor"
|
|
>
|
|
<el-color-picker
|
|
v-model="dataInputFontColor16"
|
|
@change="dataInputFontColorchange"
|
|
></el-color-picker>
|
|
<el-input
|
|
v-model.number="form.dataInputFontColor"
|
|
@input="dataInputFontColor1"
|
|
disabled
|
|
style="
|
|
width: 85%;
|
|
margin-left: 10px;
|
|
position: absolute;
|
|
top: 0px;
|
|
"
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</el-form>
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button @click="dialogVisible = false" class="difference"
|
|
>取 消</el-button
|
|
>
|
|
<el-button
|
|
type="primary"
|
|
@click="confirmsubmission"
|
|
class="commonbutton"
|
|
>确 定</el-button
|
|
>
|
|
</span>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
<script>
|
|
import Sortable from "sortablejs";
|
|
import { tcdate, deepCopy } from "../../utlis/proFunc";
|
|
import { mapState } from "vuex";
|
|
import {
|
|
resultlist,
|
|
statusaddition,
|
|
statusmodification,
|
|
deletedstate,
|
|
stateBottomTop,
|
|
sortstatus,
|
|
} from "../../request/systemapi";
|
|
export default {
|
|
data() {
|
|
return {
|
|
isshow: true,
|
|
form: {
|
|
dataInputPrompt: "",
|
|
reportPrompt: "",
|
|
reportBackgroundColor: 1089274,
|
|
// reportBackgroundColor16: "#409EFF",
|
|
reportFontColor: 1089274,
|
|
// reportFontColor16: "#409EFF",
|
|
dataInputBackgroundColor: 1089274,
|
|
// dataInputBackgroundColor16: "#409EFF",
|
|
dataInputFontColor: 1089274,
|
|
// dataInputFontColor16: "#409EFF",
|
|
},
|
|
reportBackgroundColor16: "",
|
|
reportFontColor16: "#409EFF",
|
|
dataInputBackgroundColor16: "#409EFF",
|
|
dataInputFontColor16: "#409EFF",
|
|
dialogVisible: false,
|
|
title: 1,
|
|
tableData: [],
|
|
initTableData: [],
|
|
pages: {
|
|
// currentPage: 0,
|
|
SkipCount: 0,
|
|
MaxResultCount: 100,
|
|
Sorting: "displayOrder desc",
|
|
// totalCount: 0,
|
|
},
|
|
curRow: {},
|
|
//表单校验
|
|
rules: {
|
|
resultStatusId: [
|
|
{ required: true, message: "请输入id", trigger: "blur" },
|
|
],
|
|
displayName: [
|
|
{ required: true, message: "请输入名称", trigger: "blur" },
|
|
],
|
|
dataInputPrompt: [
|
|
{ required: true, message: "请输入数据录入", trigger: "blur" },
|
|
],
|
|
reportPrompt: [
|
|
{ required: true, message: "请输入报关单", trigger: "blur" },
|
|
],
|
|
reportBackgroundColor: [
|
|
{ required: true, message: "请输入报告单背景色", trigger: "blur" },
|
|
],
|
|
reportFontColor: [
|
|
{ required: true, message: "请输入报告单字体色", trigger: "blur" },
|
|
],
|
|
dataInputBackgroundColor: [
|
|
{ required: true, message: "请输入数据录入背景色", trigger: "blur" },
|
|
],
|
|
dataInputFontColor: [
|
|
{ required: true, message: "请输入数据录入字体色", trigger: "blur" },
|
|
],
|
|
},
|
|
};
|
|
},
|
|
created() {
|
|
this.getlist();
|
|
},
|
|
mounted() {
|
|
this.rowDrop();
|
|
},
|
|
computed: {
|
|
...mapState(["window"]),
|
|
},
|
|
methods: {
|
|
changeUpdate(e, k) {
|
|
this.$delete(this.form, k);
|
|
console.log(this.form)
|
|
this.$set(this.form, k, e);
|
|
},
|
|
handleClose(done) {
|
|
this.$confirm("确认关闭?")
|
|
.then((_) => {
|
|
done();
|
|
})
|
|
.catch((_) => {});
|
|
},
|
|
|
|
//数据录入字体
|
|
dataInputFontColorchange(v) {
|
|
this.form.dataInputFontColor = eval(v.replace("#", "0x"));
|
|
},
|
|
//数据录入背景Input
|
|
inputdataInputBackgroundColor(v) {
|
|
this.form.dataInputBackgroundColor = Number(v);
|
|
let temp=null
|
|
temp = "000000" + this.form.dataInputBackgroundColor.toString(16);
|
|
this.dataInputBackgroundColor16 =
|
|
"#" + temp.substring(temp.length - 6, temp.length);
|
|
},
|
|
//数据录入背景
|
|
dataInputBackgroundColorchange(v) {
|
|
this.form.dataInputBackgroundColor = eval(v.replace("#", "0x"));
|
|
},
|
|
|
|
//颜色选择器报告单字体色
|
|
reportFontColorchange(v) {
|
|
this.form.reportFontColor = eval(v.replace("#", "0x"));
|
|
},
|
|
//报告单背景色
|
|
reportBackgroundColorchange(v) {
|
|
this.form.reportBackgroundColor = eval(v.replace("#", "0x"));
|
|
},
|
|
//数据录入字体
|
|
dataInputFontColor1(v) {
|
|
this.form.dataInputFontColor = Number(v);
|
|
let temp=null
|
|
temp = "000000" + this.form.dataInputFontColor.toString(16);
|
|
this.dataInputFontColor16 =
|
|
"#" + temp.substring(temp.length - 6, temp.length);
|
|
},
|
|
//报告单字体色
|
|
reportFontColor1(v) {
|
|
this.form.reportFontColor = Number(v);
|
|
let temp = null;
|
|
temp = "000000" + this.form.reportFontColor.toString(16);
|
|
this.reportFontColor16 =
|
|
"#" + temp.substring(temp.length - 6, temp.length);
|
|
},
|
|
//报告单背景色
|
|
reportBackgroundColorchange1(v) {
|
|
this.form.reportBackgroundColor = Number(v);
|
|
let temp = null;
|
|
temp = "000000" + this.form.reportBackgroundColor.toString(16);
|
|
this.reportBackgroundColor16 =
|
|
"#" + temp.substring(temp.length - 6, temp.length);
|
|
},
|
|
colorFormat(e) {
|
|
let temp = "000000" + Number(e).toString(16);
|
|
return "#" + temp.substring(temp.length - 6, temp.length);
|
|
},
|
|
rowclick(row) {
|
|
this.curRow = { ...row };
|
|
},
|
|
haxadecimal() {
|
|
let str = this.form.dataInputFontColor;
|
|
this.form.dataInputFontColor = str
|
|
.replace(/[^0-9a-fA-F]/g, "")
|
|
.replace(/\s/g, "");
|
|
},
|
|
//取消排序
|
|
cancellation() {
|
|
this.$message.info("取消操作");
|
|
this.isshow = true;
|
|
this.getlist();
|
|
},
|
|
//确定拖拽
|
|
assertion() {
|
|
const result = [];
|
|
this.tableData.forEach((item, index) => {
|
|
// index 从0开始的, displayOrder从大到小排
|
|
// const currentDisplayOrder = this.tableData.length -1
|
|
// const currentDisplayOrder = this.initTableData[index].displayOrder;
|
|
// if (item.displayOrder != currentDisplayOrder) {
|
|
// 如果它的displayOrder和它当前所在的位置不同代表挪动过位置
|
|
result.push({ id: item.id, displayOrder: index+1 });
|
|
// result.push({
|
|
// id: item.resultStatusId,
|
|
// displayOrder: currentDisplayOrder,
|
|
// });
|
|
// }
|
|
});
|
|
sortstatus({ itemList: result }).then((res) => {
|
|
if (res.code != -1) {
|
|
this.isshow = true;
|
|
this.getlist();
|
|
this.$message.success("操作成功");
|
|
}
|
|
});
|
|
},
|
|
//初始化
|
|
rowDrop() {
|
|
this.$nextTick(() => {
|
|
const tbody = document.querySelector(".el-table__body-wrapper tbody");
|
|
const _this = this;
|
|
Sortable.create(tbody, {
|
|
handle: ".move",
|
|
animation: 300,
|
|
// 指定父元素下可被拖拽的子元素
|
|
// draggable: ".module-manager .el-table__row",
|
|
onChoose({oldIndex}){
|
|
_this.$refs['tableData'].setCurrentRow(_this.tableData[oldIndex]);
|
|
_this.rowclick(_this.tableData[oldIndex])
|
|
},
|
|
onEnd({ newIndex, oldIndex }) {
|
|
// console.log(arr);
|
|
_this.isshow = false;
|
|
const currRow = _this.tableData.splice(oldIndex, 1)[0];
|
|
_this.tableData.splice(newIndex, 0, currRow);
|
|
_this.tableData.map((item, index) => {
|
|
if (index == newIndex && index == oldIndex) {
|
|
// console.log(item, "新数据");
|
|
} else if (index == oldIndex) {
|
|
} else if (index == newIndex) {
|
|
}
|
|
});
|
|
},
|
|
});
|
|
});
|
|
},
|
|
//置顶置底
|
|
topping() {
|
|
this.form = { ...this.curRow };
|
|
if (this.form.id == undefined) {
|
|
this.$message.warning("请选择操作的数据");
|
|
} else {
|
|
stateBottomTop(this.form.id, 1).then((res) => {
|
|
if(res.code!=-1){
|
|
this.getlist();
|
|
this.$message.success('操作成功')
|
|
}
|
|
});
|
|
}
|
|
},
|
|
toppings() {
|
|
this.form = { ...this.curRow };
|
|
if (this.form.id == undefined) {
|
|
this.$message.warning("请选择操作的数据");
|
|
} else {
|
|
stateBottomTop(this.form.id, 2).then((res) => {
|
|
if(res.code!=-1){
|
|
this.getlist();
|
|
this.$message.success('操作成功')
|
|
}
|
|
});
|
|
}
|
|
},
|
|
//置顶置底
|
|
// topping(row, t) {
|
|
// stateBottomTop(row.resultStatusId, t).then((res) => {
|
|
// if (res.code != -1) {
|
|
// this.getlist();
|
|
// this.$message.success("操作成功");
|
|
// }
|
|
// });
|
|
// },
|
|
//删除
|
|
delsrts(row) {
|
|
deletedstate(row.resultStatusId).then((res) => {
|
|
if (res.code != -1) {
|
|
this.getlist();
|
|
this.$message.success("删除成功");
|
|
}
|
|
});
|
|
},
|
|
//编辑弹框
|
|
editpopup() {
|
|
if (this.curRow.id == undefined) {
|
|
this.$message.warning("请选择操作的数据");
|
|
} else {
|
|
this.dialogVisible = true;
|
|
this.form = { ...this.curRow };
|
|
if (this.$refs.ruleForm !== undefined) {
|
|
this.$refs.ruleForm.resetFields();
|
|
}
|
|
this.title = 2;
|
|
this.reportBackgroundColorchange1(this.form.reportBackgroundColor);
|
|
this.reportFontColor1(this.form.reportFontColor);
|
|
this.dataInputFontColor1(this.form.dataInputFontColor);
|
|
this.inputdataInputBackgroundColor(this.form.dataInputBackgroundColor);
|
|
}
|
|
},
|
|
//q确定
|
|
confirmsubmission() {
|
|
this.$refs.ruleForm.validate((v) => {
|
|
if (v) {
|
|
if (this.title == 1) {
|
|
statusaddition(this.form).then((res) => {
|
|
if (res.code != -1) {
|
|
this.getlist();
|
|
this.dialogVisible = false;
|
|
this.form = {};
|
|
this.$message.success("新增成功");
|
|
}
|
|
});
|
|
} else if (this.title == 2) {
|
|
let obj = {
|
|
// displayName: this.form.displayName,
|
|
dataInputPrompt: this.form.dataInputPrompt,
|
|
reportPrompt: this.form.reportPrompt,
|
|
reportBackgroundColor: this.form.reportBackgroundColor,
|
|
reportFontColor: this.form.reportFontColor,
|
|
dataInputBackgroundColor: this.form.dataInputBackgroundColor,
|
|
dataInputFontColor: this.form.dataInputFontColor,
|
|
};
|
|
statusmodification(this.form.id, this.form).then((res) => {
|
|
if (res.code != -1) {
|
|
this.getlist();
|
|
this.dialogVisible = false;
|
|
this.form = { ...res.data };
|
|
this.rowclick(res.data);
|
|
this.$message.success("修改成功");
|
|
}
|
|
});
|
|
}
|
|
}
|
|
});
|
|
},
|
|
//新增弹框
|
|
add() {
|
|
this.title = 1;
|
|
this.dialogVisible = true;
|
|
},
|
|
//获取数据列表
|
|
getlist() {
|
|
resultlist(this.pages).then((res) => {
|
|
if (res.code != -1) {
|
|
this.tableData = [...res.data.items];
|
|
this.initTableData = [...res.data.items];
|
|
this.totalCount = res.data.totalCount;
|
|
}
|
|
});
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
<style scoped>
|
|
@import "../../assets/css/global_button.css";
|
|
@import "../../assets/css/global_dialog.css";
|
|
@import "../../assets/css/global_table.css";
|
|
@import "../../assets/css/global_form.css";
|
|
@import "../../assets/css/global_input.css";
|
|
@import "../../assets/css/global.css";
|
|
.box {
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
:deep .el-form-item {
|
|
margin-bottom: 14px;
|
|
}
|
|
/* el-dialog的头部样式 */
|
|
:deep .el-dialog__header {
|
|
padding: 11px 20px 11px;
|
|
}
|
|
/* el-dialog的主体样式 */
|
|
:deep .el-dialog__body {
|
|
padding: 0px 20px 0px;
|
|
}
|
|
/* el-divider样式 */
|
|
:deep .el-divider--horizontal {
|
|
margin: 0px 0 12px;
|
|
}
|
|
/* el-dialog的底部样式 */
|
|
:deep .el-dialog__footer {
|
|
padding: 0px 20px 14px;
|
|
}
|
|
.seachinput {
|
|
width: 250px;
|
|
margin-right: 110px;
|
|
}
|
|
:deep .seachinput .el-select {
|
|
width: 100%;
|
|
}
|
|
.colorblock {
|
|
width: 25px;
|
|
height: 25px;
|
|
}
|
|
</style>
|