plm前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1753 lines
59 KiB

2 years ago
2 years ago
  1. <template>
  2. <div class="mod-config">
  3. <!-- 查询条件 -->
  4. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
  5. <el-form-item :label="'流程名称'">
  6. <el-input v-model="searchData.workflowId" clearable style="width: 160px"></el-input>
  7. </el-form-item>
  8. <el-form-item :label="'菜单名称'">
  9. <el-input v-model="searchData.name" clearable style="width: 160px"></el-input>
  10. </el-form-item>
  11. <el-form-item :label="'状态'">
  12. <el-select clearable v-model="searchData.status" style="width: 120px">
  13. <el-option label="启用" value="Y"></el-option>
  14. <el-option label="停用" value="N"></el-option>
  15. </el-select>
  16. </el-form-item>
  17. <el-form-item :label="' '">
  18. <el-button @click="getDataList()">查询</el-button>
  19. <el-button type="primary" @click="addModal()">新增</el-button>
  20. <el-button type="primary" @click="delModal()">删除</el-button>
  21. <download-excel
  22. :fields="fields()"
  23. :data="exportData"
  24. type="xls"
  25. :name="exportName"
  26. :header="exportHeader"
  27. :footer="exportFooter"
  28. :fetch="createExportData"
  29. :before-generate="startDownload"
  30. :before-finish="finishDownload"
  31. worksheet="导出信息"
  32. class="el-button el-button--primary el-button--medium">
  33. {{ "导出" }}
  34. </download-excel>
  35. </el-form-item>
  36. </el-form>
  37. <!-- 列表 -->
  38. <el-table
  39. :height="height"
  40. :data="dataList"
  41. border
  42. ref="requestTable"
  43. :row-style="rowStyle"
  44. @row-click="requestClickRow"
  45. @selection-change="selectionRequest"
  46. @current-change="changeCurrentRow"
  47. style="width: 100%;">
  48. <el-table-column
  49. type="selection"
  50. header-align="center"
  51. align="center"
  52. :selectable="selectFlag"
  53. width="50">
  54. </el-table-column>
  55. <el-table-column
  56. v-for="(item,index) in columnList" :key="index"
  57. :sortable="item.columnSortable"
  58. :prop="item.columnProp"
  59. :header-align="item.headerAlign"
  60. :show-overflow-tooltip="item.showOverflowTooltip"
  61. :align="item.align"
  62. :fixed="item.fixed === ''?false:item.fixed"
  63. :min-width="item.columnWidth"
  64. :label="item.columnLabel">
  65. <template slot-scope="scope">
  66. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  67. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  68. </template>
  69. </el-table-column>
  70. <el-table-column
  71. fixed="right"
  72. header-align="center"
  73. align="center"
  74. width="100"
  75. label="操作">
  76. <template slot-scope="scope">
  77. <el-link style="cursor: pointer" @click="updateModal(scope.row)">编辑</el-link>
  78. </template>
  79. </el-table-column>
  80. </el-table>
  81. <selectDiv ref="selectDiv"></selectDiv>
  82. <!-- 分页插件 -->
  83. <el-pagination style="margin-top: 0px"
  84. @size-change="sizeChangeHandle"
  85. @current-change="currentChangeHandle"
  86. :current-page="pageIndex"
  87. :page-sizes="[20, 50, 100, 200, 500]"
  88. :page-size="pageSize"
  89. :total="totalPage"
  90. layout="total, sizes, prev, pager, next, jumper">
  91. </el-pagination>
  92. <!-- 流程维护模态框 -->
  93. <el-dialog title="流程维护" top="29vh" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="510px">
  94. <!-- <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  95. <el-form-item label="分类编码" prop="classificationNo">
  96. <el-input v-model="modalData.classificationNo" clearable style="width: 120px" disabled></el-input>
  97. </el-form-item>
  98. <el-form-item label="分类名称" prop="classificationName" :rules="rules.classificationName" style="margin-left: -10px">
  99. <el-input v-model="modalData.classificationName" clearable style="width: 330px"></el-input>
  100. </el-form-item>
  101. </el-form>-->
  102. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  103. <el-form-item prop="workflowId" :rules="rules.workflowId">
  104. <span style="cursor: pointer" v-if="modalData.flag === '1'" slot="label" @click="getBaseList(1015)"><a herf="#">流程ID</a></span>
  105. <span style="cursor: pointer" v-else slot="label" >流程ID</span>
  106. <el-input v-model="modalData.workflowId" @blur="workflowBlur(1015)" style="width: 120px" :disabled="maintenanceFlag"></el-input>
  107. </el-form-item>
  108. <el-form-item label="流程名称" style="margin-left: -10px">
  109. <el-input v-model="modalData.workflowname" clearable style="width: 330px" disabled></el-input>
  110. </el-form-item>
  111. </el-form>
  112. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  113. <el-form-item prop="menuId" :rules="rules.menuId">
  114. <span style="cursor: pointer" slot="label" v-if="modalData.flag==='1'" @click="getBaseList(1014)"><a herf="#">菜单ID</a></span>
  115. <span style="cursor: pointer" slot="label" v-else >菜单ID</span>
  116. <el-input v-model="modalData.menuId" @blur="menuBlur(1014)" style="width: 120px" :disabled="maintenanceFlag"></el-input>
  117. </el-form-item>
  118. <el-form-item label="菜单名称" style="margin-left: -10px">
  119. <el-input v-model="modalData.name" clearable style="width: 330px" disabled></el-input>
  120. </el-form-item>
  121. </el-form>
  122. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  123. <el-form-item label="状态" prop="status" :rules="rules.status">
  124. <dict-data-select v-model="modalData.status" clearable dict-type="sys_status"
  125. :use-default-value="false" style="width: 120px"></dict-data-select>
  126. </el-form-item>
  127. <el-form-item style="margin-left: -10px;">
  128. <span style="cursor: pointer" slot="label" >备注</span>
  129. <el-input v-model="modalData.remark" style="width: 330px"></el-input>
  130. </el-form-item>
  131. </el-form>
  132. <el-footer style="height:35px;margin-top: 25px;text-align:center">
  133. <el-button type="primary" @click="saveData()">保存</el-button>
  134. <el-button type="primary" @click="modalFlag = false">关闭</el-button>
  135. </el-footer>
  136. </el-dialog>
  137. <!-- 页签 -->
  138. <el-tabs v-model="activeTable" style="width: 100%" :style="{height: this.secondHeight + 'px'}" type="border-card" @tab-click="tabClick" class="customer-tab">
  139. <!-- 流程节点页签 -->
  140. <el-tab-pane label="流程节点" name="node_item">
  141. <!-- <el-form label-position="top" style="margin-top: 2px; margin-left: 2px;">
  142. <el-button type="primary" @click="addOrDelItem">新增</el-button>
  143. <el-button type="primary" @click="updateItemValue">编辑</el-button>
  144. </el-form>-->
  145. <el-table
  146. :data="nodeList"
  147. :height="secondHeight - 60"
  148. border
  149. style="width: 100%;">
  150. <el-table-column
  151. v-for="(item,index) in columnNodeList" :key="index"
  152. :sortable="item.columnSortable"
  153. :prop="item.columnProp"
  154. :header-align="item.headerAlign"
  155. :show-overflow-tooltip="item.showOverflowTooltip"
  156. :align="item.align"
  157. :fixed="item.fixed==''?false:item.fixed"
  158. :min-width="item.columnWidth"
  159. :label="item.columnLabel">
  160. <template slot-scope="scope">
  161. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  162. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  163. </template>
  164. </el-table-column>
  165. <el-table-column
  166. fixed="right"
  167. header-align="center"
  168. align="center"
  169. width="160"
  170. label="操作">
  171. <template slot-scope="scope">
  172. <el-link style="cursor: pointer" @click="editNodeModal(scope.row)">编辑</el-link>
  173. <el-link style="cursor: pointer" @click="subDetailModal(scope.row)">出口配置</el-link>
  174. <el-link style="cursor: pointer" @click="authorityModal(scope.row)">权限配置</el-link>
  175. </template>
  176. </el-table-column>
  177. </el-table>
  178. </el-tab-pane>
  179. </el-tabs>
  180. <el-dialog title="出口配置" :close-on-click-modal="false" v-drag :visible.sync="subDetailFlag" width="1021px">
  181. <el-form :inline="true" label-position="top" :model="nodeCurrentRow" style="margin-top: -5px;">
  182. <el-form-item label="流程名称" style="">
  183. <el-input v-model="nodeCurrentRow.workflowname" clearable style="width: 210px" readonly></el-input>
  184. </el-form-item>
  185. <el-form-item label="节点名称" style="margin-left: -5px">
  186. <el-input v-model="nodeCurrentRow.nodeName" clearable style="width: 210px" readonly></el-input>
  187. </el-form-item>
  188. </el-form>
  189. <el-button type="success" icon="el-icon-plus" size="mini" @click="handleAddBtn()">添加</el-button>
  190. <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteBtn()">删除</el-button>
  191. <div class="rq ">
  192. <el-table
  193. :height="400"
  194. :data="tableData"
  195. border
  196. :row-class-name="rowClassName"
  197. @selection-change="handleDetailSelectionChange"
  198. style="width: 100%;">
  199. <el-table-column type="selection" align="center" width="50"></el-table-column>
  200. <el-table-column label="序号" align="center" prop="xh" width="50"></el-table-column>
  201. <el-table-column prop="plmTable" header-align="center" align="center" :required="true" label="PLM数据表" width="240">
  202. <template slot-scope="{row}">
  203. <el-select :ref="`${row.xh-1}` + `a`" v-model="tableData[row.xh-1].plmTable" placeholder="请选择数据表名" style="width: 220px">
  204. <el-option
  205. v-for = "i in tableList"
  206. :key = "i.tableId"
  207. :label = "i.tableId"
  208. :value = "i.tableId">
  209. </el-option>
  210. </el-select>
  211. </template>
  212. </el-table-column>
  213. <el-table-column prop="plmTable" header-align="center" align="center" :required="true" label="PLM字段名" width="220">
  214. <template slot-scope="{row}">
  215. <el-select :ref="`${row.xh-1}` + `a`" @focus="tableChange(row.xh-1)" v-model="tableData[row.xh-1].plmField" placeholder="请选择PLM字段名" style="width: 200px">
  216. <el-option
  217. v-for = "i in fieldList"
  218. :key = "i.fieldId"
  219. :label = "i.fieldName"
  220. :value = "i.fieldId">
  221. </el-option>
  222. </el-select>
  223. </template>
  224. </el-table-column>
  225. <!-- <el-table-column prop="plmField" header-align="center" align="center" :required="true" label="PLM字段名" width="150">-->
  226. <!-- <template slot-scope="{row}">-->
  227. <!-- <el-input :ref="`${row.xh-1}` + `b`" v-model="tableData[row.xh-1].plmField" placeholder="请输入PLM字段名"></el-input>-->
  228. <!-- </template>-->
  229. <!-- </el-table-column>-->
  230. <el-table-column prop="oaField" header-align="center" align="center" :required="true" label="OA字段名" width="150">
  231. <template slot-scope="{row}">
  232. <el-input :ref="`${row.xh-1}` + `c`" v-model="tableData[row.xh-1].oaField" placeholder="请输入OA字段名"></el-input>
  233. </template>
  234. </el-table-column>
  235. <el-table-column prop="plmTable" header-align="center" align="center" :required="true" label="PLM字段类型" width="150">
  236. <template slot-scope="{row}">
  237. <el-select :ref="`${row.xh-1}` + `a`" v-model="tableData[row.xh-1].fieldType" placeholder="请选择字段类型" style="width: 130px">
  238. <el-option label="人员参数" value="A"></el-option>
  239. <el-option label="金额参数" value="C"></el-option>
  240. <el-option label="其他参数" value="B"></el-option>
  241. </el-select>
  242. </template>
  243. </el-table-column>
  244. <el-table-column prop="fieldValue" header-align="center" align="center" :required="true" label="默认值" width="200">
  245. <template slot-scope="{row}">
  246. <el-input :ref="`${row.xh-1}` + `d`" v-model="tableData[row.xh-1].fieldValue" placeholder="请输入默认值"></el-input>
  247. </template>
  248. </el-table-column>
  249. <el-table-column prop="fieldDesc" header-align="center" align="center" :required="true" label="字段描述" width="200">
  250. <template slot-scope="{row}">
  251. <el-input :ref="`${row.xh-1}` + `e`" v-model="tableData[row.xh-1].fieldDesc" placeholder="请输入字段描述"></el-input>
  252. </template>
  253. </el-table-column>
  254. <el-table-column prop="remark" header-align="center" align="center" :required="true" label="备注" width="200">
  255. <template slot-scope="{row}">
  256. <el-input :ref="`${row.xh-1}` + `f`" v-model="tableData[row.xh-1].remark" placeholder="请输入备注"></el-input>
  257. </template>
  258. </el-table-column>
  259. </el-table>
  260. </div>
  261. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  262. <el-button type="primary" @click="checkDataBySubDetail">保存</el-button>
  263. <el-button type="primary" @click="subDetailFlag = false">关闭</el-button>
  264. </el-footer>
  265. </el-dialog>
  266. <el-dialog width="730px" title="权限" :close-on-click-modal="false" :visible.sync="authorityFlag">
  267. <el-select v-model="authorityData.tableId" placeholder="请选择数据表名" @change="tableChange3" style="width: 220px">
  268. <el-option
  269. v-for = "i in tableList"
  270. :key = "i.tableId"
  271. :label = "i.tableId"
  272. :value = "i.tableId">
  273. </el-option>
  274. </el-select>
  275. <el-table
  276. :data="authorityData.fieldList"
  277. border
  278. :height="300"
  279. ref="authorityTable"
  280. @row-click="authorityClickRow"
  281. @selection-change="selectionAuthority"
  282. style="width: 100%;">
  283. <el-table-column
  284. type="selection"
  285. header-align="center"
  286. align="center"
  287. width="50">
  288. </el-table-column>
  289. <el-table-column
  290. prop="fieldId"
  291. header-align="center"
  292. align="center"
  293. min-width="200"
  294. label="字段编码">
  295. </el-table-column>
  296. <el-table-column
  297. prop="fieldName"
  298. header-align="center"
  299. align="center"
  300. min-width="200"
  301. label="字段描述">
  302. </el-table-column>
  303. <el-table-column
  304. header-align="center"
  305. align="center"
  306. min-width="50"
  307. label="必填">
  308. <template slot-scope="{row}">
  309. <el-checkbox v-model="row.required" :disabled="!authoritySelections.includes(row)" true-label="Y" false-label="N"></el-checkbox>
  310. </template>
  311. </el-table-column>
  312. </el-table>
  313. <span slot="footer" class="dialog-footer">
  314. <div style="margin-top: 5px">
  315. <el-button type="primary" @click="saveAuthorityList">应用</el-button>
  316. <el-button type="primary" @click="authorityFlag = false">关闭</el-button>
  317. </div>
  318. </span>
  319. </el-dialog>
  320. <!-- 流程维护模态框 -->
  321. <el-dialog title="流程节点" top="29vh" :close-on-click-modal="false" v-drag :visible.sync="nodeModalFlag" width="502px">
  322. <el-form :inline="true" label-position="top" :model="nodeInfo" style="margin-left: 7px;margin-top: -5px;">
  323. <el-form-item label="分类编码">
  324. <el-input v-model="nodeInfo.classificationNo" :disabled="nodeModalDisableFlag" style="width: 150px"></el-input>
  325. </el-form-item>
  326. <el-form-item label="节点顺序">
  327. <el-input v-model="nodeInfo.seqNo" :disabled="nodeModalDisableFlag" style="width: 142px"></el-input>
  328. </el-form-item>
  329. <el-form-item label="是否可驳回">
  330. <el-select v-model="nodeInfo.isReject" style="width: 142px">
  331. <el-option label="是" value="Y"></el-option>
  332. <el-option label="否" value="N"></el-option>
  333. </el-select>
  334. </el-form-item>
  335. </el-form>
  336. <el-form :inline="true" label-position="top" :model="nodeInfo" style="margin-left: 7px;margin-top: -5px;">
  337. <el-form-item label="流程ID">
  338. <el-input v-model="nodeInfo.workflowId" :disabled="nodeModalDisableFlag" style="width: 150px"></el-input>
  339. </el-form-item>
  340. <el-form-item label="流程名称">
  341. <el-input v-model="nodeInfo.workflowname" :disabled="nodeModalDisableFlag" style="width: 300px"></el-input>
  342. </el-form-item>
  343. </el-form>
  344. <el-form :inline="true" label-position="top" :model="nodeInfo" style="margin-left: 7px;margin-top: -5px;">
  345. <el-form-item label="节点ID">
  346. <el-input v-model="nodeInfo.nodeId" :disabled="nodeModalDisableFlag" style="width: 150px"></el-input>
  347. </el-form-item>
  348. <el-form-item label="节点名称">
  349. <el-input v-model="nodeInfo.nodeName" :disabled="nodeModalDisableFlag" style="width: 300px"></el-input>
  350. </el-form-item>
  351. </el-form>
  352. <el-footer style="height:35px;margin-top: 25px;text-align:center">
  353. <el-button type="primary" @click="editNodeInfo">保存</el-button>
  354. <el-button type="primary" @click="nodeModalFlag = false">关闭</el-button>
  355. </el-footer>
  356. </el-dialog>
  357. <!-- chooseList模态框 -->
  358. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  359. </div>
  360. </template>
  361. <script>
  362. import {
  363. getRequestMainData, // 查询流程绑定主表信息
  364. saveRequestHeader, // 新增流程绑定信息
  365. updateRequestHeader, // 修改流程绑定信息
  366. getNodeInfoByWorkflow,//获取流程节点信息
  367. deleteRequestHeader,//删除流程绑定信息
  368. getNodeDetail,//获取流程节点出口配置
  369. saveRequestNodeDetail,//保存流程节点出口配置
  370. deleteRequestNodeDetailByLine,//删除流程当前节点的全部出口配置
  371. getTableList, // 获取table列表
  372. getFieldList, // 获取表字段
  373. getAuthorityFieldList, // 获取权限字段集合
  374. saveAuthorityList, // 保存节点权限
  375. editNodeInfo, // 修改节点
  376. } from '@/api/processManagement/processManagement.js'
  377. import {getChooselistData, verifyData} from "@/api/chooselist/chooselist.js"
  378. import Chooselist from '@/views/modules/common/Chooselist'
  379. import DictDataSelect from '../sys/dict-data-select.vue'
  380. export default {
  381. components: {
  382. DictDataSelect,
  383. Chooselist
  384. },
  385. watch: {
  386. searchData: {
  387. deep: true,
  388. handler: function (newV, oldV) {
  389. this.searchData.workflowname = this.searchData.workflowname.toUpperCase()
  390. }
  391. }
  392. },
  393. data () {
  394. return {
  395. // 导出
  396. exportData: [],
  397. exportName: '流程绑定信息' + this.dayjs().format('YYYYMMDDHHmmss'),
  398. exportHeader: ['流程绑定信息'],
  399. exportFooter: [],
  400. resultList: [],
  401. // ======== 行高 ========
  402. height: 200,
  403. secondHeight: 200,
  404. // ======== 分页 ========
  405. pageIndex: 1,
  406. pageSize: 50,
  407. totalPage: 0,
  408. // 条件查询
  409. searchData: {
  410. site: this.$store.state.user.site,
  411. workflowId: '',
  412. workflowname: '',
  413. name: '',
  414. page: 1,
  415. limit: 10
  416. },
  417. // 其它
  418. // 初始页签
  419. activeTable: 'node_item',
  420. // ======== 数据对象 ========
  421. modalData: {
  422. flag: '',
  423. site: this.$store.state.user.site,
  424. bu: '',
  425. buDesc: '',
  426. classificationNo: '',
  427. classificationName: '',
  428. menuId: '',
  429. name: '',
  430. workflowId: '',
  431. workflowname: '',
  432. status: '',
  433. remark: '',
  434. createBy: '',
  435. createDate: '',
  436. updateDate: '',
  437. updateBy: ''
  438. },
  439. authorityData: {
  440. site: this.$store.state.user.site,
  441. bu: '',
  442. classificationNo: '',
  443. nodeId: '',
  444. nodeName: '',
  445. fieldId: '',
  446. tableId: '',
  447. fieldList: [],
  448. createBy: '',
  449. },
  450. queryTableParam: {
  451. tableType: '',
  452. passTable: [],
  453. addTable: []
  454. },
  455. nodeInfo: {
  456. site: '',
  457. bu: '',
  458. classificationNo: '',
  459. workflowId: '',
  460. workflowname: '',
  461. nodeId: '',
  462. nodeName: '',
  463. seqNo: '',
  464. isReject: ''
  465. },
  466. // ======== 数据列表 ========
  467. dataList: [],
  468. checkedDetail: [],
  469. nodeList: [],
  470. tableData: [],
  471. tableList: [],
  472. fieldList: [],
  473. authoritySelections: [],
  474. // ======== 列表表头 ========
  475. columnList: [
  476. {
  477. userId: this.$store.state.user.name,
  478. functionId: 109001,
  479. serialNumber: '109001Table1Site',
  480. tableId: '109001Table1',
  481. tableName: '物料信息表',
  482. columnProp: 'site',
  483. headerAlign: 'center',
  484. align: 'center',
  485. columnLabel: 'Site',
  486. columnHidden: false,
  487. columnImage: false,
  488. columnSortable: false,
  489. sortLv: 0,
  490. status: true,
  491. fixed: '',
  492. columnWidth: 50
  493. }/*,
  494. {
  495. userId: this.$store.state.user.name,
  496. functionId: 109001,
  497. serialNumber: '109001Table1BuDesc',
  498. tableId: '109001Table1',
  499. tableName: '物料信息表',
  500. columnProp: 'buDesc',
  501. headerAlign: 'center',
  502. align: 'center',
  503. columnLabel: 'BU',
  504. columnHidden: false,
  505. columnImage: false,
  506. columnSortable: false,
  507. sortLv: 0,
  508. status: true,
  509. fixed: '',
  510. columnWidth: 100
  511. }*/,
  512. {
  513. userId: this.$store.state.user.name,
  514. functionId: 109001,
  515. serialNumber: '109001Table1ClassificationNo',
  516. tableId: '109001Table1',
  517. tableName: '物料信息表',
  518. columnProp: 'classificationNo',
  519. headerAlign: 'center',
  520. align: 'center',
  521. columnLabel: '分类编码',
  522. columnHidden: false,
  523. columnImage: false,
  524. columnSortable: false,
  525. sortLv: 0,
  526. status: true,
  527. fixed: '',
  528. columnWidth: 100
  529. }/*,
  530. {
  531. userId: this.$store.state.user.name,
  532. functionId: 109001,
  533. serialNumber: '109001Table1ClassificationName',
  534. tableId: '109001Table1',
  535. tableName: '物料信息表',
  536. columnProp: 'classificationName',
  537. headerAlign: 'center',
  538. align: 'center',
  539. columnLabel: '分类名称',
  540. columnHidden: false,
  541. columnImage: false,
  542. columnSortable: false,
  543. sortLv: 0,
  544. status: true,
  545. fixed: '',
  546. columnWidth: 120
  547. }*/,
  548. {
  549. userId: this.$store.state.user.name,
  550. functionId: 109001,
  551. serialNumber: '109001Table1Name',
  552. tableId: '109001Table1',
  553. tableName: '物料信息表',
  554. columnProp: 'name',
  555. headerAlign: 'center',
  556. align: 'center',
  557. columnLabel: '菜单名称',
  558. columnHidden: false,
  559. columnImage: false,
  560. columnSortable: false,
  561. sortLv: 0,
  562. status: true,
  563. fixed: '',
  564. columnWidth: 120
  565. },
  566. {
  567. userId: this.$store.state.user.name,
  568. functionId: 109001,
  569. serialNumber: '109001Table1WorkflowId',
  570. tableId: '109001Table1',
  571. tableName: '物料信息表',
  572. columnProp: 'workflowId',
  573. headerAlign: 'center',
  574. align: 'center',
  575. columnLabel: '流程ID',
  576. columnHidden: false,
  577. columnImage: false,
  578. columnSortable: false,
  579. sortLv: 0,
  580. status: true,
  581. fixed: '',
  582. columnWidth: 60
  583. },
  584. {
  585. userId: this.$store.state.user.name,
  586. functionId: 109001,
  587. serialNumber: '109001Table1Workflowname',
  588. tableId: '109001Table1',
  589. tableName: '物料信息表',
  590. columnProp: 'workflowname',
  591. headerAlign: 'center',
  592. align: 'center',
  593. columnLabel: '流程名称',
  594. columnHidden: false,
  595. columnImage: false,
  596. columnSortable: false,
  597. sortLv: 0,
  598. status: true,
  599. fixed: '',
  600. columnWidth: 150
  601. },
  602. {
  603. userId: this.$store.state.user.name,
  604. functionId: 109001,
  605. serialNumber: '109001Table1Status',
  606. tableId: '109001Table1',
  607. tableName: '物料信息表',
  608. columnProp: 'statusDesc',
  609. headerAlign: 'center',
  610. align: 'center',
  611. columnLabel: '状态',
  612. columnHidden: false,
  613. columnImage: false,
  614. columnSortable: false,
  615. sortLv: 0,
  616. status: true,
  617. fixed: '',
  618. columnWidth: 100
  619. },
  620. {
  621. userId: this.$store.state.user.name,
  622. functionId: 109001,
  623. serialNumber: '109001Table1Remark',
  624. tableId: '109001Table1',
  625. tableName: '物料信息表',
  626. columnProp: 'remark',
  627. headerAlign: 'center',
  628. align: 'center',
  629. columnLabel: '备注',
  630. columnHidden: false,
  631. columnImage: false,
  632. columnSortable: false,
  633. sortLv: 0,
  634. status: true,
  635. fixed: '',
  636. columnWidth: 150
  637. },
  638. {
  639. userId: this.$store.state.user.name,
  640. functionId: 109001,
  641. serialNumber: '109001Table1CreateBy',
  642. tableId: '109001Table1',
  643. tableName: '物料信息表',
  644. columnProp: 'createBy',
  645. headerAlign: 'center',
  646. align: 'center',
  647. columnLabel: '创建人',
  648. columnHidden: false,
  649. columnImage: false,
  650. columnSortable: false,
  651. sortLv: 0,
  652. status: true,
  653. fixed: '',
  654. columnWidth: 80
  655. },
  656. {
  657. userId: this.$store.state.user.name,
  658. functionId: 109001,
  659. serialNumber: '109001Table1CreateDate',
  660. tableId: '109001Table1',
  661. tableName: '物料信息表',
  662. columnProp: 'createDate',
  663. headerAlign: 'center',
  664. align: 'center',
  665. columnLabel: '创建时间',
  666. columnHidden: false,
  667. columnImage: false,
  668. columnSortable: false,
  669. sortLv: 0,
  670. status: true,
  671. fixed: '',
  672. columnWidth: 120
  673. },
  674. {
  675. userId: this.$store.state.user.name,
  676. functionId: 109001,
  677. serialNumber: '109001Table1UpdateBy',
  678. tableId: '109001Table1',
  679. tableName: '物料信息表',
  680. columnProp: 'updateBy',
  681. headerAlign: 'center',
  682. align: 'center',
  683. columnLabel: '修改人',
  684. columnHidden: false,
  685. columnImage: false,
  686. columnSortable: false,
  687. sortLv: 0,
  688. status: true,
  689. fixed: '',
  690. columnWidth: 60
  691. },
  692. {
  693. userId: this.$store.state.user.name,
  694. functionId: 109001,
  695. serialNumber: '109001Table1UpdateDate',
  696. tableId: '109001Table1',
  697. tableName: '物料信息表',
  698. columnProp: 'updateDate',
  699. headerAlign: 'center',
  700. align: 'center',
  701. columnLabel: '修改时间',
  702. columnHidden: false,
  703. columnImage: false,
  704. columnSortable: false,
  705. sortLv: 0,
  706. status: true,
  707. fixed: '',
  708. columnWidth: 120
  709. }
  710. ],
  711. columnNodeList: [
  712. {
  713. userId: this.$store.state.user.name,
  714. functionId: 109001,
  715. serialNumber: '109001Table2ClassificationNo',
  716. tableId: "109001Table2",
  717. tableName: "节点信息表",
  718. columnProp: 'classificationNo',
  719. headerAlign: "center",
  720. align: "center",
  721. columnLabel: '分类编码',
  722. columnHidden: false,
  723. columnImage: false,
  724. columnSortable: true,
  725. sortLv: 0,
  726. status: true,
  727. fixed: '',
  728. columnWidth: 100,
  729. },
  730. {
  731. userId: this.$store.state.user.name,
  732. functionId: 109001,
  733. serialNumber: '109001Table2WorkflowId',
  734. tableId: "109001Table2",
  735. tableName: "节点信息表",
  736. columnProp: 'workflowId',
  737. headerAlign: "center",
  738. align: "center",
  739. columnLabel: '流程ID',
  740. columnHidden: false,
  741. columnImage: false,
  742. columnSortable: true,
  743. sortLv: 0,
  744. status: true,
  745. fixed: '',
  746. columnWidth: 60,
  747. },
  748. {
  749. userId: this.$store.state.user.name,
  750. functionId: 109001,
  751. serialNumber: '109001Table2Workflowname',
  752. tableId: "109001Table2",
  753. tableName: "节点信息表",
  754. columnProp: 'workflowname',
  755. headerAlign: "center",
  756. align: "center",
  757. columnLabel: '流程名称',
  758. columnHidden: false,
  759. columnImage: false,
  760. columnSortable: true,
  761. sortLv: 0,
  762. status: true,
  763. fixed: '',
  764. columnWidth: 120,
  765. },
  766. {
  767. userId: this.$store.state.user.name,
  768. functionId: 109001,
  769. serialNumber: '109001Table2NodeId',
  770. tableId: "109001Table2",
  771. tableName: "节点信息表",
  772. columnProp: 'nodeId',
  773. headerAlign: "center",
  774. align: "center",
  775. columnLabel: '节点ID',
  776. columnHidden: false,
  777. columnImage: false,
  778. columnSortable: true,
  779. sortLv: 0,
  780. status: true,
  781. fixed: '',
  782. columnWidth: 60,
  783. },
  784. {
  785. userId: this.$store.state.user.name,
  786. functionId: 109001,
  787. serialNumber: '109001Table2NodeName',
  788. tableId: "109001Table2",
  789. tableName: "节点信息表",
  790. columnProp: 'nodeName',
  791. headerAlign: "center",
  792. align: "center",
  793. columnLabel: '节点名称',
  794. columnHidden: false,
  795. columnImage: false,
  796. columnSortable: true,
  797. sortLv: 0,
  798. status: true,
  799. fixed: '',
  800. columnWidth: 120,
  801. },
  802. {
  803. userId: this.$store.state.user.name,
  804. functionId: 109001,
  805. serialNumber: '109001Table2SeqNo',
  806. tableId: "109001Table2",
  807. tableName: "节点信息表",
  808. columnProp: 'seqNo',
  809. headerAlign: "center",
  810. align: "center",
  811. columnLabel: '节点顺序',
  812. columnHidden: false,
  813. columnImage: false,
  814. columnSortable: true,
  815. sortLv: 0,
  816. status: true,
  817. fixed: '',
  818. columnWidth: 60,
  819. },
  820. {
  821. userId: this.$store.state.user.name,
  822. functionId: 109001,
  823. serialNumber: '109001Table2IsReject',
  824. tableId: "109001Table2",
  825. tableName: "节点信息表",
  826. columnProp: 'isRejectDesc',
  827. headerAlign: "center",
  828. align: "center",
  829. columnLabel: '是否可驳回',
  830. columnHidden: false,
  831. columnImage: false,
  832. columnSortable: true,
  833. sortLv: 0,
  834. status: true,
  835. fixed: '',
  836. columnWidth: 60,
  837. },
  838. /*{
  839. userId: this.$store.state.user.name,
  840. functionId: 109001,
  841. serialNumber: '109001Table2NodeType',
  842. tableId: "109001Table2",
  843. tableName: "节点信息表",
  844. columnProp: 'nodeType',
  845. headerAlign: "center",
  846. align: "center",
  847. columnLabel: '节点分类',
  848. columnHidden: false,
  849. columnImage: false,
  850. columnSortable: true,
  851. sortLv: 0,
  852. status: true,
  853. fixed: '',
  854. columnWidth: 70,
  855. },*/
  856. ],
  857. // ======== 必填规则 ========
  858. rules: {
  859. classificationName: [
  860. {
  861. required: true,
  862. message: ' ',
  863. trigger: 'change'
  864. }
  865. ],
  866. menuId: [
  867. {
  868. required: true,
  869. message: ' ',
  870. trigger: 'change'
  871. }
  872. ],
  873. workflowId: [
  874. {
  875. required: true,
  876. message: ' ',
  877. trigger: 'change'
  878. }
  879. ],
  880. status: [
  881. {
  882. required: true,
  883. message: ' ',
  884. trigger: 'change'
  885. }
  886. ]
  887. },
  888. // ======== 复选数据集 ========
  889. quotationSelections: [],
  890. // ======== 选中的当前行数据 ========
  891. requestCurrentRow: {},
  892. nodeCurrentRow: {},
  893. // ======== 模态框开关控制 ========
  894. subDetailFlag: false,
  895. maintenanceFlag: false,
  896. modalFlag: false,
  897. authorityFlag: false,
  898. nodeModalFlag: false,
  899. nodeModalDisableFlag: false
  900. }
  901. },
  902. mounted () {
  903. this.$nextTick(() => {
  904. this.height = window.innerHeight / 2 - 30
  905. /*第二个表格高度的动态调整*/
  906. this.secondHeight = window.innerHeight - this.height - 180
  907. })
  908. },
  909. created () {
  910. // 获取数据列表
  911. this.getDataList()
  912. },
  913. methods: {
  914. // rowStyle2 ({row}) {
  915. // if (!this.authoritySelections.includes(row)) {
  916. // row.required = 'N'
  917. // return{ 'background-color': '#FFF', cursor: 'pointer' }
  918. // }
  919. // return{ 'background-color': '#FFF', cursor: 'pointer' }
  920. // },
  921. // 编辑模态框
  922. editNodeModal (row) {
  923. this.nodeInfo = {
  924. site: row.site,
  925. bu: row.bu,
  926. classificationNo: row.classificationNo,
  927. workflowId: row.workflowId,
  928. workflowname: row.workflowname,
  929. nodeId: row.nodeId,
  930. nodeName: row.nodeName,
  931. seqNo: row.seqNo,
  932. isReject: row.isReject
  933. }
  934. this.nodeModalFlag = true
  935. this.nodeModalDisableFlag = true
  936. },
  937. // 修改节点信息
  938. editNodeInfo () {
  939. if (this.nodeInfo.isReject === '' || this.nodeInfo.isReject == null) {
  940. this.$message.warning('请选择节点是否可驳回!')
  941. return false
  942. }
  943. editNodeInfo(this.nodeInfo).then(({data}) => {
  944. if (data && data.code === 0) {
  945. this.getNodeInfoByWorkFlowSearch()
  946. this.nodeModalFlag = false
  947. this.$message({
  948. message: '操作成功',
  949. type: 'success',
  950. duration: 1500,
  951. onClose: () => {
  952. }
  953. })
  954. } else {
  955. this.$alert(data.msg, '错误', {
  956. confirmButtonText: '确定'
  957. })
  958. }
  959. })
  960. },
  961. // 点击行选中复选框
  962. authorityClickRow (row) {
  963. //this.$refs.authorityTable.toggleRowSelection(row)
  964. },
  965. // 多选
  966. selectionAuthority (val) {
  967. this.authoritySelections = val
  968. },
  969. // 权限配置
  970. authorityModal (row) {
  971. this.authorityData = {
  972. site: row.site,
  973. bu: '',
  974. classificationNo: row.classificationNo,
  975. nodeId: row.nodeId,
  976. nodeName: row.nodeName,
  977. fieldId: '',
  978. tableId: this.tableList.length > 0 ? this.tableList[0].tableId : '',
  979. fieldList: [],
  980. createBy: this.$store.state.user.name
  981. }
  982. // 先清空缓存选中
  983. this.$nextTick(() => this.$refs.authorityTable.clearSelection())
  984. getAuthorityFieldList(this.authorityData).then(({data}) => {
  985. if (data && data.code === 0) {
  986. this.authorityData.fieldList = data.rows
  987. this.authorityData.fieldList.forEach(val => {
  988. // 回显选中
  989. if (val.updateCheck) {
  990. this.$nextTick(() => this.$refs.authorityTable.toggleRowSelection(val, true))
  991. }
  992. })
  993. } else {
  994. this.authorityData.fieldList = []
  995. }
  996. })
  997. this.authorityFlag = true
  998. },
  999. // 表改变事件
  1000. tableChange3 () {
  1001. getAuthorityFieldList(this.authorityData).then(({data}) => {
  1002. if (data && data.code === 0) {
  1003. this.authorityData.fieldList = data.rows
  1004. this.authorityData.fieldList.forEach(val => {
  1005. // 回显选中
  1006. if (val.updateCheck) {
  1007. this.$nextTick(() => this.$refs.authorityTable.toggleRowSelection(val, true))
  1008. }
  1009. })
  1010. } else {
  1011. this.authorityData.fieldList = []
  1012. }
  1013. })
  1014. },
  1015. // 保存节点权限
  1016. saveAuthorityList () {
  1017. let tempData = {
  1018. site: this.authorityData.site,
  1019. bu: '',
  1020. classificationNo: this.authorityData.classificationNo,
  1021. nodeId: this.authorityData.nodeId,
  1022. nodeName: this.authorityData.nodeName,
  1023. fieldId: '',
  1024. tableId: this.authorityData.tableId,
  1025. fieldList: this.authoritySelections,
  1026. createBy: this.$store.state.user.name
  1027. }
  1028. saveAuthorityList(tempData).then(({data}) => {
  1029. if (data && data.code === 0) {
  1030. this.$message.success( '操作成功')
  1031. } else {
  1032. this.$message.error(data.msg)
  1033. }
  1034. })
  1035. },
  1036. // 表改变事件
  1037. tableChange (index) {
  1038. let tempData = {
  1039. tableId: this.tableData[index].plmTable
  1040. }
  1041. this.fieldList = []
  1042. getFieldList(tempData).then(({data}) => {
  1043. if (data && data.code === 0) {
  1044. this.fieldList = data.rows
  1045. } else {
  1046. this.fieldList = []
  1047. }
  1048. })
  1049. this.tableData[index].plmField = ''
  1050. },
  1051. // 表改变事件
  1052. tableChange2 (index) {
  1053. let tempData = {
  1054. tableId: this.tableData[index].plmTable
  1055. }
  1056. getFieldList(tempData).then(({data}) => {
  1057. if (data && data.code === 0) {
  1058. this.fieldList = data.rows
  1059. } else {
  1060. this.fieldList = []
  1061. }
  1062. })
  1063. },
  1064. // 获取Table列表
  1065. getTableList () {
  1066. getTableList(this.queryTableParam).then(({data}) => {
  1067. if (data && data.code === 0) {
  1068. this.tableList = data.rows
  1069. } else {
  1070. this.tableList = []
  1071. }
  1072. })
  1073. },
  1074. // ======= 正则校验 =======
  1075. handleInput (value, type) {
  1076. // 大于等于0,且只能输入4位小数
  1077. let val = value.replace(/^\D*([0-9]\d*\.?\d{0,4})?.*$/,'$1')
  1078. if (val === null || val === undefined || val === '') {
  1079. val = 0
  1080. }
  1081. },
  1082. // ======== 分页相关方法 ========
  1083. /**
  1084. * 每页数
  1085. * @param val
  1086. */
  1087. sizeChangeHandle (val) {
  1088. this.pageSize = val
  1089. this.pageIndex = 1
  1090. this.getDataList()
  1091. },
  1092. /**
  1093. * 当前页
  1094. * @param val
  1095. */
  1096. currentChangeHandle (val) {
  1097. this.pageIndex = val
  1098. this.getDataList()
  1099. },
  1100. // ======== 页签切换相关方法 ========
  1101. /**
  1102. * 未知
  1103. * @returns {boolean}
  1104. */
  1105. selectFlag (row) {
  1106. if (row.status === 'Y') {
  1107. return false
  1108. } else {
  1109. return true
  1110. }
  1111. },
  1112. /**
  1113. * 列表表格选择替换
  1114. * @param tab
  1115. * @param event
  1116. */
  1117. tabClick (tab, event) {
  1118. // 刷新列表数据
  1119. this.refreshCurrentTabTable()
  1120. },
  1121. /**
  1122. * 当前值发生变化的时候修改
  1123. * @param row
  1124. * @param oldRow
  1125. */
  1126. changeCurrentRow (row, oldRow) {
  1127. // 判断是否是获取焦点的事件
  1128. if (row) {
  1129. this.requestCurrentRow = JSON.parse(JSON.stringify(row))
  1130. // 刷新当前页表
  1131. this.refreshCurrentTabTable()
  1132. this.tableList = []
  1133. this.fieldList = []
  1134. if (row.menuId === '108002') { // 变更
  1135. this.queryTableParam = {
  1136. tableType: 'plm_change',
  1137. passTable: [
  1138. 'plm_change_ecn_type_detail',
  1139. 'plm_change_ecn_type_header'
  1140. ],
  1141. addTable: []
  1142. }
  1143. } else if (row.menuId === '102001') { // 询价
  1144. this.queryTableParam = {
  1145. tableType: 'plm_quotation',
  1146. passTable: [],
  1147. addTable: []
  1148. }
  1149. } else if (row.menuId === '103001'){ // 打样
  1150. this.queryTableParam = {
  1151. tableType: 'plm_proofing',
  1152. passTable: [],
  1153. addTable: []
  1154. }
  1155. } else if (row.menuId === '107001') { // 测试
  1156. this.queryTableParam = {
  1157. tableType: 'plm_test_information',
  1158. passTable: [],
  1159. addTable: ['plm_test_so_bom']
  1160. }
  1161. } else if (row.menuId === '103002') { // BM
  1162. this.queryTableParam = {
  1163. tableType: 'plm_stepRole_base_bm',
  1164. passTable: [],
  1165. addTable: [
  1166. 'plm_technical_specification_sheet',
  1167. 'plm_technicalSpecification_team'
  1168. ]
  1169. }
  1170. } else if (row.menuId === '106002') { // 刀模
  1171. this.queryTableParam = {
  1172. tableType: 'plm_project_tool_applyHeader',
  1173. passTable: [],
  1174. addTable: [
  1175. 'plm_project_tool_applyHeader',
  1176. 'plm_project_tool_applyDetail'
  1177. ]
  1178. }
  1179. } else {
  1180. return
  1181. }
  1182. this.getTableList()
  1183. }
  1184. },
  1185. /**
  1186. * 刷新页签的table数据
  1187. */
  1188. refreshCurrentTabTable () {
  1189. if (this.activeTable === 'node_item') {
  1190. this.getNodeInfoByWorkFlowSearch()
  1191. }
  1192. },
  1193. // 表格的新增
  1194. rowClassName ({ row, rowIndex }) {
  1195. row.xh = rowIndex + 1
  1196. },
  1197. // 单选框选中数据
  1198. handleDetailSelectionChange(selection) {
  1199. this.checkedDetail = selection
  1200. },
  1201. // 点击新增更多
  1202. handleAddBtn () {
  1203. let obj = {
  1204. site: this.$store.state.user.site,
  1205. classificationNo: this.nodeCurrentRow.classificationNo,
  1206. workflowId: this.nodeCurrentRow.workflowId,
  1207. nodeId: this.nodeCurrentRow.nodeId,
  1208. nodeName: this.nodeCurrentRow.nodeName,
  1209. createBy: this.$store.state.user.name,
  1210. remark: '',
  1211. plmField: '',
  1212. oaField: '',
  1213. fieldValue: '',
  1214. fieldDesc: '',
  1215. orderRef1: '',
  1216. orderRef2: '',
  1217. orderRef3: '',
  1218. orderRef4: '',
  1219. plmTable: '',
  1220. fieldType: 'B'
  1221. }
  1222. // obj.site = this.$store.state.user.site
  1223. // obj.classificationNo = this.nodeCurrentRow.classificationNo
  1224. // obj.workflowId = this.nodeCurrentRow.workflowId
  1225. // obj.nodeId = this.nodeCurrentRow.nodeId
  1226. // obj.nodeName = this.nodeCurrentRow.nodeName
  1227. // obj.createBy = this.$store.state.user.name
  1228. // obj.remark = ""
  1229. // obj.plmField = ""
  1230. // obj.oaField = ""
  1231. // obj.fieldValue = ""
  1232. // obj.fieldDesc = ""
  1233. // obj.orderRef1 = ""
  1234. // obj.orderRef2 = ""
  1235. // obj.orderRef3 = ""
  1236. // obj.orderRef4 = ""
  1237. this.tableData.push(obj)
  1238. },
  1239. //删除
  1240. handleDeleteBtn () {
  1241. if (this.checkedDetail.length === 0) {
  1242. this.$alert("请先选择要删除的数据行", "提示", {
  1243. confirmButtonText: "确定",
  1244. })
  1245. } else {
  1246. this.$confirm("请确认是否删除"+this.checkedDetail.length+"条出口配置?", "提示", {
  1247. confirmButtonText: "确定",
  1248. cancelButtonText: "取消",
  1249. type: "warning",
  1250. callback: (action) => {
  1251. if (action === "confirm") {
  1252. let val = this.checkedDetail
  1253. val.forEach((val, index) => {
  1254. this.tableData.forEach((v, i) => {
  1255. if (val.xh === v.xh) {
  1256. this.tableData.splice(i, 1)
  1257. }
  1258. })
  1259. })
  1260. this.$message({
  1261. message: "删除成功!",
  1262. type: "success",
  1263. })
  1264. return
  1265. } else {
  1266. this.$message({
  1267. message: "已取消删除操作",
  1268. type: "warning",
  1269. })
  1270. return
  1271. }
  1272. },
  1273. })
  1274. }
  1275. },
  1276. // ======== 列表数据刷新方法 ========
  1277. /**
  1278. * @Author Yzz
  1279. * @Description 查询节点现有出口配置
  1280. * @Date 2024/15/12 15:00:28
  1281. **/
  1282. // 出口配置信息查询
  1283. subDetailModal (row) {
  1284. this.nodeCurrentRow = row;
  1285. let tempData = {
  1286. site: this.$store.state.user.site,
  1287. workflowId: this.nodeCurrentRow.workflowId,
  1288. nodeId: this.nodeCurrentRow.nodeId,
  1289. classificationNo: this.nodeCurrentRow.classificationNo,
  1290. }
  1291. getNodeDetail(tempData).then(({data}) => {
  1292. if (data && data.code === 0) {
  1293. this.tableData = data.rows
  1294. for (let i = 0; i < this.tableData.length; i++) {
  1295. this.tableChange2(i)
  1296. }
  1297. } else {
  1298. this.tableData = []
  1299. }
  1300. })
  1301. this.subDetailFlag = true
  1302. },
  1303. /**
  1304. * 查询节点信息
  1305. */
  1306. getNodeInfoByWorkFlowSearch () {
  1307. let tempData = {
  1308. site: this.$store.state.user.site,
  1309. //workflowId: this.requestCurrentRow.workflowId,
  1310. classificationNo: this.requestCurrentRow.classificationNo
  1311. }
  1312. getNodeInfoByWorkflow(tempData).then(({data}) => {
  1313. if (data && data.code === 0) {
  1314. this.nodeList = data.rows
  1315. } else {
  1316. this.nodeList = []
  1317. }
  1318. })
  1319. },
  1320. // ======== 列表数据刷新方法 ========
  1321. /**
  1322. * 获取数据列表 流程绑定主表信息
  1323. */
  1324. getDataList () {
  1325. this.searchData.limit = this.pageSize
  1326. this.searchData.page = this.pageIndex
  1327. getRequestMainData(this.searchData).then(({data}) => {
  1328. if (data.code === 0) {
  1329. this.dataList = data.page.list
  1330. this.pageIndex = data.page.currPage
  1331. this.pageSize = data.page.pageSize
  1332. this.totalPage = data.page.totalCount
  1333. this.$refs.selectDiv.setLengthAll( this.dataList.length)
  1334. // 判断是否全部存在数据
  1335. if (this.dataList.length > 0) {
  1336. // 设置选中行
  1337. this.$refs.requestTable.setCurrentRow(this.dataList[0])
  1338. this.requestClickRow(this.dataList[0])
  1339. } else {
  1340. this.requestCurrentRow = {}
  1341. }
  1342. // 加载当前的页签的table
  1343. this.refreshCurrentTabTable()
  1344. }
  1345. })
  1346. },
  1347. // ======== 新增/编辑模态框 ========
  1348. /**
  1349. * 流程主表新增按钮
  1350. */
  1351. addModal () {
  1352. this.modalData = {
  1353. flag: '1',
  1354. site: this.$store.state.user.site,
  1355. bu: '',
  1356. buDesc: '',
  1357. classificationNo: '*',
  1358. classificationName: '',
  1359. menuId: '',
  1360. name: '',
  1361. workflowId: '',
  1362. workflowname: '',
  1363. status: 'Y',
  1364. remark: '',
  1365. createBy: this.$store.state.user.name,
  1366. }
  1367. this.maintenanceFlag = false
  1368. this.modalFlag = true
  1369. },
  1370. delModal() {
  1371. if (this.quotationSelections.length === 0) {
  1372. this.$message.warning('请勾选需要删除的信息!')
  1373. return
  1374. }
  1375. this.$confirm(`是否删除这 ` + this.quotationSelections.length + ` 条绑定信息及其他关联信息?`, '提示', {
  1376. confirmButtonText: '确定',
  1377. cancelButtonText: '取消',
  1378. type: 'warning'
  1379. }).then(() => {
  1380. deleteRequestHeader(this.quotationSelections).then(({data}) => {
  1381. if (data && data.code === 0) {
  1382. this.getDataList()
  1383. this.quotationSelections = []
  1384. this.$message({
  1385. message: '操作成功',
  1386. type: 'success',
  1387. duration: 1500,
  1388. onClose: () => {
  1389. }
  1390. })
  1391. } else {
  1392. this.$alert(data.msg, '错误', {
  1393. confirmButtonText: '确定'
  1394. })
  1395. }
  1396. })
  1397. }).catch(() => {
  1398. })
  1399. },
  1400. /**
  1401. * 流程主表修改按钮
  1402. * @param row
  1403. */
  1404. updateModal (row) {
  1405. this.modalData = {
  1406. flag: '2',
  1407. site: this.$store.state.user.site,
  1408. bu: row.bu,
  1409. buDesc: row.buDesc,
  1410. classificationNo: row.classificationNo,
  1411. classificationName: row.classificationName,
  1412. menuId: row.menuId,
  1413. name: row.name,
  1414. workflowId: row.workflowId,
  1415. workflowname: row.workflowname,
  1416. status: row.status,
  1417. remark: row.remark,
  1418. updateBy: this.$store.state.user.name,
  1419. }
  1420. this.maintenanceFlag = true
  1421. this.modalFlag = true
  1422. },
  1423. checkDataBySubDetail(){
  1424. for (let i = 0; i < this.tableData.length; i++) {
  1425. if(this.tableData[i].plmTable === '' || this.tableData[i].plmTable == null){
  1426. this.$message.warning('序号' + (i+1) +'未选择PLM数据表,数据表为必填项!')
  1427. return
  1428. }
  1429. if(this.tableData[i].plmField === '' || this.tableData[i].plmField == null){
  1430. this.$message.warning('序号' + (i+1) +'未选择PLM字段名,字段名为必填项!')
  1431. return
  1432. }
  1433. if(this.tableData[i].oaField === '' || this.tableData[i].oaField == null){
  1434. this.$message.warning('序号' + (i+1) +'未填写OA字段名,字段名为必填项!')
  1435. return
  1436. }
  1437. if(this.tableData[i].fieldType === '' || this.tableData[i].fieldType == null){
  1438. this.$message.warning('序号' + (i+1) +'未选择PLM字段类型,字段类型为必填项!')
  1439. return
  1440. }
  1441. }
  1442. if (this.tableData.length === 0){
  1443. this.$confirm(`继续将保存"删除节点全部配置"的操作,是否继续?`, '提示', {
  1444. confirmButtonText: '确定',
  1445. cancelButtonText: '取消',
  1446. type: 'warning'
  1447. }).then(() => {
  1448. let obj = {}
  1449. obj.site = this.$store.state.user.site,
  1450. obj.classificationNo = this.nodeCurrentRow.classificationNo,
  1451. obj.workflowId = this.nodeCurrentRow.workflowId,
  1452. obj.nodeId = this.nodeCurrentRow.nodeId,
  1453. obj.createBy = this.$store.state.user.name,
  1454. deleteRequestNodeDetailByLine(obj).then(({data}) => {
  1455. if (data && data.code === 0) {
  1456. //清空手动添加的
  1457. this.tableData = [];
  1458. //查询数据库中保存的
  1459. //this.getDataList()
  1460. //关闭模态框
  1461. this.subDetailFlag = false;
  1462. this.$message({
  1463. message: '操作成功',
  1464. type: 'success',
  1465. duration: 1500,
  1466. onClose: () => {}
  1467. })
  1468. } else {
  1469. this.$alert(data.msg, '错误', {
  1470. confirmButtonText: '确定'
  1471. })
  1472. }
  1473. })
  1474. }).catch(() => {
  1475. })
  1476. }else {
  1477. saveRequestNodeDetail(this.tableData).then(({data}) => {
  1478. if (data && data.code === 0) {
  1479. //清空手动添加的
  1480. this.tableData = [];
  1481. //查询数据库中保存的
  1482. //this.getDataList()
  1483. //关闭模态框
  1484. this.subDetailFlag = false;
  1485. this.$message({
  1486. message: '操作成功',
  1487. type: 'success',
  1488. duration: 1500,
  1489. onClose: () => {}
  1490. })
  1491. } else {
  1492. this.$alert(data.msg, '错误', {
  1493. confirmButtonText: '确定'
  1494. })
  1495. }
  1496. })
  1497. }
  1498. },
  1499. /**
  1500. * 返回列表唯一值
  1501. * @param row
  1502. * @returns {string|[{trigger: string, message: string, required: boolean}]|*}
  1503. */
  1504. getRowKeys (row) {
  1505. // 唯一值,一般都为id
  1506. return row.agentId
  1507. },
  1508. // ======== 新增/编辑/删除方法 ========
  1509. /**
  1510. * 流程主表绑定关系新增/编辑
  1511. */
  1512. saveData () {
  1513. if (this.modalData.workflowId === '' || this.modalData.workflowId == null) {
  1514. this.$message.warning('请选择流程!')
  1515. return
  1516. }
  1517. if (this.modalData.menuId === '' || this.modalData.menuId == null) {
  1518. this.$message.warning('请选择功能菜单!')
  1519. return
  1520. }
  1521. if (this.modalData.status === '' || this.modalData.status == null) {
  1522. this.$message.warning('请选择状态!')
  1523. return
  1524. }
  1525. if (this.modalData.flag === '1') {
  1526. saveRequestHeader(this.modalData).then(({data}) => {
  1527. if (data && data.code === 0) {
  1528. this.getDataList()
  1529. this.modalFlag = false
  1530. this.$message({
  1531. message: '操作成功',
  1532. type: 'success',
  1533. duration: 1500,
  1534. onClose: () => {}
  1535. })
  1536. } else {
  1537. this.$alert(data.msg, '错误', {
  1538. confirmButtonText: '确定'
  1539. })
  1540. }
  1541. })
  1542. } else {
  1543. updateRequestHeader(this.modalData).then(({data}) => {
  1544. if (data && data.code === 0) {
  1545. this.getDataList()
  1546. this.modalFlag = false
  1547. this.$message({
  1548. message: '操作成功',
  1549. type: 'success',
  1550. duration: 1500,
  1551. onClose: () => {}
  1552. })
  1553. } else {
  1554. this.$alert(data.msg, '错误', {
  1555. confirmButtonText: '确定'
  1556. })
  1557. }
  1558. })
  1559. }
  1560. },
  1561. // ======== 列表操作方法 ========
  1562. /**
  1563. * 单机选中主表绑定信息行
  1564. * @param row
  1565. */
  1566. requestClickRow (row) {
  1567. // this.$refs.requestTable.toggleRowSelection(row)
  1568. this.requestCurrentRow = JSON.parse(JSON.stringify(row))
  1569. },
  1570. /**
  1571. * 复选物料信息
  1572. * @param val
  1573. */
  1574. selectionRequest (val) {
  1575. this.quotationSelections = val
  1576. this.$refs.selectDiv.setLengthselected(this.quotationSelections.length)
  1577. },
  1578. // ======== chooseList相关方法 ========
  1579. /**
  1580. * 获取基础数据列表S
  1581. * @param val
  1582. * @param type
  1583. */
  1584. getBaseList (val, type) {
  1585. this.tagNo = val
  1586. this.$nextTick(() => {
  1587. let strVal = ''
  1588. if (val === 1014) {
  1589. strVal = this.modalData.menuId
  1590. }else if (val === 1015){
  1591. strVal = this.modalData.workflowId
  1592. }
  1593. this.$refs.baseList.init(val, strVal)
  1594. })
  1595. },
  1596. /**
  1597. * 列表方法的回调
  1598. * @param val
  1599. */
  1600. getBaseData (val) {
  1601. if (this.tagNo === 1014) {
  1602. this.modalData.menuId = val.Menu_id
  1603. this.modalData.name = val.Name
  1604. } else if (this.tagNo === 1015) {
  1605. this.modalData.workflowId = val.Workflowid
  1606. this.modalData.workflowname = val.Workflowname
  1607. }
  1608. },
  1609. // 流程ID输入校验
  1610. workflowBlur (tagNo) {
  1611. if (this.modalData.workflowId != null && this.modalData.workflowId !== '') {
  1612. let tempData = {
  1613. tagno: tagNo,
  1614. conditionSql: " and Workflowid = '" + this.modalData.workflowId + "'"
  1615. }
  1616. verifyData(tempData).then(({data}) => {
  1617. if (data && data.code === 0) {
  1618. if (data.baseListData.length > 0) {
  1619. this.modalData.workflowId = data.baseListData[0].Workflowid
  1620. this.modalData.workflowname = data.baseListData[0].Workflowname
  1621. return
  1622. }
  1623. }
  1624. })
  1625. }
  1626. this.modalData.workflowname = ''
  1627. },
  1628. // 菜单ID输入校验
  1629. menuBlur (tagNo) {
  1630. if (this.modalData.menuId != null && this.modalData.menuId !== '') {
  1631. let tempData = {
  1632. tagno: tagNo,
  1633. conditionSql: " and Menu_id = '" + this.modalData.menuId + "'"
  1634. }
  1635. verifyData(tempData).then(({data}) => {
  1636. if (data && data.code === 0) {
  1637. if (data.baseListData.length > 0) {
  1638. this.modalData.menuId = data.baseListData[0].Menu_id
  1639. this.modalData.name = data.baseListData[0].Name
  1640. return
  1641. }
  1642. }
  1643. })
  1644. }
  1645. this.modalData.name = ''
  1646. },
  1647. // ======== 导出相关方法 ========
  1648. /**
  1649. * 导出excel
  1650. */
  1651. async createExportData () {
  1652. this.searchData.limit = -1
  1653. this.searchData.page = 1
  1654. await getRequestMainData(this.searchData).then(({data}) => {
  1655. this.resultList = data.page.list
  1656. })
  1657. return this.resultList
  1658. },
  1659. startDownload () {},
  1660. finishDownload () {},
  1661. fields () {
  1662. let json = '{'
  1663. this.columnList.forEach((item, index) => {
  1664. if (index == this.columnList.length - 1) {
  1665. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"'
  1666. } else {
  1667. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' + ','
  1668. }
  1669. })
  1670. json += '}'
  1671. let s = eval('(' + json + ')')
  1672. return s
  1673. },
  1674. rowStyle ({row}) {
  1675. if (this.requestCurrentRow.classificationNo === row.classificationNo) {
  1676. return { 'background-color': '#E8F7F6', cursor: 'pointer' };
  1677. }
  1678. }
  1679. }
  1680. }
  1681. </script>
  1682. <style scoped lang="scss">
  1683. /deep/ .customer-tab .el-tabs__content {
  1684. padding: 0px !important;
  1685. height: 459px;
  1686. }
  1687. /deep/ .customer-tab .el-tabs__content {
  1688. height: 294px;
  1689. }
  1690. .numInput /deep/ .el-input__inner{
  1691. text-align: right;
  1692. }
  1693. /deep/ .inlineNumber input::-webkit-outer-spin-button,
  1694. /deep/ .inlineNumber input::-webkit-inner-spin-button {
  1695. -webkit-appearance: none;
  1696. }
  1697. /deep/ .inlineNumber input[type="number"]{
  1698. -moz-appearance: textfield;
  1699. padding-right: 5px !important;
  1700. }
  1701. </style>