03f92ffb by 任超

style:申请业务规则配置

1 parent 6cb6758a
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
5 id="dialogBox"> 5 id="dialogBox">
6 <div slot="title"> 6 <div slot="title">
7 <div class="dialog_title"> 7 <div class="dialog_title">
8 <b>{{ title }}</b> 8 <b>{{ title }}</b>
9 <div v-if="isFullscreen" class="dialog_full"> 9 <div v-if="isFullscreen" class="dialog_full">
10 <i class="el-icon-rank" v-if="fullscreen" @click="handleFullscreen"></i> 10 <i class="el-icon-rank" v-if="fullscreen" @click="handleFullscreen"></i>
11 <i class="el-icon-full-screen" v-else @click="handleFullscreen" /> 11 <i class="el-icon-full-screen" v-else @click="handleFullscreen" />
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
17 </div> 17 </div>
18 <div slot="footer" class="dialog_footer" v-if="isButton"> 18 <div slot="footer" class="dialog_footer" v-if="isButton">
19 <el-button @click="closeDialog" v-if="isReset">取消</el-button> 19 <el-button @click="closeDialog" v-if="isReset">取消</el-button>
20 <el-button type="primary" plain @click="submitForm" v-if="isSave" :loading="saveloding"> 20 <el-button type="primary" plain @click="submitForm" v-if="isSave" :disabled="btnDisabled" :loading="saveloding">
21 {{ saveButton }}</el-button> 21 {{ saveButton }}</el-button>
22 </div> 22 </div>
23 </el-dialog> 23 </el-dialog>
24 </template> 24 </template>
...@@ -62,9 +62,9 @@ export default { ...@@ -62,9 +62,9 @@ export default {
62 type: Boolean, 62 type: Boolean,
63 default: false, 63 default: false,
64 }, 64 },
65 loadingText: { 65 btnDisabled: {
66 type: String, 66 type: Boolean,
67 default: '拼命加载中', 67 default: false
68 } 68 }
69 }, 69 },
70 data () { 70 data () {
......
...@@ -15,7 +15,6 @@ Vue.directive("theme", theme) ...@@ -15,7 +15,6 @@ Vue.directive("theme", theme)
15 15
16 Vue.directive('fo', { 16 Vue.directive('fo', {
17 inserted (el, binding, vnode) { 17 inserted (el, binding, vnode) {
18 // 聚焦元素
19 el.querySelector('input').focus() 18 el.querySelector('input').focus()
20 } 19 }
21 }) 20 })
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
24 </template> 24 </template>
25 <script> 25 <script>
26 import { mapGetters } from 'vuex' 26 import { mapGetters } from 'vuex'
27 import { judgeSort, realMove, findParents } from '@/utils/operation' 27 import { realMove, findParents } from '@/utils/operation'
28 export default { 28 export default {
29 props: { 29 props: {
30 ruleForm: { 30 ruleForm: {
...@@ -130,7 +130,7 @@ export default { ...@@ -130,7 +130,7 @@ export default {
130 <el-select disabled={scope.row.sfggcl == '1'} value={scope.row[scope.column.property]} 130 <el-select disabled={scope.row.sfggcl == '1'} value={scope.row[scope.column.property]}
131 onChange={(val) => { scope.row[scope.column.property] = val }} clearable> 131 onChange={(val) => { scope.row[scope.column.property] = val }} clearable>
132 { 132 {
133 this.subData['djqx'].map(option => { 133 this.dictData['A40'].map(option => {
134 return ( 134 return (
135 <el-option label={option.nodename} value={option.nodecode}></el-option> 135 <el-option label={option.nodename} value={option.nodecode}></el-option>
136 ) 136 )
...@@ -146,8 +146,8 @@ export default { ...@@ -146,8 +146,8 @@ export default {
146 render: (h, scope) => { 146 render: (h, scope) => {
147 return ( 147 return (
148 <div> 148 <div>
149 <el-button type='text' disabled={scope.row.isTop} onClick={() => { this.moveUpward(scope.$index, scope.row) }}>上移</el-button> 149 <el-button type='text' disabled={scope.$index == 0} onClick={() => { this.moveUpward(scope.$index, scope.row) }}>上移</el-button>
150 <el-button type='text' disabled={scope.row.isBottom} onClick={() => { this.moveDown(scope.$index, scope.row) }}>下移</el-button > 150 <el-button type='text' disabled={(scope.$index + 1) == this.tableData.length} onClick={() => { this.moveDown(scope.$index, scope.row) }}>下移</el-button >
151 </div> 151 </div>
152 ) 152 )
153 } 153 }
...@@ -159,13 +159,15 @@ export default { ...@@ -159,13 +159,15 @@ export default {
159 watch: { 159 watch: {
160 tableData: { 160 tableData: {
161 handler (newValue, oldValue) { 161 handler (newValue, oldValue) {
162 this.$emit('updateValue', newValue) 162 if (!_.isEqual(newValue, this.subData.clxx)) {
163 this.$emit('updateValue', newValue)
164 }
163 }, 165 },
164 deep: true 166 deep: true
165 }, 167 },
166 subData: { 168 subData: {
167 handler: function (newValue) { 169 handler: function (newValue) {
168 this.tableData = judgeSort(newValue.clxx) 170 this.tableData = _.cloneDeep(newValue.clxx)
169 }, 171 },
170 deep: true 172 deep: true
171 }, 173 },
......
...@@ -26,15 +26,15 @@ ...@@ -26,15 +26,15 @@
26 import { judgeSort, realMove, findParents } from '@/utils/operation' 26 import { judgeSort, realMove, findParents } from '@/utils/operation'
27 export default { 27 export default {
28 props: { 28 props: {
29 djqxList: {
30 type: Array, default: () => {
31 return []
32 }
33 },
34 ruleForm: { 29 ruleForm: {
35 type: Object, default: () => { 30 type: Object, default: () => {
36 return {} 31 return {}
37 } 32 }
33 },
34 djqx: {
35 type: Array, default: () => {
36 return []
37 }
38 } 38 }
39 }, 39 },
40 data () { 40 data () {
...@@ -126,8 +126,8 @@ export default { ...@@ -126,8 +126,8 @@ export default {
126 render: (h, scope) => { 126 render: (h, scope) => {
127 return ( 127 return (
128 <div> 128 <div>
129 <el-button type='text' disabled={scope.row.isTop} onClick={() => { this.moveUpward(scope.$index, scope.row) }}>上移</el-button> 129 <el-button type='text' disabled={scope.$index == 0} onClick={() => { this.moveUpward(scope.$index, scope.row) }}>上移</el-button>
130 <el-button type='text' disabled={scope.row.isBottom} onClick={() => { this.moveDown(scope.$index, scope.row) }}>下移</el-button > 130 <el-button type='text' disabled={(scope.$index + 1) == this.tableData.length} onClick={() => { this.moveDown(scope.$index, scope.row) }}>下移</el-button >
131 </div> 131 </div>
132 ) 132 )
133 } 133 }
...@@ -137,16 +137,31 @@ export default { ...@@ -137,16 +137,31 @@ export default {
137 } 137 }
138 }, 138 },
139 watch: { 139 watch: {
140 djqxList: {
141 handler: function (newValue) {
142 this.tableData = judgeSort(newValue)
143 },
144 deep: true,
145 immediate: true
146 },
147 tableData: { 140 tableData: {
148 handler (newValue, oldValue) { 141 handler (newValue, oldValue) {
149 this.$emit('updateValue', newValue) 142 let that = this
143 if (!_.isEqual(newValue, this.djqx)) {
144 let temp = newValue.some((item, index, array) => {
145 return item.repeat;
146 })
147 if (temp) {
148 that.$emit('updateValue', {
149 djqx: newValue,
150 btnDisabled: true
151 })
152 } else {
153 that.$emit('updateValue', {
154 djqx: newValue,
155 btnDisabled: false
156 })
157 }
158 }
159 },
160 deep: true
161 },
162 djqx: {
163 handler: function (newValue) {
164 this.tableData = _.cloneDeep(newValue)
150 }, 165 },
151 deep: true 166 deep: true
152 } 167 }
......
1 <template> 1 <template>
2 <dialogBox title="申请业务规则配置" @submitForm="submitForm" @closeDialog="closeDialog" v-model="myValue"> 2 <dialogBox title="申请业务规则配置" @submitForm="submitForm" @closeDialog="closeDialog" v-model="myValue"
3 :btnDisabled="btnDisabled">
3 <ul class="edit-title-list" v-if="titleList.length > 0"> 4 <ul class="edit-title-list" v-if="titleList.length > 0">
4 <li v-for="(item, index) in titleList" @click="handleTitleSelct(item, index)" :key="index" 5 <li v-for="(item, index) in titleList" @click="handleTitleSelct(item, index)" :key="index"
5 :class="{ active: index == tn }">{{ 6 :class="{ active: index == tn }">{{
...@@ -113,8 +114,8 @@ ...@@ -113,8 +114,8 @@
113 </el-col> 114 </el-col>
114 </el-row> 115 </el-row>
115 </el-form> 116 </el-form>
116 <djqxsd v-show="n == 1" :djqxList="subData.djqx" :ruleForm="ruleForm" @updateValue="getDjqxValue" /> 117 <djqxsd v-show="n == 1" :ruleForm="ruleForm" :djqx="subData.djqx" @updateValue="getDjqxValue" />
117 <clgzsd v-show="n == 2" :ruleForm="ruleForm" :subData="subData" @updateValue="getClValue" /> 118 <clgzsd v-show="n == 2" :ruleForm="ruleForm" :subData="subData" @updateValue="getClgzValue" />
118 <dyztsd :ruleForm="ruleForm" :subData="subData" v-show="n == 3" @updateValue="getDyztsdValue" /> 119 <dyztsd :ruleForm="ruleForm" :subData="subData" v-show="n == 3" @updateValue="getDyztsdValue" />
119 </div> 120 </div>
120 </div> 121 </div>
...@@ -155,7 +156,9 @@ export default { ...@@ -155,7 +156,9 @@ export default {
155 }, 156 },
156 data () { 157 data () {
157 return { 158 return {
159 djqx: [],
158 myValue: this.value, 160 myValue: this.value,
161 btnDisabled: false,
159 tn: 0, 162 tn: 0,
160 titleList: [], 163 titleList: [],
161 imgUploadUrl: fileController.uploadUrl(), 164 imgUploadUrl: fileController.uploadUrl(),
...@@ -228,9 +231,11 @@ export default { ...@@ -228,9 +231,11 @@ export default {
228 this.getSqdjywDetail(obj.bsmSqyw) 231 this.getSqdjywDetail(obj.bsmSqyw)
229 }, 232 },
230 getDjqxValue (val) { 233 getDjqxValue (val) {
231 this.subData.djqx = val 234 if (val.clxx) this.subData.djqx = val.djqx
235 this.btnDisabled = val.btnDisabled
236 console.log(this.btnDisabled);
232 }, 237 },
233 getClValue (val) { 238 getClgzValue (val) {
234 this.subData.clxx = val 239 this.subData.clxx = val
235 }, 240 },
236 // 单元状态设定 241 // 单元状态设定
...@@ -281,13 +286,12 @@ export default { ...@@ -281,13 +286,12 @@ export default {
281 message: '上传成功', 286 message: '上传成功',
282 type: 'success', 287 type: 'success',
283 }) 288 })
284 console.log(res);
285 } else { 289 } else {
286 this.loading = false 290 this.loading = false
287 this.$message.error(res.message) 291 this.$message.error(res.message)
288 } 292 }
289 } 293 }
290 }, 294 }
291 }; 295 };
292 </script> 296 </script>
293 <style scoped lang="scss"> 297 <style scoped lang="scss">
......