planPoint.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. <template xmlns="http://www.w3.org/1999/html">
  2. <div>
  3. <el-dialog :visible.sync="dialog.dialogFormVisible" width="90%" :close-on-click-modal="false"
  4. title='添加计划检测点'>
  5. <el-row>
  6. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
  7. <el-form-item label="装置" prop="plantId">
  8. <el-select v-model="queryParams.plantId" @change="handleQuery"
  9. placeholder="请选择装置" clearable size="small" disabled>
  10. <el-option
  11. v-for="plant in plantOperation"
  12. :key="plant.plantId"
  13. :label="plant.plantName"
  14. :value="plant.plantId"
  15. />
  16. </el-select>
  17. </el-form-item>
  18. <el-form-item label="群组编码" prop="groupCode">
  19. <el-input
  20. v-model="queryParams.groupCode"
  21. placeholder="请输入群组编码"
  22. clearable
  23. @keyup.enter.native="handleQuery"
  24. />
  25. </el-form-item>
  26. <el-form-item label="密封点类型" prop="pointType" label-width="90px">
  27. <el-select v-model="queryParams.pointType" @change="handleQuery" placeholder="请选择密封点类型" clearable
  28. size="small">
  29. <el-option
  30. v-for="dict in pointOptions"
  31. :key="dict.dictValue"
  32. :label="dict.dictLabel"
  33. :value="dict.dictValue"
  34. />
  35. </el-select>
  36. </el-form-item>
  37. <el-form-item>
  38. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  39. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  40. </el-form-item>
  41. </el-form>
  42. </el-row>
  43. <el-row>
  44. <el-col :span="11" style="padding-right: 5px;text-align: center">
  45. <el-table :data="leftData" style="width: 100%;" height="530px" border @selection-change="saveLeft"
  46. ref="leftData">
  47. <el-table-column type="selection" align="center" fixed="left"></el-table-column>
  48. <!-- <el-table-column label="检测值" align="center" prop="testValue" v-if="!checkAgain" width="80"/>
  49. <el-table-column label="复测值" align="center" prop="testValue" v-else width="80"/>
  50. <el-table-column label="净检测值" align="center" prop="netTestValue" width="80"/>-->
  51. <el-table-column label="装置名称" align="center" prop="plantName" width="100"
  52. :show-overflow-tooltip="true"/>
  53. <el-table-column label="区域名称" align="center" prop="regionName" width="100"
  54. :show-overflow-tooltip="true"/>
  55. <el-table-column label="平台" align="center" prop="layer" width="100" :show-overflow-tooltip="true"/>
  56. <el-table-column label="设备/管线名称" align="center" prop="devName" width="130"
  57. :show-overflow-tooltip="true"/>
  58. <el-table-column label="设备/管线编号" align="center" prop="devCode" width="130"
  59. :show-overflow-tooltip="true"/>
  60. <el-table-column label="群组编码" align="center" prop="groupCode" width="100"
  61. :show-overflow-tooltip="true"/>
  62. <el-table-column label="密封点扩展号编码" align="center" prop="extendCode" width="150"
  63. :show-overflow-tooltip="true"/>
  64. <el-table-column label="密封点类型" align="center" prop="pointType" width="100"
  65. :show-overflow-tooltip="true"/>
  66. <!-- <el-table-column label="仪器编号" align="center" prop="inspectionCode" width="100"
  67. :show-overflow-tooltip="true"/>
  68. <el-table-column label="泄漏部位" align="center" prop="leakagePosition" width="100"
  69. :show-overflow-tooltip="true"/>
  70. <el-table-column label="校准人员" align="center" prop="checker" width="100" :show-overflow-tooltip="true"/>
  71. <el-table-column label="校准日期" align="center" prop="checkDate" width="100"
  72. :show-overflow-tooltip="true"/>
  73. <el-table-column label="泄漏程度" align="center" prop="leakageDegree" width="100"
  74. :show-overflow-tooltip="true"/>-->
  75. </el-table>
  76. <pagination
  77. v-show="leftTotal>0"
  78. :total="leftTotal"
  79. :page.sync="queryParams.pageNum"
  80. :limit.sync="queryParams.pageSize"
  81. @pagination="getList"
  82. />
  83. </el-col>
  84. <el-col :span="2" style="margin-top: 11%;text-align: center">
  85. <el-tooltip class="item" effect="dark" content="添加检查点" placement="right">
  86. <el-button type="primary" icon="el-icon-arrow-right" :disabled="leftMultiple" @click="add"
  87. style="margin-bottom: 10px;width: 80%"
  88. size="large"></el-button>
  89. </el-tooltip>
  90. <br>
  91. <el-tooltip class="item" effect="dark" content="移除检查点" placement="right">
  92. <el-button type="primary" icon="el-icon-arrow-left" :disabled="rightMultiple" @click="remove"
  93. style="margin-top: 10px;margin-bottom: 10px;width: 80%"
  94. size="large"></el-button>
  95. </el-tooltip>
  96. <br>
  97. <el-tooltip class="item" effect="dark" content="移除所有检查点" placement="right">
  98. <el-button type="primary" icon="el-icon-d-arrow-left" :disabled="rightAll" @click="removeAll"
  99. style="margin-top: 10px;width: 80%"
  100. size="large"></el-button>
  101. </el-tooltip>
  102. </el-col>
  103. <el-col :span="11" style="padding-left: 5px;text-align: center">
  104. <el-table :data="rightData" style="width: 100%" height="530px" border ref="rightData"
  105. @selection-change="saveRight">
  106. <el-table-column type="selection" align="center" fixed="left"></el-table-column>
  107. <!-- <el-table-column label="检测值" align="center" prop="testValue" v-if="!checkAgain" width="80"/>
  108. <el-table-column label="复测值" align="center" prop="testValue" v-else width="80"/>
  109. <el-table-column label="净检测值" align="center" prop="netTestValue" width="80"/>-->
  110. <el-table-column label="装置名称" align="center" prop="plantName" width="100"
  111. :show-overflow-tooltip="true"/>
  112. <el-table-column label="区域名称" align="center" prop="regionName" width="100"
  113. :show-overflow-tooltip="true"/>
  114. <el-table-column label="平台" align="center" prop="layer" width="100" :show-overflow-tooltip="true"/>
  115. <el-table-column label="设备/管线名称" align="center" prop="devName" width="130"
  116. :show-overflow-tooltip="true"/>
  117. <el-table-column label="设备/管线编号" align="center" prop="devCode" width="130"
  118. :show-overflow-tooltip="true"/>
  119. <el-table-column label="群组编码" align="center" prop="groupCode" width="100"
  120. :show-overflow-tooltip="true"/>
  121. <el-table-column label="密封点扩展号编码" align="center" prop="extendCode" width="150"
  122. :show-overflow-tooltip="true"/>
  123. <el-table-column label="密封点类型" align="center" prop="pointType" width="100"
  124. :show-overflow-tooltip="true"/>
  125. <!-- <el-table-column label="仪器编号" align="center" prop="inspectionCode" width="100"
  126. :show-overflow-tooltip="true"/>
  127. <el-table-column label="泄漏部位" align="center" prop="leakagePosition" width="100"
  128. :show-overflow-tooltip="true"/>
  129. <el-table-column label="校准人员" align="center" prop="checker" width="100" :show-overflow-tooltip="true"/>
  130. <el-table-column label="校准日期" align="center" prop="checkDate" width="100"
  131. :show-overflow-tooltip="true"/>
  132. <el-table-column label="泄漏程度" align="center" prop="leakageDegree" width="100"
  133. :show-overflow-tooltip="true"/>-->
  134. </el-table>
  135. <pagination
  136. v-show="rightTotal>0"
  137. :total="rightTotal"
  138. :page.sync="rightQueryParams.pageNum"
  139. :limit.sync="rightQueryParams.pageSize"
  140. @pagination="getRightList"
  141. />
  142. </el-col>
  143. </el-row>
  144. <div slot="footer" class="dialog-footer" style="text-align: center">
  145. <el-button @click="cancel">返回</el-button>
  146. </div>
  147. </el-dialog>
  148. </div>
  149. </template>
  150. <script>
  151. import {
  152. listCheckpoints, updateCheckpoints,
  153. } from "@/api/check/checkpoints";
  154. import {getAllPlantName} from "@/api/base/plant";
  155. import {listPoint} from "@/api/base/point";
  156. import {addCheckpoints, pointList, removeCheckPoints} from "@/api/task/plan";
  157. export default {
  158. name: "planPoint",
  159. data() {
  160. return {
  161. leftTotal: 0,
  162. rightTotal: 0,
  163. checkAgain: false,
  164. // 查询参数
  165. queryParams: {
  166. pageNum: 1,
  167. pageSize: 10,
  168. pointId: null,
  169. planId: null,
  170. inspectionId: null,
  171. testValue: null,
  172. netTestValue: null,
  173. plantId: null,
  174. plantName: null,
  175. regionId: null,
  176. regionName: null,
  177. layer: null,
  178. devId: null,
  179. devName: null,
  180. devCode: null,
  181. groupCode: null,
  182. extendCode: null,
  183. pointType: null,
  184. inspectionCode: null,
  185. leakagePosition: null,
  186. checker: null,
  187. checkId: null,
  188. checkDate: null,
  189. leakageDegree: null,
  190. remarks: null,
  191. approveStatus: null,
  192. approveTime: null,
  193. deptId: null,
  194. createrCode: null,
  195. createdate: null,
  196. updaterCode: null,
  197. updatedate: null,
  198. reqairId: null,
  199. },
  200. // 查询参数
  201. rightQueryParams: {
  202. pageNum: 1,
  203. pageSize: 10,
  204. pointId: null,
  205. planId: null,
  206. inspectionId: null,
  207. testValue: null,
  208. netTestValue: null,
  209. plantId: null,
  210. plantName: null,
  211. regionId: null,
  212. regionName: null,
  213. layer: null,
  214. devId: null,
  215. devName: null,
  216. devCode: null,
  217. groupCode: null,
  218. extendCode: null,
  219. pointType: null,
  220. inspectionCode: null,
  221. leakagePosition: null,
  222. checker: null,
  223. checkId: null,
  224. checkDate: null,
  225. leakageDegree: null,
  226. remarks: null,
  227. approveStatus: null,
  228. approveTime: null,
  229. deptId: null,
  230. createrCode: null,
  231. createdate: null,
  232. updaterCode: null,
  233. updatedate: null,
  234. choose: null,
  235. },
  236. row: {},
  237. rightData: [],
  238. leftData: [],
  239. right: [], //右边选中的数据
  240. left: [], //左边选中的数据
  241. leftMultiple: true,
  242. rightMultiple: true,
  243. leftAll: this.leftData == undefined || this.leftData == null || this.leftData.length <= 0,
  244. rightAll: this.rightData == undefined || this.rightData == null || this.rightData.length <= 0,
  245. dialog: {
  246. dialogFormVisible: false,
  247. },
  248. inspectionId: null,
  249. pointOptions: [],
  250. plantOperation: [],
  251. }
  252. },
  253. methods: {
  254. /** 重置按钮操作 */
  255. resetQuery() {
  256. this.resetForm("queryForm");
  257. this.handleQuery();
  258. },
  259. pointFormat(row, column) {
  260. return this.selectDictLabel(this.pointOptions, row.pointType);
  261. },
  262. handleQuery() {
  263. this.queryParams.pageNum = 1;
  264. this.getList();
  265. },
  266. cancel() {
  267. this.leftData = [];
  268. this.rightData = [];
  269. this.dialog.dialogFormVisible = false;
  270. },
  271. openDialog(row) {
  272. this.leftData = [];
  273. this.rightData = [];
  274. this.row = row;
  275. this.queryParams.plantId = row.plantId;
  276. this.dialog.dialogFormVisible = true;
  277. this.getList();
  278. this.getRightList();
  279. this.getDicts("point_type").then(response => {
  280. this.pointOptions = response.data;
  281. });
  282. getAllPlantName().then(response => {
  283. this.plantOperation = response.data;
  284. })
  285. },
  286. /** 查询检测点列表 */
  287. getList() {
  288. this.queryParams.approveStatus = 2;
  289. this.queryParams.planId = this.row.id;
  290. pointList(this.queryParams).then(response => {
  291. this.leftData = response.rows;
  292. this.leftTotal = response.total;
  293. this.leftAll = this.leftData == undefined || this.leftData == null || this.leftData.length <= 0;
  294. });
  295. },
  296. getRightList() {
  297. this.rightQueryParams.planId = this.row.id;
  298. listCheckpoints(this.rightQueryParams).then(response => {
  299. this.rightData = response.rows;
  300. this.rightTotal = response.total;
  301. this.rightAll = this.rightData == undefined || this.rightData == null || this.rightData.length <= 0;
  302. });
  303. },
  304. saveLeft(rows) {
  305. this.left = [];
  306. if (rows) {
  307. this.left = rows.map(row => row.pointId);
  308. this.leftMultiple = !rows.length;
  309. }
  310. },
  311. saveRight(rows) {
  312. this.right = [];
  313. if (rows) {
  314. this.right = rows.map(row => row.checkId);
  315. this.rightMultiple = !rows.length;
  316. }
  317. },
  318. // 左边表格选择项移到右边
  319. add() {
  320. let data = {};
  321. data.pointIds = this.left;
  322. data.plantName = this.row.plantName;
  323. data.id = this.row.id;
  324. data.plantId = this.row.plantId;
  325. addCheckpoints(data).then(()=>{
  326. this.getList();
  327. this.getRightList();
  328. })
  329. },
  330. // 右边表格选择项移到左边
  331. remove() {
  332. let data = {};
  333. data.checkIds = this.right;
  334. data.choose = 2;
  335. removeCheckPoints(data).then(()=>{
  336. this.getList();
  337. this.getRightList();
  338. })
  339. },
  340. removeAll() {
  341. if (this.rightData !== []) {
  342. let data = {};
  343. data.planId = this.row.id;
  344. data.choose = 4;
  345. removeCheckPoints(data).then(()=>{
  346. this.getList();
  347. this.getRightList();
  348. })
  349. }
  350. }
  351. }
  352. }
  353. </script>