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.

954 lines
32 KiB

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