index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698
  1. <template>
  2. <div>
  3. <div style="margin-top: 10px;">
  4. <el-row :gutter="20">
  5. <el-col :span="4">
  6. <el-card style="height: 100%; min-height: 100vh;">
  7. <span style="margin-left: 10px;margin-top: 10px;font-size: 20px;">生产工序配置</span>
  8. <el-button v-waves class="search-button" type="primary" icon="el-icon-thumb" @click="handleControls">操作</el-button>
  9. <br>
  10. <div style="marginTop:20px;margin-left: 10px;">
  11. <el-tree
  12. :data="processList"
  13. v-model="getProcessDetailsParm.parammaps.processId"
  14. :props="defaultProps"
  15. @node-click="handleNodeClick"
  16. :disabled="false"
  17. ></el-tree>
  18. </div>
  19. </el-card>
  20. </el-col>
  21. <el-col :span="18">
  22. <el-button v-if="this.pid != 0" v-waves class="search-button" type="primary" icon="el-icon-circle-plus-outline" @click="handleProcessRecordsAdd">新增</el-button>
  23. <el-table
  24. :key="tableKey"
  25. v-loading="listLoading"
  26. element-loading-text="给我一点时间"
  27. :data="list"
  28. border
  29. fit
  30. highlight-current-row
  31. style="width: 100%;margin-top: 20px;"
  32. :row-style="rowStyle"
  33. :cell-style="cellStyle"
  34. class="elTable table-fixed"
  35. :max-height="myHeight">
  36. <el-table-column label="序号" align="center" type="index" width="50px" prop="sort" />
  37. <el-table-column label="工序" align="center" prop="process" />
  38. <el-table-column label="备注" align="center" prop="remark" />
  39. <el-table-column label="操作" min-width="80px" header-align="center" align="center">
  40. <template slot-scope="scope">
  41. <el-button type="primary" size="mini" @click="handleProcessRecordsEdit(scope.row)">修改</el-button>
  42. <el-button type="primary" size="mini" @click="delProcessRecordsData(scope.row)">删除</el-button>
  43. </template>
  44. </el-table-column>
  45. </el-table>
  46. </el-col>
  47. </el-row>
  48. </el-row>
  49. </div>
  50. <el-dialog
  51. :title="dialogTitle"
  52. :visible.sync="dialogControls"
  53. :close-on-click-modal="false"
  54. @close="handleCancel"
  55. :width="800 + 'px'"
  56. :style="{ maxHeight: '100vh', overflowY: 'auto' }"
  57. >
  58. <el-row :gutter="20">
  59. <el-button style="margin-left: 10px;" v-waves class="search-button" type="primary" icon="el-icon-circle-plus-outline" @click="handleControlsAdd">新增</el-button>
  60. </el-row>
  61. <el-row :gutter="20">
  62. <el-table
  63. :data="processList"
  64. row-key="id"
  65. border
  66. style="width: 100%;margin-left: 10px;margin-top: 10px;"
  67. class="elTable"
  68. fit
  69. highlight-current-row
  70. :tree-props="{ children: 'children'}"
  71. >
  72. <el-table-column label="序号" align="center" type="index" width="50px">
  73. <template slot-scope="scope">
  74. {{ scope.row.number }}
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="生产名称" min-width="80px" header-align="center" align="center">
  78. <template slot-scope="scope">
  79. {{ scope.row.process }}
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="操作" min-width="80px" header-align="center" align="center">
  83. <template slot-scope="scope">
  84. <el-button type="primary" v-if="scope.row.pid != -1" size="mini" @click="handleEdit(scope.row)">修改</el-button>
  85. <el-button type="primary" v-if="scope.row.pid != -1" size="mini" @click="handleDel(scope.row)">删除</el-button>
  86. </template>
  87. </el-table-column>
  88. </el-table>
  89. </el-row>
  90. </el-dialog>
  91. <el-dialog
  92. :title="dialogTitle"
  93. :visible.sync="dialogControlsAdd"
  94. :close-on-click-modal="false"
  95. @close="handleCancelAdd"
  96. :width="600 + 'px'"
  97. :style="{ maxHeight: '100vh', overflowY: 'auto' }"
  98. >
  99. <el-form
  100. :rules="rulesAddManufacture"
  101. :inline="true"
  102. :model="addControlsParm"
  103. label-position="left"
  104. label-width="auto"
  105. style="width: 90%; margin: 0 auto 30px"
  106. >
  107. <el-row :gutter="24" style="display: flex; justify-content: center;">
  108. <el-form-item label="上级分类: " prop="pid">
  109. <tree-select
  110. v-model="addControlsParm.parammaps.pid"
  111. class="typeSelect"
  112. :height="300"
  113. :width="230"
  114. clearable
  115. :data="processList"
  116. :placeholder="placeholder"
  117. style="display: inline-block"
  118. :default-props="defaultProps"
  119. :node-key="nodeKey"
  120. :checked-keys="defaultCheckedKeys"
  121. @popoverHide="popoverHide"
  122. :disabled="false"
  123. />
  124. </el-form-item>
  125. </el-row>
  126. <el-row :gutter="24" style="display: flex; justify-content: center;">
  127. <el-form-item label="货品名称: " prop="process" >
  128. <el-input
  129. style="width: 254px;height: 40px;"
  130. v-model="addControlsParm.process"
  131. :disabled="false"
  132. />
  133. </el-form-item>
  134. </el-row>
  135. <el-row :gutter="24" style="display: flex; justify-content: center;margin-top: 20px;">
  136. <el-button type="primary" style="padding: 10px 20px;" size="mini" @click="handleControlsAddData">保存</el-button>
  137. <el-button type="primary" style="padding: 10px 20px;" size="mini" @click="handleCancelAdd">取消</el-button>
  138. </el-row>
  139. </el-form>
  140. </el-row>
  141. </el-dialog>
  142. <el-dialog
  143. :title="dialogTitle"
  144. :visible.sync="dialogControlsEdit"
  145. :close-on-click-modal="false"
  146. @close="handleCancelAdd"
  147. :width="600 + 'px'"
  148. :style="{ maxHeight: '100vh', overflowY: 'auto' }"
  149. >
  150. <el-form
  151. :rules="rulesEditManufacture"
  152. :inline="true"
  153. :model="editControlsParm"
  154. label-position="left"
  155. label-width="auto"
  156. style="width: 90%; margin: 0 auto 30px"
  157. >
  158. <el-row :gutter="24" style="display: flex; justify-content: center;">
  159. <el-form-item label="上级分类: " prop="pid">
  160. <tree-select
  161. v-model="editControlsParm.parammaps.pid"
  162. class="typeSelect"
  163. :height="300"
  164. :width="230"
  165. clearable
  166. :data="processList"
  167. :placeholder="placeholder"
  168. style="display: inline-block"
  169. :default-props="defaultProps"
  170. :node-key="nodeKey"
  171. :checked-keys="defaultCheckedKeys"
  172. @popoverHide="popoverHideEdit"
  173. :disabled="false"
  174. />
  175. </el-form-item>
  176. </el-row>
  177. <el-row :gutter="24" style="display: flex; justify-content: center;">
  178. <el-form-item label="货品名称: " prop="process" >
  179. <el-input
  180. style="width: 254px;height: 40px;"
  181. v-model="editControlsParm.process"
  182. :disabled="false"
  183. />
  184. </el-form-item>
  185. </el-row>
  186. <el-row :gutter="24" style="display: flex; justify-content: center;margin-top: 20px;">
  187. <el-button type="primary" style="padding: 10px 20px;" size="mini" @click="handleControlsEditData">保存</el-button>
  188. <el-button type="primary" style="padding: 10px 20px;" size="mini" @click="handleCancelAdd">取消</el-button>
  189. </el-row>
  190. </el-form>
  191. </el-row>
  192. </el-dialog>
  193. <el-dialog
  194. :title="dialogTitle"
  195. :visible.sync="dialogProcessRecords"
  196. :close-on-click-modal="false"
  197. @close="handleProcessRecordsCancelAdd"
  198. :width="600 + 'px'"
  199. :style="{ maxHeight: '100vh', overflowY: 'auto' }"
  200. >
  201. <el-form
  202. :rules="rulesProcessRecordsParm"
  203. :inline="true"
  204. :model="processRecordsParammapsParm"
  205. label-position="left"
  206. label-width="auto"
  207. style="width: 90%; margin: 0 auto 30px"
  208. >
  209. <el-row :gutter="24" style="display: flex; justify-content: center;">
  210. <el-form-item label="序号: " prop="sort" >
  211. <el-input
  212. style="width: 254px;height: 40px;"
  213. v-model="processRecordsParammapsParm.sort"
  214. :disabled="false"
  215. />
  216. </el-form-item>
  217. </el-row>
  218. <el-row :gutter="24" style="display: flex; justify-content: center;">
  219. <el-form-item label="工序: " prop="process" >
  220. <el-input
  221. style="width: 254px;height: 40px;"
  222. v-model="processRecordsParammapsParm.process"
  223. :disabled="false"
  224. />
  225. </el-form-item>
  226. </el-row>
  227. <el-row :gutter="24" style="display: flex; justify-content: center;">
  228. <el-form-item label="备注: " prop="remark" >
  229. <el-input
  230. style="width: 254px;height: 40px;"
  231. v-model="processRecordsParammapsParm.remark"
  232. :disabled="false"
  233. />
  234. </el-form-item>
  235. </el-row>
  236. <el-row :gutter="24" style="display: flex; justify-content: flex-end; margin-top: 20px;">
  237. <el-button type="primary" class="add-button" style="padding: 10px 20px;" size="mini" @click="handleProcessRecordsAddData">保存并新增</el-button>
  238. <el-button type="primary" class="add-button" style="padding: 10px 20px;" size="mini" @click="handleProcessRecordsAddCancelData">保存并关闭</el-button>
  239. <el-button type="primary" class="add-button" style="padding: 10px 20px;" size="mini" @click="handleProcessRecordsCancelAdd">取消</el-button>
  240. </el-row>
  241. </el-form>
  242. </el-dialog>
  243. <el-dialog
  244. :title="dialogTitle"
  245. :visible.sync="dialogProcessRecords"
  246. :close-on-click-modal="false"
  247. @close="handleProcessRecordsCancelAdd"
  248. :width="600 + 'px'"
  249. :style="{ maxHeight: '100vh', overflowY: 'auto' }"
  250. >
  251. <el-form
  252. :rules="rulesProcessRecordsParm"
  253. :inline="true"
  254. :model="processRecordsParammapsParm"
  255. label-position="left"
  256. label-width="auto"
  257. style="width: 90%; margin: 0 auto 30px"
  258. >
  259. <el-row :gutter="24" style="display: flex; justify-content: center;">
  260. <el-form-item label="序号: " prop="sort" >
  261. <el-input
  262. style="width: 254px;height: 40px;"
  263. v-model="processRecordsParammapsParm.sort"
  264. :disabled="false"
  265. clearable
  266. />
  267. </el-form-item>
  268. </el-row>
  269. <el-row :gutter="24" style="display: flex; justify-content: center;">
  270. <el-form-item label="工序: " prop="process" >
  271. <el-input
  272. style="width: 254px;height: 40px;"
  273. v-model="processRecordsParammapsParm.process"
  274. :disabled="false"
  275. clearable
  276. />
  277. </el-form-item>
  278. </el-row>
  279. <el-row :gutter="24" style="display: flex; justify-content: center;">
  280. <el-form-item label="备注: " prop="remark" >
  281. <el-input
  282. style="width: 254px;height: 40px;"
  283. v-model="processRecordsParammapsParm.remark"
  284. :disabled="false"
  285. clearable
  286. />
  287. </el-form-item>
  288. </el-row>
  289. <el-row :gutter="24" style="display: flex; justify-content: flex-end; margin-top: 20px;">
  290. <el-button type="primary" v-if="!this.dialogProcessRecordsEdit" class="add-button" style="padding: 10px 20px;" size="mini" @click="handleProcessRecordsAddData">保存并新增</el-button>
  291. <el-button type="primary" v-if="dialogProcessRecordsEdit" class="add-button" style="padding: 10px 20px;" size="mini" @click="handleProcessRecordsEditCancelData">保存并关闭</el-button>
  292. <el-button type="primary" v-if="!dialogProcessRecordsEdit" class="add-button" style="padding: 10px 20px;" size="mini" @click="handleProcessRecordsAddCancelData">保存并关闭</el-button>
  293. <el-button type="primary" class="add-button" style="padding: 10px 20px;" size="mini" @click="handleProcessRecordsCancelAdd">取消</el-button>
  294. </el-row>
  295. </el-form>
  296. </el-dialog>
  297. </div>
  298. </template>
  299. <script>
  300. import 'element-ui/lib/theme-chalk/index.css';
  301. import Cookies from 'js-cookie';
  302. import {
  303. GetDataByName,
  304. postJson,
  305. GetDataByNames,
  306. partslistSGv2,
  307. PostDataByName,
  308. ExecDataByConfig,
  309. GetAccount, transData
  310. } from '@/api/common';
  311. import Pagination from '@/components/Pagination';
  312. import { MessageBox } from 'element-ui';
  313. import waves from '@/directive/waves'; // waves directive
  314. import TreeSelect from '@/components/TreeSelect'; // 确保路径正确
  315. export default {
  316. components: { Pagination ,TreeSelect},
  317. directives: { waves },
  318. inject: ['reload'],
  319. data() {
  320. return {
  321. list:[],
  322. processList :[],
  323. pid :0,
  324. listLoading: false,
  325. tableKey: 0,
  326. nodeKey: 'id',
  327. placeholder: '请选择上级分类',
  328. myHeight: document.documentElement.clientHeight - 85 - 250,
  329. defaultCheckedKeys: [], // 默认选中 的节点
  330. getProcessParm:{name:'getProcess'},
  331. getProcessDetailsParm:{name:'getProcess',parammaps:{}},
  332. dialogTitle :'',
  333. dialogProcessRecords :false,//工序新增
  334. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  335. cellStyle: { padding: 0 + 'px' },
  336. dialogProcessRecordsEdit:false,
  337. dialogControls:false, //操作弹窗
  338. dialogControlsEdit:false, //编辑
  339. dialogControlsAdd:false, //操作弹窗
  340. addControlsParm:{name:'addProcess',parammaps:{}},
  341. delControlsParm:{name:'delProcess',parammaps:{}},
  342. editControlsParm:{name:'editProcess',parammaps:{},process:''},
  343. addProcessRecordsParm:{name:'addProcessRecords',parammaps:{ process: '', sort: '',remarks: ''}},
  344. processRecordsParammapsParm :{process: '', sort: '',remark: ''},
  345. getProcessRecordsParm:{name:'getProcessRecords',parammaps:{ pid:''}},
  346. delProcessRecordsParm:{name:'delProcessRecords',parammaps:{ id:''}},
  347. editProcessRecordsParm:{name:'editProcessRecords',parammaps:{}},
  348. defaultProps: {
  349. children: 'children',
  350. label: 'process'
  351. },
  352. rules:[],
  353. rulesAddManufacture : {
  354. process: [
  355. { required: true, message: '货品不能为空', trigger: 'blur' },
  356. ]
  357. },
  358. rulesEditManufacture: {
  359. process: [
  360. { required: true, message: '货品不能为空', trigger: 'blur' },
  361. ]
  362. },
  363. rulesProcessRecordsParm: {
  364. process: [
  365. { required: true, message: '工序不能为空', trigger: 'blur' },
  366. ],
  367. sort: [
  368. { required: true, message: '序号不能为空', trigger: 'blur' },
  369. ]
  370. },
  371. };
  372. },
  373. methods: {
  374. delProcessRecordsData(row){
  375. MessageBox.confirm('名称:' + row.process, '确认删除?', {
  376. confirmButtonText: '确认',
  377. cancelButtonText: '取消',
  378. type: 'warning',
  379. }).then(() => {
  380. this.delProcessRecordsParm.parammaps.id = row.id ;
  381. PostDataByName(this.delProcessRecordsParm).then(response => {
  382. if (response.msg !== 'fail') {
  383. this.dialogProcessRecords = false;
  384. this.dialogTitle = '';
  385. this.get_process_records();
  386. this.$notify({
  387. title: '成功',
  388. message: '删除成功',
  389. type: 'success',
  390. duration: 2000,
  391. });
  392. } else {
  393. failproccess(response, this.$notify);
  394. }
  395. });
  396. });
  397. },
  398. handleProcessRecordsEditCancelData(){
  399. this.processRecordsParammapsParm.pid = this.pid;
  400. this.editProcessRecordsParm.parammaps = this.processRecordsParammapsParm;
  401. PostDataByName(this.editProcessRecordsParm).then(response => {
  402. if (response.msg !== 'fail') {
  403. this.dialogProcessRecords = false;
  404. this.dialogTitle = '';
  405. this.get_process_records();
  406. this.$notify({
  407. title: '成功',
  408. message: '修改成功',
  409. type: 'success',
  410. duration: 2000,
  411. });
  412. } else {
  413. failproccess(response, this.$notify);
  414. }
  415. });
  416. },
  417. handleProcessRecordsAddCancelData(){
  418. this.processRecordsParammapsParm.pid = this.pid;
  419. this.addProcessRecordsParm.parammaps = this.processRecordsParammapsParm;
  420. PostDataByName(this.addProcessRecordsParm).then(response => {
  421. if (response.msg !== 'fail') {
  422. this.dialogProcessRecords = false;
  423. this.dialogTitle = '';
  424. this.get_process_records()
  425. this.$notify({
  426. title: '成功',
  427. message: '新增成功',
  428. type: 'success',
  429. duration: 2000,
  430. });
  431. } else {
  432. failproccess(response, this.$notify);
  433. }
  434. });
  435. },
  436. handleProcessRecordsAddData(){
  437. this.processRecordsParammapsParm.pid = this.pid;
  438. this.addProcessRecordsParm.parammaps = this.processRecordsParammapsParm;
  439. PostDataByName(this.addProcessRecordsParm).then(response => {
  440. if (response.msg !== 'fail') {
  441. // this.dialogControlsEdit = false;
  442. // this.dialogTitle = '';
  443. // this.get_process_data();
  444. this.processRecordsParammapsParm = {process: '', sort: '',remark: ''}
  445. this.get_process_records()
  446. this.$notify({
  447. title: '成功',
  448. message: '新增成功',
  449. type: 'success',
  450. duration: 2000,
  451. });
  452. } else {
  453. failproccess(response, this.$notify);
  454. }
  455. });
  456. },
  457. handleProcessRecordsAdd(){
  458. this.dialogProcessRecords = true;
  459. this.dialogTitle = '新增工序';
  460. },
  461. handleProcessRecordsCancelAdd(){
  462. this.dialogProcessRecords = false;
  463. this.dialogTitle = '';
  464. this.processRecordsParammapsParm = {process: '', sort: '',remark: ''};
  465. this.dialogProcessRecordsEdit = false;
  466. },
  467. handleProcessRecordsEdit(row){
  468. this.processRecordsParammapsParm.id = row.id;
  469. this.dialogProcessRecords = true;
  470. this.dialogTitle = '编辑';
  471. this.dialogProcessRecordsEdit = true;
  472. this.processRecordsParammapsParm.process = row.process;
  473. this.processRecordsParammapsParm.sort = row.sort;
  474. this.processRecordsParammapsParm.remark = row.remark;
  475. },
  476. handleControlsEditData(){
  477. this.editControlsParm.parammaps.process = this.editControlsParm.process;
  478. PostDataByName(this.editControlsParm).then(response => {
  479. if (response.msg !== 'fail') {
  480. this.dialogControlsEdit = false;
  481. this.dialogTitle = '';
  482. this.get_process_data();
  483. this.$notify({
  484. title: '成功',
  485. message: '保存成功',
  486. type: 'success',
  487. duration: 2000,
  488. });
  489. } else {
  490. failproccess(response, this.$notify);
  491. }
  492. });
  493. },
  494. handleEdit(row){
  495. this.dialogControlsEdit = true;
  496. this.dialogTitle = '编辑生产名称';
  497. this.editControlsParm.parammaps.id = row.id ;
  498. // this.editControlsParm.parammaps.process = row.process;
  499. this.editControlsParm.parammaps.pid = row.pid;
  500. this.editControlsParm.process= row.process;
  501. this.defaultCheckedKeys = [row.pid];
  502. },
  503. handleDel(row){
  504. MessageBox.confirm('名称:' + row.process, '确认删除?', {
  505. confirmButtonText: '确认',
  506. cancelButtonText: '取消',
  507. type: 'warning',
  508. }).then(() => {
  509. console.log(row);
  510. this.delControlsParm.parammaps.id = row.id;
  511. PostDataByName(this.delControlsParm).then(response => {
  512. if (response.msg !== 'fail') {
  513. this.get_process_data();
  514. this.$notify({
  515. title: '成功',
  516. message: '删除成功',
  517. type: 'success',
  518. duration: 2000,
  519. });
  520. } else {
  521. failproccess(response, this.$notify);
  522. }
  523. });
  524. });
  525. },
  526. popoverHide(checkedIds,checkedData) {
  527. if (checkedIds !== null) {
  528. this.addControlsParm.parammaps.pid = checkedData.id
  529. } else {
  530. this.addControlsParm.parammaps.pid ='';
  531. }
  532. },
  533. popoverHideEdit(checkedIds,checkedData) {
  534. if (checkedIds !== null) {
  535. this.editControlsParm.parammaps.pid = checkedData.id
  536. } else {
  537. this.editControlsParm.parammaps.pid ='';
  538. }
  539. },
  540. handleCancelAdd(){
  541. this.dialogControlsAdd = false;
  542. this.dialogTitle = '';
  543. this.dialogControlsEdit = false;
  544. this.addControlsParm = {name:'addProcess',parammaps:{}};
  545. },
  546. handleControlsAdd(){
  547. this.dialogControlsAdd = true;
  548. this.defaultCheckedKeys = []
  549. this.addControlsParm = {name:'addProcess',parammaps:{}};
  550. this.dialogTitle = '添加生产名称'
  551. },
  552. handleControlsAddData(){
  553. this.addControlsParm.parammaps.process = this.addControlsParm.process;
  554. PostDataByName(this.addControlsParm).then(response => {
  555. if (response.msg !== 'fail') {
  556. this.dialogControlsAdd = false;
  557. this.dialogTitle = '';
  558. this.get_process_data();
  559. this.addControlsParm = {name:'addProcess',parammaps:{}};
  560. this.$notify({
  561. title: '成功',
  562. message: '保存成功',
  563. type: 'success',
  564. duration: 2000,
  565. });
  566. } else {
  567. failproccess(response, this.$notify);
  568. }
  569. });
  570. },
  571. handleControls(){
  572. this.dialogControls = true;
  573. },
  574. handleCancel(){
  575. this.dialogControls = false;
  576. this.dialogTitle = '';
  577. },
  578. handleNodeClick(data,node){
  579. this.list = [];
  580. if (node.isLeaf) {
  581. this.pid = data.id;
  582. this.get_process_records()
  583. }
  584. },
  585. get_process_records(){
  586. this.getProcessRecordsParm.parammaps.pid = this.pid;
  587. GetDataByName(this.getProcessRecordsParm).then((response) => {
  588. if (response.data && response.data.list) {
  589. this.list = response.data.list;
  590. this.listLoading = false;
  591. }else{
  592. this.list = [];
  593. this.listLoading = false;
  594. }
  595. });
  596. },
  597. get_process_data() {
  598. GetDataByName(this.getProcessParm).then((response) => {
  599. if (response.data && response.data.list) {
  600. this.processList = transData( response.data.list, 'id', 'pid', 'children');
  601. for (let index = 0; index < this.processList.length; index++) {
  602. this.processList[index].number = index+1;
  603. }
  604. }else{
  605. this.processList = [];
  606. this.listLoading = false;
  607. }
  608. });
  609. },
  610. },
  611. created() {
  612. this.get_process_data()
  613. },
  614. };
  615. </script>
  616. <style>
  617. .el-input--small .el-input__inner {
  618. height: 40px; /* 调整输入框高度 */
  619. line-height: 40px;
  620. }
  621. .add-button {
  622. background-color: #2196f3; /* 绿色背景 */
  623. color: white; /* 白色文字 */
  624. border-radius: 5px; /* 圆角 */
  625. cursor: pointer; /* 鼠标悬停时显示手型 */
  626. font-size: 16px; /* 字体大小 */
  627. transition: background-color 0.3s ease; /* 背景颜色过渡效果 */
  628. border: 0.01px solid #ccc; /* 黑色边框,宽度为 2px */
  629. }
  630. .el-card {
  631. height: 100%;
  632. display: flex;
  633. flex-direction: column;
  634. }
  635. </style>