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.

1859 lines
63 KiB

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