style: 代码格式调整

mengfanliang-0726-businessPerson_table
mengfanliang 2024-08-19 10:08:45 +08:00
parent 93205d5bb8
commit f949002ed6
4 changed files with 84 additions and 67 deletions

View File

@ -70,6 +70,7 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
ref="multipleTable" ref="multipleTable"
@ -122,8 +123,8 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="page-btn-group"> <div class="page-btn-group">
<div/>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" /> <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div> </div>
</div> </div>
@ -186,24 +187,27 @@ export default {
this.getList(this.ROLE_ID) this.getList(this.ROLE_ID)
}, },
methods: { methods: {
/** 获取行数据 Key用于优化 table 表格的渲染 */
getRowKey(row) { getRowKey(row) {
return row.INSPECTION_ID return row.INSPECTION_ID
}, },
/** 转换检验的状态 */
translateInspection(id) { translateInspection(id) {
for (var i = 0; i < this.inspectionStatusList.length; i++) { for (var i = 0; i < this.inspectionStatusList.length; i++) {
if (this.inspectionStatusList[i].ID == id) return this.inspectionStatusList[i].NAME if (this.inspectionStatusList[i].ID == id) return this.inspectionStatusList[i].NAME
} }
}, },
// /** 执行参数搜索 */
getQuery() { getQuery() {
this.$refs.multipleTable.clearSelection() this.$refs.multipleTable.clearSelection()
this.getList() this.getList()
}, },
/** 执行重置 */
goKeyReset() { goKeyReset() {
this.resetSearch() this.resetSearch()
this.getQuery() this.getQuery()
}, },
// /** 获取列表 */
getList() { getList() {
this.listLoading = true this.listLoading = true
// requestFN( // requestFN(
@ -230,22 +234,24 @@ export default {
this.total = archiveList.length this.total = archiveList.length
}, 400) }, 400)
}, },
// /** 查看指定项 */
goDetail(row) { goDetail(row) {
this.$parent.activeName = 'Info' this.$parent.activeName = 'Info'
this.$parent.INSPECTION_ID = row.INSPECTION_ID this.$parent.INSPECTION_ID = row.INSPECTION_ID
}, },
/** 处理指派逻辑 */
goAssign(row) { goAssign(row) {
this.$parent.activeName = 'HiddenList' this.$parent.activeName = 'HiddenList'
// //
this.$parent.assign = row.INSPECTED_SITEUSER_ID.includes(this.USER_ID) ? '0' : '1' this.$parent.assign = row.INSPECTED_SITEUSER_ID.includes(this.USER_ID) ? '0' : '1'
this.$parent.INSPECTION_ID = row.INSPECTION_ID this.$parent.INSPECTION_ID = row.INSPECTION_ID
}, },
/** 处理验收 */
goAccept(row) { goAccept(row) {
this.$parent.activeName = 'HiddenList' this.$parent.activeName = 'HiddenList'
this.$parent.INSPECTION_ID = row.INSPECTION_ID this.$parent.INSPECTION_ID = row.INSPECTION_ID
}, },
/** 处理删除 */
handleDelete(id) { handleDelete(id) {
this.$confirm('确定要删除吗?', { this.$confirm('确定要删除吗?', {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -273,7 +279,7 @@ export default {
}).catch(() => { }).catch(() => {
}) })
}, },
/** 处理批量删除 */
batchDel() { batchDel() {
const _selectData = this.$refs.multipleTable.selection const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) { if (_selectData == null || _selectData.length == 0) {
@ -314,8 +320,8 @@ export default {
}).catch(() => { }).catch(() => {
}) })
}, },
// /** 判断按钮权限,用于是否显示按钮 */
hasButton: function() { hasButton() {
var keys = 'safetyenvironmental:add,safetyenvironmental:del,safetyenvironmental:edit,toExcel' var keys = 'safetyenvironmental:add,safetyenvironmental:del,safetyenvironmental:edit,toExcel'
requestFN( requestFN(
'/head/hasButton', '/head/hasButton',
@ -330,8 +336,8 @@ export default {
this.listLoading = false this.listLoading = false
}) })
}, },
// /** 获取数据字典数据 */
getDict: function() { getDict() {
requestFN( requestFN(
'/dictionaries/listSelectTree', '/dictionaries/listSelectTree',
{ {
@ -343,6 +349,7 @@ export default {
}) })
}, },
/** 重置搜索状态 */
resetSearch() { resetSearch() {
this.search = { this.search = {
INSPECTED_DEPARTMENT_NAME: '', // INSPECTED_DEPARTMENT_NAME: '', //

View File

@ -75,6 +75,7 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
ref="multipleTable" ref="multipleTable"
@ -136,6 +137,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="page-btn-group"> <div class="page-btn-group">
<div/> <div/>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" /> <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
@ -179,7 +181,6 @@
<el-dialog :visible.sync="dialogWriteSign" title="手写签字" width="600px" @close="dialogWriteSign = false"> <el-dialog :visible.sync="dialogWriteSign" title="手写签字" width="600px" @close="dialogWriteSign = false">
<WriteSign :width="600" :height="300" @subCanvas="subCanvas"/> <WriteSign :width="600" :height="300" @subCanvas="subCanvas"/>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
@ -260,10 +261,12 @@ export default {
this.getEditMyInfo() this.getEditMyInfo()
}, },
methods: { methods: {
/** 获取行数据 Key用于优化 table 表格的渲染 */
getRowKey(row) { getRowKey(row) {
return row.INSPECTION_ID return row.INSPECTION_ID
}, },
getEditMyInfo() { // /** 获取登录人信息 */
getEditMyInfo() {
requestFN( requestFN(
'/user/goEditMyInfo', '/user/goEditMyInfo',
{} {}
@ -276,16 +279,17 @@ export default {
}) })
}, },
// /** 执行参数搜索 */
getQuery() { getQuery() {
this.$refs.multipleTable.clearSelection() this.$refs.multipleTable.clearSelection()
this.getList() this.getList()
}, },
/** 执行重置 */
goKeyReset() { goKeyReset() {
this.resetSearch() this.resetSearch()
this.getQuery() this.getQuery()
}, },
// /** 获取列表 */
getList() { getList() {
this.listLoading = true this.listLoading = true
// requestFN( // requestFN(
@ -311,17 +315,18 @@ export default {
this.total = inspectedList.length this.total = inspectedList.length
}, 400) }, 400)
}, },
// /** 查看 */
goDetail(row) { goDetail(row) {
this.$parent.activeName = 'InspectionInfo' this.$parent.activeName = 'InspectionInfo'
this.$parent.INSPECTION_ID = row.INSPECTION_ID this.$parent.INSPECTION_ID = row.INSPECTION_ID
}, },
// /** 处理确认按钮 */
handleConfirm(row) { handleConfirm(row) {
this.resetForm(row) this.resetForm(row)
this.hiddenCount(row.INSPECTION_ID) // this.hiddenCount(row.INSPECTION_ID)
this.dialogFormEdit = true this.dialogFormEdit = true
}, },
/** 上传文件前的钩子处理函数 */
beforeFileUpload(file) { beforeFileUpload(file) {
var testmsg = file.name.substring(file.name.lastIndexOf('.') + 1) var testmsg = file.name.substring(file.name.lastIndexOf('.') + 1)
const extension = testmsg === 'pdf' const extension = testmsg === 'pdf'
@ -335,6 +340,7 @@ export default {
return false return false
} }
}, },
/** 查询安环检查是否有隐患 */
hiddenCount(INSPECTION_ID) { hiddenCount(INSPECTION_ID) {
this.listLoading = true this.listLoading = true
requestFN( requestFN(
@ -349,11 +355,11 @@ export default {
this.listLoading = false this.listLoading = false
}) })
}, },
/** 手写板*/ /** 手写板弹框打开 */
showModal() { showModal() {
this.dialogWriteSign = true this.dialogWriteSign = true
}, },
// /** 手写板完成 */
subCanvas(img64) { subCanvas(img64) {
console.info('img64' + img64) console.info('img64' + img64)
this.form.INSPECTED_SITEUSER_SIGN_IMG = img64 this.form.INSPECTED_SITEUSER_SIGN_IMG = img64
@ -361,8 +367,7 @@ export default {
console.info(this.form) console.info(this.form)
this.dialogWriteSign = false this.dialogWriteSign = false
}, },
/** 表单保存 */
//
confirm(INSPECTION_STATUS) { confirm(INSPECTION_STATUS) {
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
@ -408,9 +413,8 @@ export default {
} }
}) })
}, },
/** 判断按钮权限,用于是否显示按钮 */
// hasButton() {
hasButton: function() {
var keys = 'safetyenvironmentalinspector:add,safetyenvironmentalinspector:del,safetyenvironmentalinspector:edit,toExcel' var keys = 'safetyenvironmentalinspector:add,safetyenvironmentalinspector:del,safetyenvironmentalinspector:edit,toExcel'
requestFN( requestFN(
'/head/hasButton', '/head/hasButton',
@ -425,8 +429,8 @@ export default {
this.listLoading = false this.listLoading = false
}) })
}, },
// /** 获取数据字典数据 */
getDict: function() { getDict() {
requestFN( requestFN(
'/dictionaries/listSelectTree', '/dictionaries/listSelectTree',
{ {
@ -438,6 +442,7 @@ export default {
}) })
}, },
/** 重置搜索状态 */
resetSearch() { resetSearch() {
this.search = { this.search = {
INSPECTED_DEPARTMENT_NAME: '', // INSPECTED_DEPARTMENT_NAME: '', //
@ -450,6 +455,7 @@ export default {
} }
this.$refs.tree_InspectionType.clearHandle() this.$refs.tree_InspectionType.clearHandle()
}, },
/** 重置表单数据 */
resetForm(row) { resetForm(row) {
this.form = { this.form = {
INSPECTION_STATUS: '3', INSPECTION_STATUS: '3',
@ -461,14 +467,13 @@ export default {
file: '' // file: '' //
} }
}, },
/** 格式化日期时间 */
formatDate(date, format) { formatDate(date, format) {
return formatDate(date, format) return formatDate(date, format)
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.uo-flex { .uo-flex {
display: flex; display: flex;

View File

@ -70,6 +70,7 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
ref="multipleTable" ref="multipleTable"
@ -88,8 +89,9 @@
:reserve-selection="true" :reserve-selection="true"
type="selection" type="selection"
width="55" width="55"
fiexd="left"
align="center"/> align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" fiexd="left" /> <el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="INSPECTED_DEPARTMENT_NAMES" show-overflow-tooltip label="被检查单位" align="center" /> <el-table-column prop="INSPECTED_DEPARTMENT_NAMES" show-overflow-tooltip label="被检查单位" align="center" />
<el-table-column prop="INSPECTION_DEPARTMENT_NAME" show-overflow-tooltip label="检查部门" align="center" /> <el-table-column prop="INSPECTION_DEPARTMENT_NAME" show-overflow-tooltip label="检查部门" align="center" />
<el-table-column prop="INSPECTION_ORIGINATOR_NAME" show-overflow-tooltip label="检查发起人" align="center" /> <el-table-column prop="INSPECTION_ORIGINATOR_NAME" show-overflow-tooltip label="检查发起人" align="center" />
@ -127,6 +129,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="page-btn-group"> <div class="page-btn-group">
<div/> <div/>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" /> <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
@ -156,7 +159,6 @@
<el-dialog :visible.sync="dialogWriteSign" title="手写签字" width="600px" @close="dialogWriteSign = false"> <el-dialog :visible.sync="dialogWriteSign" title="手写签字" width="600px" @close="dialogWriteSign = false">
<WriteSign :width="600" :height="300" @subCanvas="subCanvas"/> <WriteSign :width="600" :height="300" @subCanvas="subCanvas"/>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
@ -233,19 +235,21 @@ export default {
this.getList(this.ROLE_ID) this.getList(this.ROLE_ID)
}, },
methods: { methods: {
/** 获取行数据 Key用于优化 table 表格的渲染 */
getRowKey(row) { getRowKey(row) {
return row.INSPECTION_ID return row.INSPECTION_ID
}, },
// /** 执行参数搜索 */
getQuery() { getQuery() {
this.$refs.multipleTable.clearSelection() this.$refs.multipleTable.clearSelection()
this.getList() this.getList()
}, },
/** 执行重置 */
goKeyReset() { goKeyReset() {
this.resetSearch() this.resetSearch()
this.getQuery() this.getQuery()
}, },
// /** 获取列表 */
getList() { getList() {
this.listLoading = true this.listLoading = true
// requestFN( // requestFN(
@ -271,30 +275,28 @@ export default {
this.listLoading = false this.listLoading = false
}, 400) }, 400)
}, },
// /** 查看指定检查项 */
goDetail(row) { goDetail(row) {
this.$parent.activeName = 'InspectionInfo' this.$parent.activeName = 'InspectionInfo'
this.$parent.INSPECTION_ID = row.INSPECTION_ID this.$parent.INSPECTION_ID = row.INSPECTION_ID
}, },
// /** 处理核实逻辑 */
handleVerify(row) { handleVerify(row) {
this.resetForm(row) this.resetForm(row)
this.dialogFormEdit = true this.dialogFormEdit = true
}, },
/** 手写板*/ /** 手写板弹框打开 */
showModal() { showModal() {
this.dialogWriteSign = true this.dialogWriteSign = true
}, },
// /** 手写板完成 */
subCanvas(img64) { subCanvas(img64) {
console.info('img64' + img64)
this.form.INSPECTION_USER_SIGN_IMG = img64 this.form.INSPECTION_USER_SIGN_IMG = img64
this.$set(this.form, 'INSPECTION_USER_SIGN_TIME', formatDate(new Date(), 'YYYY-MM-DD HH:mm')) this.$set(this.form, 'INSPECTION_USER_SIGN_TIME', formatDate(new Date(), 'YYYY-MM-DD HH:mm'))
console.info(this.form) console.info(this.form)
this.dialogWriteSign = false this.dialogWriteSign = false
}, },
/** 表单保存 */
//
confirm(INSPECTION_STATUS) { confirm(INSPECTION_STATUS) {
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
@ -338,9 +340,8 @@ export default {
} }
}) })
}, },
/** 判断按钮权限,用于是否显示按钮 */
// hasButton() {
hasButton: function() {
var keys = 'safetyenvironmentalinspector:add,safetyenvironmentalinspector:del,safetyenvironmentalinspector:edit,toExcel' var keys = 'safetyenvironmentalinspector:add,safetyenvironmentalinspector:del,safetyenvironmentalinspector:edit,toExcel'
requestFN( requestFN(
'/head/hasButton', '/head/hasButton',
@ -355,8 +356,8 @@ export default {
this.listLoading = false this.listLoading = false
}) })
}, },
// /** 获取数据字典数据 */
getDict: function() { getDict() {
requestFN( requestFN(
'/dictionaries/listSelectTree', '/dictionaries/listSelectTree',
{ {
@ -364,10 +365,9 @@ export default {
} }
).then((data) => { ).then((data) => {
this.inspectionTypeList = JSON.parse(data.zTreeNodes) this.inspectionTypeList = JSON.parse(data.zTreeNodes)
}).catch((e) => { }).catch((e) => { })
})
}, },
/** 重置搜索状态 */
resetSearch() { resetSearch() {
this.search = { this.search = {
INSPECTED_DEPARTMENT_NAME: '', // INSPECTED_DEPARTMENT_NAME: '', //
@ -380,6 +380,7 @@ export default {
} }
this.$refs.tree_InspectionType.clearHandle() this.$refs.tree_InspectionType.clearHandle()
}, },
/** 重置表单数据 */
resetForm(row) { resetForm(row) {
console.log(row) console.log(row)
this.form = { this.form = {
@ -391,6 +392,7 @@ export default {
INSPECTION_USER_SIGN_TIME: ''// INSPECTION_USER_SIGN_TIME: ''//
} }
}, },
/** 格式化日期时间 */
formatDate(date, format) { formatDate(date, format) {
return formatDate(date, format) return formatDate(date, format)
} }

View File

@ -109,8 +109,8 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="page-btn-group"> <div class="page-btn-group">
<div/>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" /> <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div> </div>
@ -140,7 +140,6 @@
</el-dialog> </el-dialog>
<trajectory ref="trakectory"/> <trajectory ref="trakectory"/>
</div> </div>
</template> </template>
<script> <script>
@ -150,6 +149,7 @@ import WriteSign from '@/components/WriteSign'
import waves from '@/directive/waves' // waves directive import waves from '@/directive/waves' // waves directive
import formatDate from '@/utils/dateformat' import formatDate from '@/utils/dateformat'
import trajectory from './trajectory' import trajectory from './trajectory'
export default { export default {
components: { Pagination, WriteSign, trajectory }, components: { Pagination, WriteSign, trajectory },
directives: { waves }, directives: { waves },
@ -208,19 +208,21 @@ export default {
this.getList(this.ROLE_ID) this.getList(this.ROLE_ID)
}, },
methods: { methods: {
/** 获取行数据 Key用于优化 table 表格的渲染 */
getRowKey(row) { getRowKey(row) {
return row.INSPECTION_ID return row.INSPECTION_ID
}, },
// /** 执行参数搜索 */
getQuery() { getQuery() {
this.$refs.multipleTable.clearSelection() this.$refs.multipleTable.clearSelection()
this.getList() this.getList()
}, },
/** 执行重置 */
goKeyReset() { goKeyReset() {
this.resetSearch() this.resetSearch()
this.getQuery() this.getQuery()
}, },
// /** 获取列表 */
getList() { getList() {
this.listLoading = true this.listLoading = true
// requestFN( // requestFN(
@ -246,29 +248,28 @@ export default {
this.total = 0 this.total = 0
}, 400) }, 400)
}, },
// /** 查看指定项 */
goDetail(row) { goDetail(row) {
this.$parent.activeName = 'InspectionInfo' this.$parent.activeName = 'InspectionInfo'
this.$parent.INSPECTION_ID = row.INSPECTION_ID this.$parent.INSPECTION_ID = row.INSPECTION_ID
}, },
// /** 处理核实逻辑 */
handleVerify(row) { // handleVerify(row) {
this.resetForm(row) // this.resetForm(row)
this.dialogFormEdit = true // this.dialogFormEdit = true
}, // },
/** 手写板*/ /** 手写板弹框打开 */
showModal() { showModal() {
this.dialogWriteSign = true this.dialogWriteSign = true
}, },
// /** 手写板完成 */
subCanvas(img64) { subCanvas(img64) {
console.info('img64' + img64) console.info('img64' + img64)
this.form.INSPECTION_USER_SIGN_IMG = img64 this.form.INSPECTION_USER_SIGN_IMG = img64
this.$set(this.form, 'INSPECTION_USER_SIGN_TIME', formatDate(new Date(), 'YYYY-MM-DD HH:mm')) this.$set(this.form, 'INSPECTION_USER_SIGN_TIME', formatDate(new Date(), 'YYYY-MM-DD HH:mm'))
this.dialogWriteSign = false this.dialogWriteSign = false
}, },
/** 表单保存 */
//
confirm(INSPECTION_STATUS) { confirm(INSPECTION_STATUS) {
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
@ -312,9 +313,8 @@ export default {
} }
}) })
}, },
/** 判断按钮权限,用于是否显示按钮 */
// hasButton() {
hasButton: function() {
var keys = 'safetyenvironmentalinspector:add,safetyenvironmentalinspector:del,safetyenvironmentalinspector:edit,toExcel' var keys = 'safetyenvironmentalinspector:add,safetyenvironmentalinspector:del,safetyenvironmentalinspector:edit,toExcel'
requestFN( requestFN(
'/head/hasButton', '/head/hasButton',
@ -329,8 +329,8 @@ export default {
this.listLoading = false this.listLoading = false
}) })
}, },
// /** 获取数据字典数据 */
getDict: function() { getDict() {
requestFN( requestFN(
'/dictionaries/getLevels', '/dictionaries/getLevels',
{ {
@ -342,6 +342,7 @@ export default {
}) })
}, },
/** 重置搜索状态 */
resetSearch() { resetSearch() {
this.search = { this.search = {
INSPECTED_DEPARTMENT_NAME: '', // INSPECTED_DEPARTMENT_NAME: '', //
@ -352,6 +353,7 @@ export default {
INSPECTION_STATUS: '' // INSPECTION_STATUS: '' //
} }
}, },
/** 重置表单数据 */
resetForm(row) { resetForm(row) {
this.form = { this.form = {
INSPECTION_INSPECTOR_ID: row.INSPECTION_INSPECTOR_ID, // ID INSPECTION_INSPECTOR_ID: row.INSPECTION_INSPECTOR_ID, // ID
@ -362,10 +364,11 @@ export default {
INSPECTION_USER_SIGN_TIME: ''// INSPECTION_USER_SIGN_TIME: ''//
} }
}, },
/** 格式化日期时间 */
formatDate(date, format) { formatDate(date, format) {
return formatDate(date, format) return formatDate(date, format)
}, },
/** 申辩记录进入,此时会调用 trajectory 所在子组件内的 init 方法,并传入 id 执行 init 方法的逻辑 */
openTrajectory(id) { openTrajectory(id) {
this.$refs.trakectory.init(id) this.$refs.trakectory.init(id)
} }