|
|
@ -192,16 +192,20 @@ |
|
|
<el-button @click="cancel">{{$t('form.cancel')}}</el-button> |
|
|
<el-button @click="cancel">{{$t('form.cancel')}}</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<Sign ref="signRef" @callback="doSign" /> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { listData, getData, delData, addData, updateData } from "@/api/system/dict/data" |
|
|
import { listData, getData, delData, addData, updateData } from "@/api/system/dict/data" |
|
|
import { optionselect as getDictOptionselect, getType } from "@/api/system/dict/type" |
|
|
import { optionselect as getDictOptionselect, getType } from "@/api/system/dict/type" |
|
|
|
|
|
import Sign from '@/views/business/study/comp/sign.vue' |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: "Data", |
|
|
name: "Data", |
|
|
dicts: ['sys_normal_disable'], |
|
|
dicts: ['sys_normal_disable'], |
|
|
|
|
|
components:{Sign}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
// 遮罩层 |
|
|
// 遮罩层 |
|
|
@ -277,6 +281,8 @@ export default { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
readonly:false, |
|
|
readonly:false, |
|
|
|
|
|
operate:'', |
|
|
|
|
|
currRow:{} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
@ -376,37 +382,82 @@ export default { |
|
|
this.$refs["form"].validate(valid => { |
|
|
this.$refs["form"].validate(valid => { |
|
|
if (valid) { |
|
|
if (valid) { |
|
|
if (this.form.dictCode != undefined) { |
|
|
if (this.form.dictCode != undefined) { |
|
|
updateData(this.form).then(response => { |
|
|
|
|
|
this.$store.dispatch('dict/removeDict', this.queryParams.dictType) |
|
|
|
|
|
this.open = false |
|
|
|
|
|
this.getList() |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
this.operate = "update" |
|
|
|
|
|
this.$refs.signRef.show( |
|
|
|
|
|
this.$t('page.system.dict.modifyDictData'), |
|
|
|
|
|
this.$t('page.system.dict.modifyDictData'), |
|
|
|
|
|
) |
|
|
} else { |
|
|
} else { |
|
|
addData(this.form).then(response => { |
|
|
|
|
|
this.$store.dispatch('dict/removeDict', this.queryParams.dictType) |
|
|
|
|
|
this.open = false |
|
|
|
|
|
this.getList() |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
this.operate = "add" |
|
|
|
|
|
this.$refs.signRef.show( |
|
|
|
|
|
this.$t('page.system.dict.addDictData'), |
|
|
|
|
|
this.$t('page.system.dict.addDictData'), |
|
|
|
|
|
) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
doAdd(sign){ |
|
|
|
|
|
this.$modal.loading() |
|
|
|
|
|
addData({dict:this.form,sign:sign}).then(response => { |
|
|
|
|
|
this.$refs.signRef.cancel() |
|
|
|
|
|
this.$store.dispatch('dict/removeDict', this.queryParams.dictType) |
|
|
|
|
|
this.open = false |
|
|
|
|
|
this.getList() |
|
|
|
|
|
}).finally(()=>{ |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
doUpdate(sign){ |
|
|
|
|
|
this.$modal.loading() |
|
|
|
|
|
updateData({dict:this.form,sign:sign}).then(response => { |
|
|
|
|
|
this.$refs.signRef.cancel() |
|
|
|
|
|
this.$store.dispatch('dict/removeDict', this.queryParams.dictType) |
|
|
|
|
|
this.open = false |
|
|
|
|
|
this.getList() |
|
|
|
|
|
}).finally(()=>{ |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
/** 删除按钮操作 */ |
|
|
/** 删除按钮操作 */ |
|
|
handleDelete(row) { |
|
|
handleDelete(row) { |
|
|
const dictCodes = row.dictCode || this.ids |
|
|
|
|
|
this.$modal.confirm(this.$t('form.confirmDelete')).then(function() { |
|
|
|
|
|
return delData(dictCodes) |
|
|
|
|
|
|
|
|
this.currRow = row |
|
|
|
|
|
this.$modal.confirm(this.$t('form.confirmDelete')).then(()=> { |
|
|
|
|
|
this.operate = "delete" |
|
|
|
|
|
this.$refs.signRef.show( |
|
|
|
|
|
this.$t('page.system.dict.deleteDictData'), |
|
|
|
|
|
this.$t('page.system.dict.deleteDictData'), |
|
|
|
|
|
) |
|
|
}).then(() => { |
|
|
}).then(() => { |
|
|
this.getList() |
|
|
|
|
|
this.$store.dispatch('dict/removeDict', this.queryParams.dictType) |
|
|
|
|
|
}).catch(() => {}) |
|
|
}).catch(() => {}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
doDelete(sign) { |
|
|
|
|
|
this.$modal.loading() |
|
|
|
|
|
delData({dict:this.currRow,sign:sign}).then(response => { |
|
|
|
|
|
this.$refs.signRef.cancel() |
|
|
|
|
|
this.getList() |
|
|
|
|
|
is.$store.dispatch('dict/removeDict', this.queryParams.dictType) |
|
|
|
|
|
}).finally(()=>{ |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
/** 导出按钮操作 */ |
|
|
/** 导出按钮操作 */ |
|
|
handleExport() { |
|
|
handleExport() { |
|
|
this.download('system/dict/data/export', { |
|
|
this.download('system/dict/data/export', { |
|
|
...this.queryParams |
|
|
...this.queryParams |
|
|
}, `data_${new Date().getTime()}.xlsx`) |
|
|
}, `data_${new Date().getTime()}.xlsx`) |
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
doSign(val){ |
|
|
|
|
|
if(this.operate==='update'){ |
|
|
|
|
|
this.doUpdate(val) |
|
|
|
|
|
} |
|
|
|
|
|
if(this.operate==='add'){ |
|
|
|
|
|
this.doAdd(val) |
|
|
|
|
|
} |
|
|
|
|
|
if(this.operate==='delete'){ |
|
|
|
|
|
this.doDelete(val) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |