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.

1679 lines
57 KiB

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