6f68f042 by renchao@pashanhoo.com

style:弹窗修改

1 parent bef6274f
...@@ -13,5 +13,6 @@ const getters = { ...@@ -13,5 +13,6 @@ const getters = {
13 addDict: state => state.dict.addDict, 13 addDict: state => state.dict.addDict,
14 dictData: state => state.dict.dictData, 14 dictData: state => state.dict.dictData,
15 djbxx: state => state.djbxx.djbxx, 15 djbxx: state => state.djbxx.djbxx,
16 isRefresh: state => state.user.isRefresh,
16 } 17 }
17 export default getters 18 export default getters
......
1 /*
2 * @Description:
3 * @Autor: renchao
4 * @LastEditTime: 2023-04-12 10:47:33
5 */
1 import { getUserInfo } from '@/api/user' 6 import { getUserInfo } from '@/api/user'
2 const state = { 7 const state = {
3 name: '', 8 name: '',
4 avatar: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png', 9 avatar: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png',
5 userData: {} 10 isRefresh: false,
6 } 11 }
7 const mutations = { 12 const mutations = {
8 SET_NAME: (state, data) => { 13 SET_NAME: (state, data) => {
9 state.name = data.loginName 14 state.name = data.loginName
10 state.userData = data 15 },
16 REFRESH: (state, data) => {
17 state.isRefresh = data
11 } 18 }
12 } 19 }
13 20
...@@ -19,6 +26,9 @@ const actions = { ...@@ -19,6 +26,9 @@ const actions = {
19 resolve(true) 26 resolve(true)
20 }) 27 })
21 }, 28 },
29 refreshPage ({ commit }, data) {
30 commit('REFRESH', data)
31 },
22 } 32 }
23 export default { 33 export default {
24 namespaced: true, 34 namespaced: true,
......
1 <template> 1 <template>
2 <dialogBox title="打印模板" @submitForm="submitForm" saveButton="保存" :isFullscreen="false" width="30%" 2 <el-form ref="ruleForm" :model="ruleForm" label-width="100px" :rules="rules">
3 @closeDialog="closeDialog" v-model="myValue"> 3 <el-row>
4 <el-form ref="ruleForm" :model="ruleForm" label-width="100px" :rules="rules"> 4 <el-col :span="24">
5 <el-row> 5 <el-form-item label="模板编码:" prop="tmpno">
6 <el-col :span="24"> 6 <el-input v-model="ruleForm.tmpno" :disabled="editFlag"></el-input>
7 <el-form-item label="模板编码:" prop="tmpno"> 7 </el-form-item>
8 <el-input v-model="ruleForm.tmpno" :disabled="editFlag"></el-input> 8 </el-col>
9 </el-form-item> 9 </el-row>
10 </el-col> 10 <el-row>
11 </el-row> 11 <el-col :span="24">
12 <el-row> 12 <el-form-item label="模板名称:" prop="tmpname">
13 <el-col :span="24"> 13 <el-input v-model="ruleForm.tmpname" :disabled="editFlag"></el-input>
14 <el-form-item label="模板名称:" prop="tmpname"> 14 </el-form-item>
15 <el-input v-model="ruleForm.tmpname" :disabled="editFlag"></el-input> 15 </el-col>
16 </el-form-item> 16 </el-row>
17 </el-col> 17 <el-row>
18 </el-row> 18 <el-col :span="12">
19 <el-row> 19 <el-form-item label="模板设计:">
20 <el-col :span="12"> 20 <el-button type="primary" @click="designByPRGData(ruleForm.tmpcontent)">模板设计</el-button>
21 <el-form-item label="模板设计:"> 21 <i class="el-icon-loading" style="font-size:24px;margin-left:10px;" v-if="loadStatus == '1'"></i>
22 <el-button type="primary" @click="designByPRGData(ruleForm.tmpcontent)">模板设计</el-button> 22 <i class="el-icon-circle-check" style="font-size:24px;margin-left:10px;color:green"
23 <i class="el-icon-loading" style="font-size:24px;margin-left:10px;" v-if="loadStatus == '1'"></i> 23 v-if="loadStatus == '2'"></i>
24 <i class="el-icon-circle-check" style="font-size:24px;margin-left:10px;color:green" v-if="loadStatus == '2'"></i> 24 </el-form-item>
25 </el-form-item> 25 </el-col>
26 </el-col> 26 </el-row>
27 </el-row> 27 <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" v-show="false">
28 <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" v-show="false"> 28 <embed id="LODOP_EM" type="application/x-print-lodop" width=820 height=450 pluginspage="install_lodop32.exe" />
29 <embed id="LODOP_EM" type="application/x-print-lodop" width=820 height=450 pluginspage="install_lodop32.exe"/>
30 </object> 29 </object>
31 <textarea rows="0" id="S1" cols="0" v-show="false"></textarea> 30 <textarea rows="0" id="S1" cols="0" v-show="false"></textarea>
32 </el-form> 31
33 </dialogBox> 32 <el-form-item class="text-center">
33 <el-button @click="closeDialog">取消</el-button>
34 <el-button type="primary" @click="submitForm" plain>确定</el-button>
35 </el-form-item>
36 </el-form>
34 </template> 37 </template>
35 38
36 <script> 39 <script>
37 import { getLodop } from "@/utils/LodopFuncs" 40 import { getLodop } from "@/utils/LodopFuncs"
38 import { mapGetters } from 'vuex' 41 import { mapGetters } from 'vuex'
39 import {addPrintTemplate,editPrintTemplate} from "@/api/system.js" 42 import store from '@/store/index.js'
43 import { addPrintTemplate, editPrintTemplate } from "@/api/system.js"
40 export default { 44 export default {
41 computed: { 45 computed: {
42 ...mapGetters(['dictData']), 46 ...mapGetters(['dictData']),
43 }, 47 },
44 props: { 48 props: {
45 value: { type: Boolean, default: false }, 49 formData: {
50 type: Object,
51 default: () => { }
52 }
46 }, 53 },
47 data () { 54 data () {
48 return { 55 return {
49 myValue: this.value,
50 editFlag: false, 56 editFlag: false,
51 //打印模板设计保存状态 0:未操作 1:保存中 2:已保存 57 //打印模板设计保存状态 0:未操作 1:保存中 2:已保存
52 loadStatus: '0', 58 loadStatus: '0',
53 //表单提交数据 59 //表单提交数据
54 ruleForm: { 60 ruleForm: {
55 tmpno: '', 61 tmpno: '',
56 tmpname: '', 62 tmpname: '',
57 tmpfont: '', 63 tmpfont: '',
58 tmpfontsize: '', 64 tmpfontsize: '',
59 tmpcontent: '' 65 tmpcontent: ''
60 }, 66 },
61 rules: { 67 rules: {
62 tmpno: [ 68 tmpno: [
...@@ -68,76 +74,73 @@ export default { ...@@ -68,76 +74,73 @@ export default {
68 }, 74 },
69 } 75 }
70 }, 76 },
71 watch: { 77 mounted () {
72 value (val) { 78 if (JSON.stringify(this.formData) != "{}") this.getDetailInfo(this.formData)
73 this.myValue = val
74 }
75 }, 79 },
76 methods: { 80 methods: {
77 //表单提交 81 //表单提交
78 submitForm () { 82 submitForm () {
79 if(this.loadStatus == '1'){ 83 if (this.loadStatus == '1') {
80 return this.$message.error("模板设计保存中,请等待...") 84 return this.$message.error("模板设计保存中,请等待...")
81 } 85 }
82 this.$refs.ruleForm.validate(valid => { 86 this.$refs.ruleForm.validate(valid => {
83 if (valid) { 87 if (valid) {
84 if(this.editFlag){ 88 if (this.editFlag) {
85 this.editTemplate(); 89 this.editTemplate();
86 }else{ 90 } else {
87 this.addTemplate(); 91 this.addTemplate();
88 } 92 }
89 } else { 93 } else {
90 // console.log('error submit!!');
91 return false; 94 return false;
92 } 95 }
93 }); 96 });
94 }, 97 },
95 //新增 98 //新增
96 addTemplate(){ 99 addTemplate () {
97 addPrintTemplate(this.ruleForm).then(res => { 100 addPrintTemplate(this.ruleForm).then(res => {
98 if(res.code == 200){ 101 if (res.code == 200) {
99 this.$parent.fetchData(); 102 store.dispatch('user/refreshPage', true);
100 this.$message.success('保存成功'); 103 this.$message.success('保存成功');
101 this.closeDialog(); 104 this.$popupCacel()
102 }else{ 105 } else {
103 this.$message.error(res.message) 106 this.$message.error(res.message)
104 } 107 }
105 }) 108 })
106 }, 109 },
107 //编辑 110 //编辑
108 editTemplate() { 111 editTemplate () {
109 editPrintTemplate(this.ruleForm).then(res => { 112 editPrintTemplate(this.ruleForm).then(res => {
110 if(res.code == 200){ 113 if (res.code == 200) {
111 this.$parent.fetchData(); 114 store.dispatch('user/refreshPage', true);
112 this.$message.success('保存成功'); 115 this.$message.success('保存成功');
113 this.closeDialog(); 116 this.$popupCacel()
114 }else{ 117 } else {
115 this.$message.error(res.message) 118 this.$message.error(res.message)
116 } 119 }
117 }) 120 })
118 }, 121 },
119 closeDialog () { 122 closeDialog () {
120 this.$emit("input", false); 123 this.$popupCacel()
121 this.ruleForm = { 124 this.ruleForm = {
122 tmpno: '', 125 tmpno: '',
123 tmpname: '', 126 tmpname: '',
124 tmpfont: '', 127 tmpfont: '',
125 tmpfontsize: '', 128 tmpfontsize: '',
126 tmpcontent: '' 129 tmpcontent: ''
127 }, 130 }
128 this.loadStatus = '0' 131 this.loadStatus = '0'
129 this.editFlag = false; 132 this.editFlag = false;
130 }, 133 },
131 getDetailInfo(item){ 134 getDetailInfo (item) {
132 this.ruleForm = item; 135 this.ruleForm = item;
133 this.editFlag = true; 136 this.editFlag = true;
134 }, 137 },
135 //设计打印模板 138 //设计打印模板
136 designByPRGData() { 139 designByPRGData () {
137 let that = this; 140 let that = this;
138 that.loadStatus = '1'; 141 that.loadStatus = '1';
139 let LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM')); 142 let LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
140 LODOP.ADD_PRINT_DATA("ProgramData",this.ruleForm.tmpcontent); //装载模板 143 LODOP.ADD_PRINT_DATA("ProgramData", this.ruleForm.tmpcontent); //装载模板
141 //窗口关闭后,回调函数中保存的设计代码 144 //窗口关闭后,回调函数中保存的设计代码
142 if (LODOP.CVERSION) 145 if (LODOP.CVERSION)
143 CLODOP.On_Return = function (TaskID, printList) { 146 CLODOP.On_Return = function (TaskID, printList) {
...@@ -150,8 +153,8 @@ export default { ...@@ -150,8 +153,8 @@ export default {
150 0 153 0
151 ); 154 );
152 setTimeout(() => { 155 setTimeout(() => {
153 that.ruleForm.tmpcontent = document.getElementById("S1").value; 156 that.ruleForm.tmpcontent = document.getElementById("S1").value;
154 that.loadStatus = '2'; 157 that.loadStatus = '2';
155 }, 1000); 158 }, 1000);
156 }; 159 };
157 LODOP.PRINT_DESIGN(); //打印设计或者打印维护需要放到最后 160 LODOP.PRINT_DESIGN(); //打印设计或者打印维护需要放到最后
...@@ -162,6 +165,7 @@ export default { ...@@ -162,6 +165,7 @@ export default {
162 <style scoped lang="scss"> 165 <style scoped lang="scss">
163 @import "~@/styles/mixin.scss"; 166 @import "~@/styles/mixin.scss";
164 @import "~@/styles/dialogBoxheader.scss"; 167 @import "~@/styles/dialogBoxheader.scss";
168
165 .font-red { 169 .font-red {
166 color: red 170 color: red
167 } 171 }
......
...@@ -2,38 +2,37 @@ ...@@ -2,38 +2,37 @@
2 <div class="from-clues"> 2 <div class="from-clues">
3 <div class="from-clues-header"> 3 <div class="from-clues-header">
4 <el-form> 4 <el-form>
5 <el-row> 5 <el-row>
6 <el-col :span="24" class="btnColRight"> 6 <el-col :span="24" class="btnColRight">
7 <el-form-item> 7 <el-form-item>
8 <el-button type="primary" @click="fetchData">查询</el-button> 8 {{ isRefresh }}
9 <el-button type="primary" @click="openAddDialog">新增</el-button> 9 <el-button type="primary" @click="fetchData">查询</el-button>
10 </el-form-item> 10 <el-button type="primary" @click="openAddDialog">新增</el-button>
11 </el-col> 11 </el-form-item>
12 </el-row> 12 </el-col>
13 </el-form> 13 </el-row>
14 </el-form>
14 </div> 15 </div>
15 <div class="from-clues-content"> 16 <div class="from-clues-content">
16 <lb-table :page-size="pageData.size" :current-page.sync="pageData.current" :heightNum="270" :total="tableData.total" 17 <lb-table :page-size="pageData.size" :current-page.sync="pageData.current" :heightNum="270" :total="tableData.total"
17 @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns" 18 @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns"
18 :data="tableData.data"></lb-table> 19 :data="tableData.data"></lb-table>
19 </div> 20 </div>
20 <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" v-show="false"> 21 <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" v-show="false">
21 <embed id="LODOP_EM" type="application/x-print-lodop" width=820 height=450 pluginspage="install_lodop32.exe"/> 22 <embed id="LODOP_EM" type="application/x-print-lodop" width=820 height=450 pluginspage="install_lodop32.exe" />
22 </object> 23 </object>
23 <textarea rows="0" id="S1" cols="0" v-show="false"></textarea> 24 <textarea rows="0" id="S1" cols="0" v-show="false"></textarea>
24 <editDialog ref="editDialog" v-model="isDialog" />
25 </div> 25 </div>
26 </template> 26 </template>
27 <script> 27 <script>
28 import { mapGetters } from 'vuex'
28 import { getLodop } from "@/utils/LodopFuncs" 29 import { getLodop } from "@/utils/LodopFuncs"
29 import table from "@/utils/mixin/table" 30 import table from "@/utils/mixin/table"
30 import { datas, sendThis } from "./dymbgl" 31 import { datas, sendThis } from "./dymbgl"
31 import editDialog from "./components/editDialog.vue"; 32 import { selectPrintTemplateList, delPrintTemplate } from "@/api/system.js"
32 import {selectPrintTemplateList,delPrintTemplate} from "@/api/system.js"
33 export default { 33 export default {
34 name: "dymbgl", 34 name: "dymbgl",
35 mixins: [table], 35 mixins: [table],
36 components: {editDialog},
37 data () { 36 data () {
38 return { 37 return {
39 isDialog: false, 38 isDialog: false,
...@@ -45,18 +44,28 @@ export default { ...@@ -45,18 +44,28 @@ export default {
45 }, 44 },
46 printItem: "", 45 printItem: "",
47 printList: { 46 printList: {
48 47
49 }, 48 },
50 } 49 }
51 }, 50 },
52 mounted(){ 51 mounted () {
53 sendThis(this); 52 sendThis(this);
54 this.fetchData() 53 this.fetchData()
55 }, 54 },
55 computed: {
56 ...mapGetters(['isRefresh'])
57 },
58 watch: {
59 isRefresh: {
60 handler (newVal, oldVal) {
61 if (newVal) this.fetchData
62 }
63 }
64 },
56 methods: { 65 methods: {
57 fetchData () { 66 fetchData () {
58 selectPrintTemplateList({...this.pageData}).then(res => { 67 selectPrintTemplateList({ ...this.pageData }).then(res => {
59 if(res.code == 200){ 68 if (res.code == 200) {
60 let { total, records } = res.result 69 let { total, records } = res.result
61 this.tableData.total = total ? total : 0 70 this.tableData.total = total ? total : 0
62 this.tableData.data = records ? records : [] 71 this.tableData.data = records ? records : []
...@@ -64,32 +73,29 @@ export default { ...@@ -64,32 +73,29 @@ export default {
64 }) 73 })
65 }, 74 },
66 //打开新增弹窗 75 //打开新增弹窗
67 openAddDialog(){ 76 openAddDialog () {
68 this.isDialog = true; 77 this.$popupDialog("新增打印模板", "system/dymbgl/components/editDialog", {}, "35%")
69 }, 78 },
70 //打开编辑弹窗 79 //打开编辑弹窗
71 openEditDialog(item){ 80 openEditDialog (item) {
72 this.isDialog = true; 81 this.$popupDialog("编辑打印模板", "system/dymbgl/components/editDialog", item, "35%")
73 this.$nextTick(() => {
74 this.$refs.editDialog.getDetailInfo(item);
75 })
76 }, 82 },
77 //删除数据 83 //删除数据
78 removeTemplate(item){ 84 removeTemplate (item) {
79 this.$confirm("确定要删除吗, 是否继续?", "提示", { 85 this.$confirm("确定要删除吗, 是否继续?", "提示", {
80 confirmButtonText: "确定", 86 confirmButtonText: "确定",
81 cancelButtonText: "取消", 87 cancelButtonText: "取消",
82 type: "warning", 88 type: "warning",
83 }).then(() => { 89 }).then(() => {
84 delPrintTemplate({bsmTmp: item.bsmTmp}).then((res) => { 90 delPrintTemplate({ bsmTmp: item.bsmTmp }).then((res) => {
85 if (res.code == 200) { 91 if (res.code == 200) {
86 this.$message.success("删除成功"); 92 this.$message.success("删除成功");
87 this.fetchData(); 93 this.fetchData();
88 } else { 94 } else {
89 this.$message.error(res.message); 95 this.$message.error(res.message);
90 } 96 }
91 }); 97 });
92 }) 98 })
93 .catch(() => { 99 .catch(() => {
94 this.$message({ 100 this.$message({
95 type: "info", 101 type: "info",
...@@ -98,9 +104,9 @@ export default { ...@@ -98,9 +104,9 @@ export default {
98 }); 104 });
99 }, 105 },
100 //设计打印模板 106 //设计打印模板
101 DesignByPRGData(item) { 107 DesignByPRGData (item) {
102 let LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM')); 108 let LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
103 LODOP.ADD_PRINT_DATA("ProgramData",item.tmpcontent); //装载模板 109 LODOP.ADD_PRINT_DATA("ProgramData", item.tmpcontent); //装载模板
104 //窗口关闭后,回调函数中保存的设计代码 110 //窗口关闭后,回调函数中保存的设计代码
105 if (LODOP.CVERSION) 111 if (LODOP.CVERSION)
106 CLODOP.On_Return = function (TaskID, printList) { 112 CLODOP.On_Return = function (TaskID, printList) {
......