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.

944 lines
31 KiB

2 years ago
2 years ago
1 year ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
9 months ago
2 years ago
2 years ago
9 months ago
12 months ago
2 years ago
2 years ago
9 months ago
2 years ago
2 years ago
9 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
9 months ago
2 years ago
9 months ago
2 years ago
2 years ago
2 years ago
2 years ago
10 months ago
2 years ago
2 years ago
9 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
9 months ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
1 year ago
9 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
9 months ago
2 years ago
2 years ago
1 year ago
9 months ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
10 months ago
2 years ago
1 year ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
2 years ago
9 months ago
2 years ago
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" label-position="top" style="margin-top: 1px; margin-left: 0px;" >
  4. <el-row :gutter="20">
  5. <el-col :span="18">
  6. <el-form-item label="物料编码/Part No.">
  7. <el-input v-model="bomData.partNo" readonly style="width: 120px"></el-input>
  8. </el-form-item>
  9. <el-form-item label="BOM类型/BOM Type">
  10. <el-input v-model="bomData.bomType" readonly style="width: 120px"></el-input>
  11. </el-form-item>
  12. <el-form-item label="BOM版本/BOM Rev.">
  13. <el-input v-model="bomData.engChgLevel" readonly style="width: 120px"></el-input>
  14. </el-form-item>
  15. <el-form-item label="替代编码/Alternative No.">
  16. <el-input v-model="bomData.alternativeNo" readonly style="width: 130px"></el-input>
  17. </el-form-item>
  18. <!-- <el-form-item label="URL文件号/UL Product Model">-->
  19. <!-- <dict-data-select :site="searchData.site" v-if="searchData.site" v-model="bomData.urlFile" style="width: 240px" dict-type="bm_url_file"></dict-data-select>-->
  20. <!-- </el-form-item>-->
  21. <!-- <el-form-item prop="urlFile" :rules="componentRules.urlFile">-->
  22. <!-- <span style="cursor: pointer" slot="label" @click="queryUrlFile"><a herf="#">URL文件号/UL Product Model</a></span>-->
  23. <!-- <el-input v-model="bomData.urlFile" style="width: 103px"></el-input>-->
  24. <!-- </el-form-item>-->
  25. <el-form-item
  26. prop="urlFile"
  27. :rules="componentRules.urlFile"
  28. label="UL文件号/UL Product Model"
  29. >
  30. <span slot="label">
  31. <a href="javascript:void(0)" @click="queryUrlFile" style=" text-decoration: none;">UL文件号/UL Product Model</a>
  32. </span>
  33. <el-input v-model="bomData.urlFile" style="width: 370px" />
  34. </el-form-item>
  35. <el-form-item label=" ">
  36. <el-button type="primary" @click="searchTable(true)" >刷新</el-button>
  37. <el-button type="primary" v-if="((!ifDisableFlag && spForm.sp.includes(searchData.username) && baseForm.status === 'spz') || baseForm.status === 'cg' || superAdmin)" @click="changeBomRev()">变更</el-button>
  38. <el-button type="primary" @click="jumpBom()">跳转至BOM</el-button>
  39. <el-button type="primary" v-if="(!ifDisableFlag && isAuth('103002:bmSave') && spForm.sp.includes(searchData.username) && baseForm.status === 'spz') || baseForm.status === 'cg' || superAdmin" @click="updateBMProcess()" >保存数据</el-button>
  40. <el-button v-if="baseForm.status === 'spz' && ((!ifDisableFlag && spForm.sp.includes(searchData.username)) || (superAdmin))" type="primary" @click="agreeSubmit">同意</el-button>
  41. <el-button v-if="baseForm.status === 'spz' && ((baseForm.isReject === 'Y' && !ifDisableFlag && spForm.sp.includes(searchData.username)) || (superAdmin))" type="primary" @click="submitDataModal">驳回</el-button>
  42. <!-- <el-button type="primary" @click="newData()" v-if="!ifDisableFlag">新增</el-button>-->
  43. </el-form-item>
  44. </el-col>
  45. <el-col :span="3"><div class="grid-content bg-purple">
  46. <el-form-item label="当前节点/Status" style="width: 100%">
  47. <el-input v-model="spForm.nodeName" disabled></el-input>
  48. </el-form-item>
  49. </div>
  50. </el-col>
  51. <el-col :span="3"><div class="grid-content bg-purple">
  52. <el-form-item label="当前节点审批人/Authorizer" style="width: 100%">
  53. <el-input v-model="spForm.sp" disabled></el-input>
  54. </el-form-item>
  55. </div>
  56. </el-col>
  57. </el-row>
  58. <el-table
  59. :data="bomList"
  60. :height="height"
  61. border
  62. ref="componentTable"
  63. style="width:100%">
  64. <!-- <el-table-column-->
  65. <!-- v-for="(item,index) in columnList1" :key="index"-->
  66. <!-- :sortable="item.columnSortable"-->
  67. <!-- :prop="item.columnProp"-->
  68. <!-- :header-align="item.headerAlign"-->
  69. <!-- :show-overflow-tooltip="item.showOverflowTooltip"-->
  70. <!-- :align="item.align"-->
  71. <!-- :fixed="item.fixed == ''?false:item.fixed"-->
  72. <!-- :min-width="item.columnWidth"-->
  73. <!-- :label="item.columnLabel">-->
  74. <!-- <template slot-scope="scope">-->
  75. <!-- <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>-->
  76. <!-- <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>-->
  77. <!-- </template>-->
  78. <!-- </el-table-column>-->
  79. <el-table-column label="序号" header-align="center">
  80. <el-table-column
  81. prop="lineSequence"
  82. header-align="center"
  83. align="center"
  84. min-width="60"
  85. label="Item No.">
  86. </el-table-column>
  87. </el-table-column>
  88. <el-table-column label="装配件料号" header-align="center">
  89. <el-table-column
  90. prop="componentPart"
  91. header-align="center"
  92. align="center"
  93. min-width="120"
  94. label="Component Part">
  95. </el-table-column>
  96. </el-table-column>
  97. <el-table-column label="描述" header-align="center">
  98. <el-table-column
  99. prop="componentPartDesc"
  100. header-align="center"
  101. align="left"
  102. min-width="160"
  103. label="Description">
  104. </el-table-column>
  105. </el-table-column>
  106. <el-table-column label="单位用量" header-align="center">
  107. <el-table-column
  108. prop="qtyPerAssembly"
  109. header-align="center"
  110. align="right"
  111. min-width="140"
  112. label="Quantity Per Assembly">
  113. </el-table-column>
  114. </el-table-column>
  115. <el-table-column label="调机料" header-align="center">
  116. <el-table-column
  117. prop="componentScrap"
  118. header-align="center"
  119. align="right"
  120. min-width="100"
  121. label="Component Scrap">
  122. </el-table-column>
  123. </el-table-column>
  124. <el-table-column label="损耗率" header-align="center">
  125. <el-table-column
  126. prop="shrinkageFactor"
  127. header-align="center"
  128. align="right"
  129. min-width="100"
  130. label="Scrap Factor(%)">
  131. </el-table-column>
  132. </el-table-column>
  133. <el-table-column label="单位" header-align="center">
  134. <el-table-column
  135. prop="printUnit"
  136. header-align="center"
  137. align="center"
  138. min-width="60"
  139. label="Unit">
  140. </el-table-column>
  141. </el-table-column>
  142. <el-table-column label="发料方式" header-align="center">
  143. <el-table-column
  144. prop="issueType"
  145. header-align="center"
  146. align="center"
  147. min-width="80"
  148. label="Reserve/Issue Method">
  149. </el-table-column>
  150. </el-table-column>
  151. <el-table-column label="工序号" header-align="center">
  152. <el-table-column
  153. prop="operationId"
  154. header-align="center"
  155. align="center"
  156. min-width="80"
  157. label="Operation">
  158. </el-table-column>
  159. </el-table-column>
  160. <el-table-column label="发料库位" header-align="center">
  161. <el-table-column
  162. prop="issueToLocName"
  163. header-align="center"
  164. align="center"
  165. min-width="100"
  166. label="Issue From Loc.">
  167. </el-table-column>
  168. </el-table-column>
  169. <el-table-column label="备注" header-align="center">
  170. <el-table-column
  171. prop="noteText"
  172. header-align="center"
  173. align="left"
  174. min-width="150"
  175. label="Comments">
  176. </el-table-column>
  177. </el-table-column>
  178. <el-table-column
  179. fixed="right"
  180. header-align="center"
  181. align="center"
  182. width="90"
  183. label="操作">
  184. <template slot-scope="scope">
  185. <a type="text" v-if="scope.row.ifHasPeifang==='Y'" size="small" @click="jumpPeifang(scope.row)">跳转配方</a>
  186. </template>
  187. </el-table-column>
  188. </el-table>
  189. </el-form>
  190. <el-dialog title="变更BOM" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="750px">
  191. <el-table
  192. :data="bomDetailList"
  193. height="300"
  194. border
  195. highlight-current-row
  196. onclick=""
  197. @row-click="getRow"
  198. ref="componentTable"
  199. style="width:100%">
  200. <el-table-column
  201. prop="partNo"
  202. header-align="left"
  203. align="left"
  204. min-width="80"
  205. label="物料编码">
  206. </el-table-column>
  207. <el-table-column
  208. prop="bomType"
  209. header-align="left"
  210. align="left"
  211. min-width="80"
  212. label="BOM类型">
  213. </el-table-column>
  214. <el-table-column
  215. prop="engChgLevel"
  216. header-align="left"
  217. align="left"
  218. min-width="80"
  219. label="BOM版本">
  220. </el-table-column>
  221. <el-table-column
  222. prop="alternativeNo"
  223. header-align="left"
  224. align="left"
  225. min-width="80"
  226. label="替代编码">
  227. </el-table-column>
  228. <el-table-column
  229. prop="alternativeDescription"
  230. header-align="left"
  231. align="left"
  232. min-width="80"
  233. label="替代名称">
  234. </el-table-column>
  235. <el-table-column
  236. prop="status"
  237. header-align="left"
  238. align="left"
  239. min-width="60"
  240. label="状态">
  241. </el-table-column>
  242. <el-table-column
  243. prop="effPhaseInDate"
  244. header-align="left"
  245. align="left"
  246. min-width="80"
  247. label="生效日期">
  248. </el-table-column>
  249. <el-table-column
  250. prop="effPhaseOutDate"
  251. header-align="left"
  252. align="left"
  253. min-width="80"
  254. label="失效日期">
  255. </el-table-column>
  256. </el-table>
  257. <el-footer style="height:30px;margin-top:20px;text-align:center">
  258. <el-button type="primary" @click="updateBMBomRev()">确定</el-button>
  259. <el-button type="primary" @click="modalFlag=false">取消</el-button>
  260. </el-footer>
  261. </el-dialog>
  262. <!-- 提交 -->
  263. <el-dialog title="驳回" top="30vh" :close-on-click-modal="false" v-drag :visible.sync="submitModalFlag" width="500px">
  264. <el-form :inline="true" label-position="top">
  265. <el-form-item :label="'驳回意见'">
  266. <el-input type="textarea" v-model="rejectOpinion" :rows="3" resize='none' show-word-limit style="width: 479px;height: 30px"></el-input>
  267. </el-form-item>
  268. </el-form>
  269. <el-footer style="height:30px;margin-top: 50px;text-align:center">
  270. <el-button type="primary" @click="rejectSubmit">确定</el-button>
  271. <el-button type="primary" @click="submitModalFlag = false">取消</el-button>
  272. </el-footer>
  273. </el-dialog>
  274. <el-dialog title="UL文件号/UL Product Model" top="17vh" :close-on-click-modal="false" v-drag :visible.sync="urlFileFlag" width="700px">
  275. <el-form :inline="true" label-position="top" :model="searchData">
  276. <el-form-item :label="'名称'">
  277. <el-input v-model="bomData.urlFile" clearable style="width: 370px"></el-input>
  278. </el-form-item>
  279. <el-form-item :label="' '">
  280. <el-button type="primary" @click="queryUrlFile">查询</el-button>
  281. </el-form-item>
  282. </el-form>
  283. <el-table
  284. :height="250"
  285. :data="urlFileList"
  286. border
  287. @row-dblclick="getRowData"
  288. style="width: 100%;">
  289. <el-table-column
  290. v-for="(item,index) in urlFileColumnList" :key="index"
  291. :sortable="item.columnSortable"
  292. :prop="item.columnProp"
  293. :header-align="item.headerAlign"
  294. :show-overflow-tooltip="item.showOverflowTooltip"
  295. :align="item.align"
  296. :fixed="item.fixed==''?false:item.fixed"
  297. :min-width="item.columnWidth"
  298. :label="item.columnLabel">
  299. <template slot-scope="scope">
  300. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  301. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  302. </template>
  303. </el-table-column>
  304. </el-table>
  305. <!-- 分页插件 -->
  306. <el-pagination
  307. style="margin-top: 5px"
  308. @size-change="sizeChangeHandle"
  309. @current-change="currentChangeHandle"
  310. :current-page="pageIndex"
  311. :page-sizes="[20, 50, 100, 200, 500]"
  312. :page-size="pageSize"
  313. :total="totalPage"
  314. layout="total, sizes, prev, pager, next, jumper">
  315. </el-pagination>
  316. <el-footer style="height:35px;margin-top:10px;text-align:center">
  317. <el-button type="primary" @click="urlFileFlag = false">关闭</el-button>
  318. </el-footer>
  319. </el-dialog>
  320. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  321. </div>
  322. </template>
  323. <script>
  324. import {
  325. searchBMBom,
  326. searchBMBomDetail,
  327. updateBMBomRev,
  328. tsdBasicInformationSearch,
  329. getBMStatusDesc,
  330. submitChange, // 提交
  331. getOADetailForBM,
  332. updateBMProcessBom, // 保存数据
  333. } from "@/api/sampleManagement/technicalSpecificationList.js"
  334. import {
  335. getNodeAuthority, // 获取节点权限
  336. } from '@/api/changeManagement/changeManagement.js'
  337. import Chooselist from '@/views/modules/common/Chooselist'
  338. import DictDataSelect from "../../sys/dict-data-select-highlight";
  339. import {verifyData} from "../../../../api/chooselist/chooselist";
  340. import {queryWorkCenterList} from "../../../../api/part/workCenter";
  341. import {
  342. queryFileUrl,
  343. queryUrlFile,
  344. queryUrlFileList
  345. } from "../../../../api/sampleManagement/technicalSpecificationList";
  346. export default {
  347. components: {
  348. DictDataSelect,
  349. Chooselist
  350. },
  351. data() {
  352. return {
  353. pageIndex: 1,
  354. pageSize: 20,
  355. totalPage: 0,
  356. superAdmin:false,
  357. modalFlag:false,
  358. bomFlag:false,
  359. urlFileFlag:false,
  360. height:200,
  361. searchData: {
  362. site: '',
  363. username: this.$store.state.user.name,
  364. codeNo: '',
  365. buNo:'',
  366. fieldId:'',
  367. dictLabel: '',
  368. dictType: ''
  369. },
  370. bomData:{
  371. site: '',
  372. partNo:'',
  373. alternativeNo:'',
  374. bomType:'',
  375. engChgLevel:'',
  376. urlFile: ''
  377. },
  378. componentRules:{
  379. urlFile: [
  380. {
  381. required: true,
  382. message: ' ',
  383. trigger: ['blur', 'change']
  384. }
  385. ],
  386. },
  387. currentRow:"",
  388. bomList:[],
  389. urlFileList:[],
  390. bomDetailList:[],
  391. columnList1: [
  392. {
  393. userId: this.$store.state.user.name,
  394. functionId: 104002,
  395. serialNumber: '104002Table2LineSequence',
  396. tableId: '104002Table2',
  397. tableName: 'BOM子物料表',
  398. columnProp: 'lineSequence',
  399. headerAlign: 'center',
  400. align: 'center',
  401. columnLabel: '序号/Item No.',
  402. columnHidden: false,
  403. columnImage: false,
  404. columnSortable: false,
  405. sortLv: 0,
  406. status: true,
  407. fixed: '',
  408. columnWidth: 60
  409. },
  410. {
  411. userId: this.$store.state.user.name,
  412. functionId: 104002,
  413. serialNumber: '104002Table2ComponentPart',
  414. tableId: '104002Table2',
  415. tableName: 'BOM子物料表',
  416. columnProp: 'componentPart',
  417. headerAlign: 'center',
  418. align: 'center',
  419. columnLabel: '装配件料号/Component Part',
  420. columnHidden: false,
  421. columnImage: false,
  422. columnSortable: false,
  423. sortLv: 0,
  424. status: true,
  425. fixed: '',
  426. columnWidth: 120
  427. },
  428. {
  429. userId: this.$store.state.user.name,
  430. functionId: 104002,
  431. serialNumber: '104002Table2ComponentPartDesc',
  432. tableId: '104002Table2',
  433. tableName: 'BOM子物料表',
  434. columnProp: 'componentPartDesc',
  435. headerAlign: 'center',
  436. align: 'left',
  437. columnLabel: '描述/Description',
  438. columnHidden: false,
  439. columnImage: false,
  440. columnSortable: false,
  441. sortLv: 0,
  442. status: true,
  443. fixed: '',
  444. columnWidth: 160
  445. },
  446. {
  447. userId: this.$store.state.user.name,
  448. functionId: 104002,
  449. serialNumber: '104002Table2QtyPerAssembly',
  450. tableId: '104002Table2',
  451. tableName: 'BOM子物料表',
  452. columnProp: 'qtyPerAssembly',
  453. headerAlign: 'center',
  454. align: 'right',
  455. columnLabel: '单位用量/Quantity Per Assembly',
  456. columnHidden: false,
  457. columnImage: false,
  458. columnSortable: false,
  459. sortLv: 0,
  460. status: true,
  461. fixed: '',
  462. columnWidth: 140
  463. },
  464. {
  465. userId: this.$store.state.user.name,
  466. functionId: 104002,
  467. serialNumber: '104002Table2ComponentScrap',
  468. tableId: '104002Table2',
  469. tableName: 'BOM子物料表',
  470. columnProp: 'componentScrap',
  471. headerAlign: 'center',
  472. align: 'right',
  473. columnLabel: '调机料/Component Scrap',
  474. columnHidden: false,
  475. columnImage: false,
  476. columnSortable: false,
  477. sortLv: 0,
  478. status: true,
  479. fixed: '',
  480. columnWidth: 80
  481. },
  482. {
  483. userId: this.$store.state.user.name,
  484. functionId: 104002,
  485. serialNumber: '104002Table2ShrinkageFactor',
  486. tableId: '104002Table2',
  487. tableName: 'BOM子物料表',
  488. columnProp: 'shrinkageFactor',
  489. headerAlign: 'center',
  490. align: 'right',
  491. columnLabel: '损耗率/Scrap Factor(%)',
  492. columnHidden: false,
  493. columnImage: false,
  494. columnSortable: false,
  495. sortLv: 0,
  496. status: true,
  497. fixed: '',
  498. columnWidth: 80
  499. },
  500. {
  501. userId: this.$store.state.user.name,
  502. functionId: 104002,
  503. serialNumber: '104002Table2PrintUnitName',
  504. tableId: '104002Table2',
  505. tableName: 'BOM子物料表',
  506. columnProp: 'printUnit',
  507. headerAlign: 'center',
  508. align: 'center',
  509. columnLabel: '单位/Unit',
  510. columnHidden: false,
  511. columnImage: false,
  512. columnSortable: false,
  513. sortLv: 0,
  514. status: true,
  515. fixed: '',
  516. columnWidth: 60
  517. },
  518. {
  519. userId: this.$store.state.user.name,
  520. functionId: 104002,
  521. serialNumber: '104002Table2IssueType',
  522. tableId: '104002Table2',
  523. tableName: 'BOM子物料表',
  524. columnProp: 'issueType',
  525. headerAlign: 'center',
  526. align: 'center',
  527. columnLabel: '发料方式/Reserve/Issue Method',
  528. columnHidden: false,
  529. columnImage: false,
  530. columnSortable: false,
  531. sortLv: 0,
  532. status: true,
  533. fixed: '',
  534. columnWidth: 80
  535. },
  536. {
  537. userId: this.$store.state.user.name,
  538. functionId: 104002,
  539. serialNumber: '104002Table2OperationDesc',
  540. tableId: '104002Table2',
  541. tableName: 'BOM子物料表',
  542. columnProp: 'operationId',
  543. headerAlign: 'center',
  544. align: 'center',
  545. columnLabel: '工序号/Operation',
  546. columnHidden: false,
  547. columnImage: false,
  548. columnSortable: false,
  549. sortLv: 0,
  550. status: true,
  551. fixed: '',
  552. columnWidth: 80
  553. },
  554. {
  555. userId: this.$store.state.user.name,
  556. functionId: 104002,
  557. serialNumber: '104002Table2IssueToLoc',
  558. tableId: '104002Table2',
  559. tableName: 'BOM子物料表',
  560. columnProp: 'issueToLocName',
  561. headerAlign: 'center',
  562. align: 'center',
  563. columnLabel: '发料库位/Issue From Loc.',
  564. columnHidden: false,
  565. columnImage: false,
  566. columnSortable: false,
  567. sortLv: 0,
  568. status: true,
  569. fixed: '',
  570. columnWidth: 80
  571. },
  572. {
  573. userId: this.$store.state.user.name,
  574. functionId: 104002,
  575. serialNumber: '104002Table2NoteText',
  576. tableId: '104002Table2',
  577. tableName: 'BOM子物料表',
  578. columnProp: 'noteText',
  579. headerAlign: 'center',
  580. align: 'left',
  581. columnLabel: '备注/Comments',
  582. columnHidden: false,
  583. columnImage: false,
  584. columnSortable: false,
  585. sortLv: 0,
  586. status: true,
  587. fixed: '',
  588. columnWidth: 150
  589. },
  590. ],
  591. urlFileColumnList: [
  592. {
  593. userId: this.$store.state.user.name,
  594. tableName: '字典数据表',
  595. columnProp: 'dictLabel',
  596. headerAlign: "center",
  597. align: "left",
  598. columnLabel: '名称',
  599. columnHidden: false,
  600. columnImage: false,
  601. status: true,
  602. fixed: '',
  603. columnWidth: 100
  604. },
  605. // {
  606. // userId: this.$store.state.user.name,
  607. // tableName: '字典数据表',
  608. // columnProp: 'dictValue',
  609. // headerAlign: "center",
  610. // align: "left",
  611. // columnLabel: '值',
  612. // columnHidden: false,
  613. // columnImage: false,
  614. // status: true,
  615. // fixed: '',
  616. // columnWidth: 100
  617. // },
  618. ],
  619. baseForm:{
  620. status:'',
  621. isReject:'',
  622. },
  623. spForm:{
  624. sp:'',
  625. nodeName:'',
  626. },
  627. ifDisableFlag:false,
  628. rejectOpinion: '',
  629. submitModalFlag: false,
  630. }
  631. },
  632. mounted () {
  633. this.$nextTick(() => {
  634. this.height = window.innerHeight - 100
  635. })
  636. },
  637. methods: {
  638. // 获取基础数据列表S
  639. getBaseList (val, type) {
  640. this.tagNo = val
  641. this.tagNo1 = type
  642. this.$nextTick(() => {
  643. let strVal = ''
  644. if (val === 1013) {
  645. if(type==1) {
  646. strVal = this.dataForm.partType
  647. }
  648. }
  649. this.$refs.baseList.init(val, strVal)
  650. })
  651. },
  652. /* 列表方法的回调 */
  653. getBaseData (val) {
  654. if (this.tagNo === 1013) {
  655. if(this.tagNo1==1) {
  656. this.dataForm.partType = val.Base_id
  657. this.dataForm.partTypeDesc = val.Base_desc
  658. }
  659. }
  660. },
  661. choosePart(row){
  662. this.dataForm.erpPartNo=row.erpPartNo
  663. this.dataForm.familyId=row.familyId
  664. this.dataForm.familyName=row.familyName
  665. this.dataForm.partDesc=row.partDesc
  666. this.dataForm.spec=row.spec
  667. this.partModelFlag=false;
  668. },
  669. //初始化组件的参数
  670. init (inData) {
  671. if (this.searchData.codeNo != null && this.searchData.codeNo != '') {
  672. return false;
  673. }
  674. // 初始化参数
  675. this.searchData = JSON.parse(JSON.stringify(inData))
  676. if (this.searchData.ifDisableFlag) {
  677. this.ifDisableFlag = true
  678. }
  679. // 刷新表格
  680. this.searchTable()
  681. },
  682. searchTable (type) {
  683. getOADetailForBM(this.searchData).then(({data}) => {
  684. this.spForm.nodeName = data.row.nodeName
  685. this.spForm.sp = data.row.sp == null ? '' : data.row.sp
  686. })
  687. searchBMBom(this.searchData).then(({data}) => {
  688. if (data&& data.code === 0) {
  689. this.bomList = data.rows
  690. this.bomData = data.row
  691. if (type) {
  692. this.$message.success( '操作成功')
  693. }
  694. } else {
  695. this.$message.error(data.msg)
  696. }
  697. })
  698. tsdBasicInformationSearch(this.searchData).then(({data}) => {
  699. this.baseForm=data.row;
  700. this.bomData.site=data.row.site
  701. this.bomData.partNo=data.row.finalPartNo
  702. this.bomData.urlFile=data.row.urlFile
  703. this.getNodeAuthority(data.row)
  704. })
  705. },
  706. searchDetailTable () {
  707. searchBMBomDetail(this.bomData).then(({data}) => {
  708. this.bomDetailList = data.rows
  709. })
  710. },
  711. changeBomRev () {
  712. this.searchDetailTable()
  713. this.currentRow = null
  714. this.modalFlag = true
  715. },
  716. getRow (row) {
  717. this.currentRow = row
  718. },
  719. updateBMBomRev () {
  720. if (this.currentRow == null) {
  721. this.$alert('请点击选择BOM版本!', '错误', {
  722. confirmButtonText: '确定'
  723. })
  724. return false;
  725. }
  726. if (this.currentRow.status !== 'Buildable') {
  727. this.$alert('只有Buildable状态的可以保存!', '错误', {
  728. confirmButtonText: '确定'
  729. })
  730. return false;
  731. }
  732. let inData = {
  733. site: this.bomData.site,
  734. codeNo: this.searchData.codeNo,
  735. bomType: this.currentRow.bomType,
  736. engChgLevel: this.currentRow.engChgLevel,
  737. bomAlternativeNo: this.currentRow.alternativeNo,
  738. urlFile: this.currentRow.urlFile,
  739. }
  740. updateBMBomRev(inData).then(({data})=>{
  741. if(data&& data.code===0){
  742. this.searchTable();
  743. this.modalFlag=false;
  744. this.$message.success( '操作成功')
  745. } else {
  746. this.$message.error(data.msg)
  747. }
  748. })
  749. },
  750. jumpBom () {
  751. if (this.bomData.engChgLevel != null || this.bomData.engChgLevel !== '') {
  752. this.$message.error("bom明细不存在")
  753. }
  754. let inData = {
  755. site: this.searchData.site,
  756. partNo: this.bomData.partNo,
  757. bomType: this.bomData.bomType,
  758. engChgLevel: this.bomData.engChgLevel,
  759. urlFile: this.bomData.urlFile,
  760. }
  761. localStorage.setItem('bomData', JSON.stringify(inData))
  762. window.open('#/part-bomManagement')
  763. },
  764. jumpPeifang (row) {
  765. let inData = {
  766. site: row.site,
  767. partNo: row.componentPart,
  768. bomType: 'Manufacturing',
  769. }
  770. localStorage.setItem('recipeData', JSON.stringify(inData))
  771. window.open('#/part-recipeManagement')
  772. },
  773. // 获取流程的配置权限
  774. getNodeAuthority (row) {
  775. getBMStatusDesc(this.searchData).then(({data}) => {
  776. this.superAdmin=data.superAdmin
  777. if(data.superAdmin){
  778. this.ifDisableFlag = false
  779. return false
  780. }
  781. if (data.status === '已完成' || data.status === '已升版' || data.status === 'Dead') {
  782. this.ifDisableFlag = true
  783. return false
  784. }
  785. if(data.status === '审批中') {
  786. let tempData = {
  787. site: row.site,
  788. stepId: row.stepId,
  789. menuId: '103002'
  790. }
  791. getNodeAuthority(tempData).then(({data}) => {
  792. if (data && data.code === 0) {
  793. this.ifDisableFlag = true
  794. let plmStepRoleBaseBm = data.rows.plm_stepRole_base_bm
  795. let arr = plmStepRoleBaseBm.filter(a => a.fieldId === this.searchData.fieldId)
  796. if (arr.length > 0) {
  797. if (arr[0].updateFlag === 'N') {
  798. this.ifDisableFlag = true
  799. } else {
  800. this.ifDisableFlag = false
  801. }
  802. } else {
  803. this.ifDisableFlag = true
  804. }
  805. }
  806. })
  807. }
  808. })
  809. },
  810. // 修改表单数据
  811. updateBMProcess () {
  812. let inData = {
  813. site: this.bomData.site,
  814. codeNo: this.searchData.codeNo,
  815. urlFile: this.bomData.urlFile
  816. }
  817. updateBMProcessBom(inData).then(({data})=>{
  818. if (data&& data.code === 0) {
  819. this.searchTable()
  820. this.$message.success( '操作成功')
  821. } else {
  822. this.$message.error(data.msg)
  823. }
  824. })
  825. },
  826. // 同意提交
  827. agreeSubmit () {
  828. this.$confirm(`是否确认提交?`, '提示', {
  829. confirmButtonText: '确定',
  830. cancelButtonText: '取消',
  831. type: 'warning'
  832. }).then(() => {
  833. let tempData = {
  834. site: this.searchData.site,
  835. userName: this.$store.state.user.name,
  836. codeNo: this.searchData.codeNo,
  837. menuId: '103002',
  838. nodeConclusion: 'Y'
  839. }
  840. this.submitData(tempData)
  841. })
  842. },
  843. // 驳回提交
  844. rejectSubmit () {
  845. this.$confirm(`是否确认驳回?`, '提示', {
  846. confirmButtonText: '确定',
  847. cancelButtonText: '取消',
  848. type: 'warning'
  849. }).then(() => {
  850. let tempData = {
  851. site: this.searchData.site,
  852. userName: this.$store.state.user.name,
  853. codeNo: this.searchData.codeNo,
  854. menuId: '103002',
  855. nodeConclusion: 'N',
  856. rejectOpinion : this.rejectOpinion
  857. }
  858. this.submitData(tempData)
  859. })
  860. },
  861. submitData (tempData) {
  862. submitChange(tempData).then(({data}) => {
  863. if (data && data.code === 0) {
  864. this.submitModalFlag = false
  865. // this.searchTable();
  866. window.location.reload();
  867. this.$message({message: '操作成功', type: 'success'})
  868. } else {
  869. this.$alert(data.msg, '错误', {
  870. confirmButtonText: '确定'
  871. })
  872. }
  873. })
  874. },
  875. // 打开提交模态框
  876. submitDataModal () {
  877. this.rejectOpinion = ''
  878. this.submitModalFlag = true
  879. },
  880. queryUrlFile(){
  881. this.searchData.limit = this.pageSize
  882. this.searchData.page = this.pageIndex
  883. this.searchData.dictType = 'bm_url_file'
  884. this.searchData.dictLabel = this.bomData.urlFile
  885. queryUrlFileList(this.searchData).then(({data}) => {
  886. if (data && data.code === 0) {
  887. this.urlFileList = data.page.list
  888. this.pageIndex = 1
  889. this.pageSize = data.page.pageSize
  890. this.totalPage = data.page.totalCount
  891. } else {
  892. this.urlFileList = []
  893. }
  894. })
  895. this.urlFileFlag = true
  896. },
  897. sizeChangeHandle(val) {
  898. this.pageSize = val
  899. this.pageIndex = 1
  900. this.queryUrlFile()
  901. },
  902. currentChangeHandle(val) {
  903. this.pageIndex = val
  904. this.queryUrlFile()
  905. },
  906. getRowData(row) {
  907. this.bomData.urlFile = row.dictLabel
  908. this.urlFileFlag = false
  909. },
  910. },
  911. }
  912. </script>
  913. <style scoped>
  914. input[readonly] {
  915. cursor: text;
  916. }
  917. </style>