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.

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