|
@@ -1,7 +1,8 @@
|
|
<template>
|
|
<template>
|
|
<!-- 钢瓶档案 -->
|
|
<!-- 钢瓶档案 -->
|
|
<div>
|
|
<div>
|
|
- <actionBar menuTitle="钢瓶档案" :formList="formList" :ruleForm="searchRuleForm" @searchProtocol="searchProtocol">
|
|
|
|
|
|
+ <actionBar menuTitle="钢瓶档案" :operateList="operateList" :formList="formList" :ruleForm="searchRuleForm"
|
|
|
|
+ @openModel="openModel" @searchProtocol="searchProtocol">
|
|
</actionBar>
|
|
</actionBar>
|
|
<tables :key="Math.random()" :suspension="true" :tableList="tableList" :tableData="tableData"
|
|
<tables :key="Math.random()" :suspension="true" :tableList="tableList" :tableData="tableData"
|
|
@buttonData="buttonData"></tables>
|
|
@buttonData="buttonData"></tables>
|
|
@@ -11,10 +12,13 @@
|
|
@changeCurrent="changeCurrent">
|
|
@changeCurrent="changeCurrent">
|
|
</pagination>
|
|
</pagination>
|
|
</div>
|
|
</div>
|
|
- <el-dialog v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading"
|
|
|
|
- element-loading-background="rgba(0, 0, 0, 0.8)" :title="staffTitle" :visible.sync="staffDialogVisible" width="60%"
|
|
|
|
- :close-on-click-modal="false">
|
|
|
|
- <forms ref="childRules" :formNewList="formRuleList" :ruleForm="ruleForm" labelWidth="180px"></forms>
|
|
|
|
|
|
+ <el-dialog :title="staffTitle" :visible.sync="cylinderDialog" width="800px" :close-on-click-modal="false"
|
|
|
|
+ @close="closeDialog">
|
|
|
|
+ <forms ref="childRules" :formNewList="cylinderRule" :ruleForm="cylinderForm" labelWidth="160px"></forms>
|
|
|
|
+ <span slot="footer" class="dialog-footer" v-if="operationType != 'logs'">
|
|
|
|
+ <el-button plain @click="cylinderDialog = false">取 消</el-button>
|
|
|
|
+ <el-button type="primary" :loading="confirmLoading" @click="handleAdd">确 定</el-button>
|
|
|
|
+ </span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -22,15 +26,18 @@
|
|
<script>
|
|
<script>
|
|
import {
|
|
import {
|
|
getGasCylinder,
|
|
getGasCylinder,
|
|
- getGasCylinderDetails
|
|
|
|
|
|
+ getGasCylinderDetails,
|
|
|
|
+ addGasCylinder,
|
|
|
|
+ putGasCylinder,
|
|
|
|
+ delGasCylinder,
|
|
} from '@/api/inspection'
|
|
} from '@/api/inspection'
|
|
import actionBar from '@/components/actionBar'
|
|
import actionBar from '@/components/actionBar'
|
|
import tables from '@/components/tables'
|
|
import tables from '@/components/tables'
|
|
import pagination from '@/components/pagination'
|
|
import pagination from '@/components/pagination'
|
|
import forms from '@/components/forms'
|
|
import forms from '@/components/forms'
|
|
import {
|
|
import {
|
|
- formRules,
|
|
|
|
- employee
|
|
|
|
|
|
+ employee,
|
|
|
|
+ cylinderformRules
|
|
} from "./cylinder.js";
|
|
} from "./cylinder.js";
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
@@ -46,10 +53,15 @@
|
|
label: '单位内编号',
|
|
label: '单位内编号',
|
|
field: 'innerCode',
|
|
field: 'innerCode',
|
|
placeholder: '单位内编号',
|
|
placeholder: '单位内编号',
|
|
- },],
|
|
|
|
|
|
+ }, ],
|
|
searchRuleForm: {
|
|
searchRuleForm: {
|
|
innerCode: '',
|
|
innerCode: '',
|
|
},
|
|
},
|
|
|
|
+ operateList: [{
|
|
|
|
+ type: 'add',
|
|
|
|
+ title: '添加钢瓶',
|
|
|
|
+ icon: 'el-icon-plus',
|
|
|
|
+ }],
|
|
tableList: employee(),
|
|
tableList: employee(),
|
|
tableData: [],
|
|
tableData: [],
|
|
Pagination: {
|
|
Pagination: {
|
|
@@ -57,18 +69,17 @@
|
|
PageSize: 10,
|
|
PageSize: 10,
|
|
},
|
|
},
|
|
Total: 0,
|
|
Total: 0,
|
|
- formRuleList: [],
|
|
|
|
- staffTitle: '查看',
|
|
|
|
- staffDialogVisible: false,
|
|
|
|
- formRuleList: [],
|
|
|
|
|
|
+ staffTitle: '添加钢瓶',
|
|
searchValue: {},
|
|
searchValue: {},
|
|
- ruleForm: {},
|
|
|
|
- loading: false,
|
|
|
|
|
|
+ cylinderDialog: false,
|
|
|
|
+ cylinderRule: cylinderformRules(),
|
|
|
|
+ cylinderForm: {},
|
|
|
|
+ confirmLoading: false,
|
|
|
|
+ operationType: '',
|
|
|
|
+ clientId: '',
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- const dataList = formRules();
|
|
|
|
- this.formRuleList = dataList;
|
|
|
|
this.getList()
|
|
this.getList()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -101,13 +112,87 @@
|
|
this.loading = false
|
|
this.loading = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- buttonData(row, type) {
|
|
|
|
|
|
+ openModel(type) {
|
|
this.operationType = type
|
|
this.operationType = type
|
|
|
|
+ if (type == 'add') {
|
|
|
|
+ this.staffTitle = '添加钢瓶'
|
|
|
|
+ }
|
|
|
|
+ const arr = [...this.cylinderRule]
|
|
|
|
+ arr.forEach((item, index) => {
|
|
|
|
+ item.disabled = false
|
|
|
|
+ })
|
|
|
|
+ this.cylinderRule = arr
|
|
|
|
+ this.cylinderDialog = true
|
|
|
|
+ },
|
|
|
|
+ buttonData(row, type) {
|
|
if (type == 'logs') {
|
|
if (type == 'logs') {
|
|
- this.staffTitle = '详情'
|
|
|
|
- this.getDetails(row.inner_code)
|
|
|
|
|
|
+ this.cylinderForm = row
|
|
|
|
+ this.staffTitle = '钢瓶详情'
|
|
|
|
+ const arr = [...this.cylinderRule]
|
|
|
|
+ arr.forEach((item, index) => {
|
|
|
|
+ item.disabled = true
|
|
|
|
+ })
|
|
|
|
+ this.cylinderRule = arr
|
|
|
|
+ this.cylinderDialog = true
|
|
|
|
+ // this.getDetails(row.inner_code)
|
|
|
|
+ } else if (type == 'edit') {
|
|
|
|
+ this.cylinderForm = row
|
|
|
|
+ this.staffTitle = '编辑钢瓶'
|
|
|
|
+ this.clientId = row.id
|
|
|
|
+ this.cylinderDialog = true
|
|
|
|
+ } else if (type == 'del') {
|
|
|
|
+ this.getCancelOrder(row.id)
|
|
}
|
|
}
|
|
- this.staffDialogVisible = true
|
|
|
|
|
|
+ this.operationType = type
|
|
|
|
+ },
|
|
|
|
+ // 弹窗表单添加
|
|
|
|
+ handleAdd() {
|
|
|
|
+ let flag = this.$refs['childRules'].validateForm();
|
|
|
|
+ if (flag) {
|
|
|
|
+ var params = {
|
|
|
|
+ ...this.cylinderForm,
|
|
|
|
+ }
|
|
|
|
+ if (this.operationType == 'edit') {
|
|
|
|
+ params.id = this.clientId
|
|
|
|
+ putGasCylinder(params).then(res => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.getList()
|
|
|
|
+ this.cylinderDialog = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ addGasCylinder(params).then(res => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.getList()
|
|
|
|
+ this.cylinderDialog = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error('表单信息不完整,请继续填写完整');
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 删除钢瓶
|
|
|
|
+ getCancelOrder(ID) {
|
|
|
|
+ this.$confirm('此操作将永久删除该钢瓶, 是否继续?', '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ }).then(() => {
|
|
|
|
+ delGasCylinder({
|
|
|
|
+ id: ID,
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '操作成功',
|
|
|
|
+ type: 'success'
|
|
|
|
+ });
|
|
|
|
+ this.getList()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ // console.log('取消')
|
|
|
|
+ });
|
|
},
|
|
},
|
|
changeSize(val) {
|
|
changeSize(val) {
|
|
this.Pagination.PageSize = val
|
|
this.Pagination.PageSize = val
|
|
@@ -117,6 +202,15 @@
|
|
this.Pagination.PageIndex = val
|
|
this.Pagination.PageIndex = val
|
|
this.getList()
|
|
this.getList()
|
|
},
|
|
},
|
|
|
|
+ closeDialog() {
|
|
|
|
+ const arr = [...this.cylinderRule]
|
|
|
|
+ arr.forEach((item, index) => {
|
|
|
|
+ item.disabled = false
|
|
|
|
+ })
|
|
|
|
+ this.cylinderRule = arr
|
|
|
|
+ this.cylinderForm = {}
|
|
|
|
+ this.$refs['childRules'].resetCheck();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|