edit.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787
  1. <template>
  2. <div class="ele-body">
  3. <el-card :body-style="{ padding: 0 }">
  4. <div class="page-container equipment-container">
  5. <div class="page-title basic-details-title">
  6. <el-page-header @back="$router.go(-1)">
  7. <div slot="content" class="pageContent">
  8. <div>编辑模具信息</div>
  9. </div>
  10. </el-page-header>
  11. <div>
  12. <el-button size="small" @click="$router.go(-1)">取消</el-button>
  13. <el-button
  14. size="small"
  15. type="primary"
  16. @click="toSave"
  17. v-loading="btnLoading"
  18. >确定</el-button
  19. >
  20. </div>
  21. </div>
  22. <div class="content">
  23. <el-form label-width="100px">
  24. <basicInfoVue ref="basicInfoVueRef" />
  25. <div class="basic-details-title border-none">
  26. <span class="border-span">资产信息</span>
  27. </div>
  28. <el-descriptions
  29. title=""
  30. :column="4"
  31. size="medium"
  32. border
  33. style="edit"
  34. >
  35. <el-descriptions-item>
  36. <template slot="label"> 模具编码 </template>
  37. <el-form-item label-width="0">
  38. <el-input size="small" v-model="info.mouldCode"></el-input>
  39. </el-form-item>
  40. </el-descriptions-item>
  41. <el-descriptions-item>
  42. <template slot="label"> 固资编码 </template>
  43. <el-form-item label-width="0">
  44. <el-input size="small" v-model="info.fixCode"></el-input>
  45. </el-form-item>
  46. </el-descriptions-item>
  47. <el-descriptions-item>
  48. <template slot="label"> 编号 </template>
  49. <el-form-item label-width="0">
  50. <el-input size="small" v-model="info.codeNumber"></el-input>
  51. </el-form-item>
  52. </el-descriptions-item>
  53. <el-descriptions-item>
  54. <template slot="label"> 已冲压次数 </template>
  55. <el-form-item label-width="0">
  56. <el-input size="small" v-model="info.startCyTimes"></el-input>
  57. </el-form-item>
  58. </el-descriptions-item>
  59. <el-descriptions-item>
  60. <template slot="label"> 权属部门 </template>
  61. <el-form-item label-width="0">
  62. <ele-tree-select
  63. clearable
  64. :data="treeData"
  65. v-model="info.ownershipGroupId"
  66. placeholder="请选择"
  67. default-expand-all
  68. labelKey="name"
  69. valueKey="id"
  70. />
  71. </el-form-item>
  72. </el-descriptions-item>
  73. </el-descriptions>
  74. <div class="basic-details-title border-none">
  75. <span class="border-span">模具信息</span>
  76. </div>
  77. <el-descriptions title="" :column="4" size="medium" border>
  78. <el-descriptions-item>
  79. <template slot="label"> 收缩系数</template>
  80. {{
  81. categoryMold.shrinkEffictive
  82. ? categoryMold.shrinkEffictive + '%'
  83. : null
  84. }}
  85. </el-descriptions-item>
  86. <el-descriptions-item>
  87. <template slot="label"> 芯杆数量 </template>
  88. {{ categoryMold.coreBarNum }}
  89. </el-descriptions-item>
  90. <el-descriptions-item>
  91. <template slot="label"> 模孔数量</template>
  92. {{ categoryMold.dieHoleNum }}
  93. </el-descriptions-item>
  94. <el-descriptions-item>
  95. <template slot="label"> 上冲头数量</template>
  96. {{ categoryMold.upperPunchNum }}
  97. </el-descriptions-item>
  98. <el-descriptions-item>
  99. <template slot="label"> 下冲头数量</template>
  100. {{ categoryMold.downPunchNum }}
  101. </el-descriptions-item>
  102. <el-descriptions-item>
  103. <template slot="label"> 最大冲压次数</template>
  104. {{ categoryMold.maxCyTimes }}
  105. </el-descriptions-item>
  106. <el-descriptions-item>
  107. <template slot="label"> 大模体型号 </template>
  108. {{ categoryMold.maxMoldType }}
  109. </el-descriptions-item>
  110. <el-descriptions-item>
  111. <template slot="label"> 芯棒直径 </template>
  112. {{ categoryMold.mandrelDiameter }}
  113. </el-descriptions-item>
  114. </el-descriptions>
  115. <div class="basic-details-title border-none">
  116. <span class="border-span">仓储配置</span>
  117. </div>
  118. <el-descriptions title="" :column="4" size="medium" border>
  119. <el-descriptions-item>
  120. <template slot="label"> 启用库存预警</template>
  121. {{ dictType[categoryWms.isWarn] }}
  122. </el-descriptions-item>
  123. <el-descriptions-item>
  124. <template slot="label">允许拆包</template>
  125. {{ dictType[categoryWms.isUnpack] }}
  126. </el-descriptions-item>
  127. <el-descriptions-item>
  128. <template slot="label">安全库存</template>
  129. {{ categoryWms.secureInventory }}
  130. </el-descriptions-item>
  131. <el-descriptions-item>
  132. <template slot="label">最小库存</template>
  133. {{ categoryWms.minInventory }}
  134. </el-descriptions-item>
  135. <el-descriptions-item>
  136. <template slot="label"> 最大库存</template>
  137. {{ categoryWms.maxInventory }}
  138. </el-descriptions-item>
  139. <el-descriptions-item>
  140. <template slot="label">盘点模式</template>
  141. {{ dictPd[categoryWms.inventoryMode] }}
  142. </el-descriptions-item>
  143. <el-descriptions-item>
  144. <template slot="label">质保预警参考</template>
  145. <!-- <DictSelection
  146. dictName="质保预警参考"
  147. clearable
  148. v-model="categoryWms.warrantyWarnRefer"
  149. >
  150. </DictSelection> -->
  151. {{ categoryWms.warrantyWarnRefer }}
  152. </el-descriptions-item>
  153. <el-descriptions-item>
  154. <template slot="label">保质期</template>
  155. {{
  156. categoryWms.warrantyPeriod
  157. ? categoryWms.warrantyPeriod + '/'
  158. : null
  159. }}{{ categoryWms.warrantyPeriodUnit }}
  160. </el-descriptions-item>
  161. </el-descriptions>
  162. <div class="basic-details-title border-none">
  163. <span class="border-span">生产信息</span>
  164. </div>
  165. <el-descriptions title="" :column="4" size="medium" border>
  166. <el-descriptions-item>
  167. <template slot="label"> 是否齐套件</template>
  168. {{ dictType[categoryMes.isCompleteSet] }}
  169. </el-descriptions-item>
  170. <el-descriptions-item>
  171. <template slot="label">消耗波动</template>
  172. {{
  173. categoryMes.consumWave ? categoryMes.consumWave + '%' : null
  174. }}
  175. </el-descriptions-item>
  176. <el-descriptions-item>
  177. <template slot="label">变动损耗率</template>
  178. {{
  179. categoryMes.changeLossRate
  180. ? categoryMes.changeLossRate + '%'
  181. : null
  182. }}
  183. </el-descriptions-item>
  184. <el-descriptions-item>
  185. <template slot="label">固定损耗数</template>
  186. {{ categoryMes.fixLossNum }}
  187. </el-descriptions-item>
  188. <el-descriptions-item>
  189. <template slot="label">排程类型</template>
  190. {{ categoryMes.apsType }}
  191. </el-descriptions-item>
  192. <el-descriptions-item>
  193. <template slot="label">允许改型</template>
  194. {{ dictType[categoryMes.isModify] }}
  195. </el-descriptions-item>
  196. <el-descriptions-item>
  197. <template slot="label">允许返工返修</template>
  198. {{ dictType[categoryMes.isRework] }}
  199. </el-descriptions-item>
  200. <el-descriptions-item>
  201. <template slot="label">是否返回料</template>
  202. {{ dictType[categoryMes.isRematerial] }}
  203. </el-descriptions-item>
  204. <el-descriptions-item>
  205. <template slot="label">是否副产品</template>
  206. {{ dictType[categoryMes.isByProduct] }}
  207. </el-descriptions-item>
  208. <el-descriptions-item>
  209. <template slot="label">是否废品</template>
  210. {{ dictType[categoryMes.isWaste] }}
  211. </el-descriptions-item>
  212. <el-descriptions-item>
  213. <template slot="label">是否不良品</template>
  214. {{ dictType[categoryMes.isDefective] }}
  215. </el-descriptions-item>
  216. </el-descriptions>
  217. <div class="basic-details-title border-none">
  218. <span class="border-span">计划</span>
  219. </div>
  220. <el-descriptions title="" :column="4" size="medium" border>
  221. <el-descriptions-item>
  222. <template slot="label">固定提前期</template>
  223. {{ categoryAps.fixLeadTime }}
  224. </el-descriptions-item>
  225. <el-descriptions-item>
  226. <template slot="label">变动提前期</template>
  227. {{ categoryAps.changeLeadTime }}
  228. </el-descriptions-item>
  229. <el-descriptions-item>
  230. <template slot="label">检验提前期</template>
  231. {{ categoryAps.checkLeadTime }}
  232. </el-descriptions-item>
  233. <el-descriptions-item>
  234. <template slot="label">累计提前期</template>
  235. {{ categoryAps.cumLeadTime }}
  236. </el-descriptions-item>
  237. <el-descriptions-item>
  238. <template slot="label">提前期单位</template>
  239. {{ categoryAps.unit }}
  240. </el-descriptions-item>
  241. <el-descriptions-item>
  242. <template slot="label">订货间隔期</template>
  243. {{
  244. categoryAps.orderIntervalTime
  245. ? categoryAps.orderIntervalTime + '/'
  246. : null
  247. }}{{ categoryAps.orderIntervalUnit }}
  248. </el-descriptions-item>
  249. </el-descriptions>
  250. <div class="basic-details-title border-none">
  251. <span class="border-span">质量配置</span>
  252. </div>
  253. <el-descriptions title="" :column="4" size="medium" border>
  254. <el-descriptions-item>
  255. <template slot="label">是否来料检验</template>
  256. {{ dictType[categoryQms.isComeCheck] }}
  257. </el-descriptions-item>
  258. <el-descriptions-item>
  259. <template slot="label">检验方案</template>
  260. {{ categoryQms.checkFormula }}
  261. </el-descriptions-item>
  262. <el-descriptions-item>
  263. <template slot="label">采购组织</template>
  264. {{ cgInfo.groupName }}
  265. </el-descriptions-item>
  266. <el-descriptions-item>
  267. <template slot="label">采购员</template>
  268. {{ cgInfo.name }}
  269. </el-descriptions-item>
  270. </el-descriptions>
  271. <div class="basic-details-title border-none">
  272. <span class="border-span">备注信息</span>
  273. </div>
  274. <el-descriptions title="" :column="4" size="medium" border>
  275. <el-descriptions-item>
  276. <template slot="label">附件信息</template>
  277. {{ categoryObj.fileName }}
  278. </el-descriptions-item>
  279. <el-descriptions-item>
  280. <template slot="label">备注</template>
  281. {{ categoryObj.remark }}
  282. </el-descriptions-item>
  283. </el-descriptions>
  284. <div class="basic-details-title border-none">
  285. <span class="border-span">关联信息</span>
  286. </div>
  287. <linkMsg
  288. ref="linkMsgRef"
  289. :id="categoryObj.id"
  290. :categoryLevelId="categoryObj.categoryLevelId"
  291. :categoryLevelGroupId="categoryObj.categoryLevelGroupId"
  292. />
  293. <div class="basic-details-title border-none">
  294. <span class="border-span">文档信息</span>
  295. </div>
  296. <!-- <div class="basic-details-title border-none">
  297. <span class="border-span">文档信息</span>
  298. </div> -->
  299. <div class="upload-container">
  300. <WithView v-model="imageUrl" :limit="1" :assetName="`模具`" />
  301. <div class="file-list">
  302. <div>
  303. <el-form-item prop="image" label="使用说明书">
  304. <fileUpload
  305. v-model="attUrl.operatingManual.value"
  306. module="main"
  307. :showLib="true"
  308. />
  309. </el-form-item>
  310. </div>
  311. <div>
  312. <el-form-item prop="image" label="生产许可证书">
  313. <fileUpload
  314. v-model="attUrl.productionLicence.value"
  315. module="main"
  316. :showLib="true"
  317. />
  318. </el-form-item>
  319. </div>
  320. <div>
  321. <el-form-item prop="image" label="防爆合格证书">
  322. <fileUpload
  323. v-model="attUrl.explosionProofCertificate.value"
  324. module="main"
  325. :showLib="true"
  326. />
  327. </el-form-item>
  328. </div>
  329. <div>
  330. <el-form-item prop="image" label="检验报告">
  331. <fileUpload
  332. v-model="attUrl.surveyReport.value"
  333. module="main"
  334. :showLib="true"
  335. />
  336. </el-form-item>
  337. </div>
  338. <div>
  339. <el-form-item prop="image" label="检验周期说明">
  340. <fileUpload
  341. v-model="attUrl.inspectionCycleManual.value"
  342. module="main"
  343. :showLib="true"
  344. />
  345. </el-form-item>
  346. </div>
  347. <div>
  348. <el-form-item prop="image" label="图纸资料">
  349. <fileUpload
  350. v-model="attUrl.informationDrawing.value"
  351. module="main"
  352. :showLib="true"
  353. />
  354. </el-form-item>
  355. </div>
  356. <div>
  357. <el-form-item prop="image" label="产品合格证">
  358. <fileUpload
  359. v-model="attUrl.productCertificate.value"
  360. module="main"
  361. :showLib="true"
  362. />
  363. </el-form-item>
  364. </div>
  365. </div>
  366. </div>
  367. </el-form>
  368. <div class="basic-details-title border-none">
  369. <span class="border-span">扩展信息</span>
  370. </div>
  371. <el-row>
  372. <el-form
  373. :model="itemForm"
  374. :rules="customRule"
  375. ref="formCustom"
  376. class="row-form"
  377. >
  378. <el-col
  379. :span="8"
  380. v-for="(item, index) in itemForm.addList"
  381. :key="index"
  382. >
  383. <el-form-item
  384. :prop="'addList.' + index + '.key'"
  385. :rules="{
  386. required: true,
  387. message: '自定义参数名称不能为空',
  388. trigger: 'blur'
  389. }"
  390. >
  391. <div class="add-col">
  392. <el-input
  393. class="col-input"
  394. v-model="item.key"
  395. placeholder="参数名称"
  396. ></el-input>
  397. <el-input
  398. class="col-input"
  399. v-model="item.value"
  400. placeholder="参数值"
  401. ></el-input>
  402. <el-button type="text" @click="delt(item, index)">
  403. 删除
  404. </el-button>
  405. </div>
  406. </el-form-item>
  407. </el-col>
  408. <el-col :span="8" v-if="itemForm.addList.length < 10">
  409. <el-form-item label-width="20px">
  410. <el-button type="primary" @click="addItem"
  411. >增加自定义参数</el-button
  412. >
  413. </el-form-item>
  414. </el-col>
  415. </el-form>
  416. </el-row>
  417. </div>
  418. </div>
  419. </el-card>
  420. </div>
  421. </template>
  422. <script>
  423. import { getAssetInfo, saveOrEdit } from '@/api/ledgerAssets';
  424. import { listOrganizations } from '@/api/system/organization';
  425. import fileUpload from '@/components/upload/fileUpload';
  426. import WithView from '@/components/upload/WithView';
  427. import imgUpload from '@/components/upload/imgUpload';
  428. import { sysDict } from '@/utils/sys';
  429. import linkMsg from '../equipment/components/link-msg.vue';
  430. import basicInfoVue from '../components/basicInfo.vue';
  431. import { getDetailInfo } from '@/api/material/list';
  432. import { getUserPage } from '@/api/system/organization';
  433. export default {
  434. components: {
  435. WithView,
  436. fileUpload,
  437. imgUpload,
  438. linkMsg,
  439. basicInfoVue
  440. },
  441. data() {
  442. return {
  443. categoryMold: {},
  444. cgInfo: {},
  445. categoryQms: {},
  446. categoryAps: {},
  447. categoryMes: {},
  448. categoryWms: {},
  449. dictType: {
  450. 1: '是',
  451. 0: '否'
  452. },
  453. dictPd: {
  454. 1: '逐个盘点',
  455. 2: '批量盘点'
  456. },
  457. categoryObj: {},
  458. formData: {},
  459. info: {
  460. baseInfo: {},
  461. extraInfo: {}
  462. },
  463. customRule: {},
  464. itemForm: {
  465. addList: []
  466. },
  467. // 图片
  468. imageUrl: null,
  469. // 文档信息
  470. attUrl: {
  471. operatingManual: {
  472. value: [],
  473. sort: 1
  474. },
  475. productionLicence: {
  476. value: [],
  477. sort: 2
  478. },
  479. explosionProofCertificate: {
  480. value: [],
  481. sort: 3
  482. },
  483. surveyReport: {
  484. value: [],
  485. sort: 4
  486. },
  487. inspectionCycleManual: {
  488. value: [],
  489. sort: 5
  490. },
  491. informationDrawing: {
  492. value: [],
  493. sort: 6
  494. },
  495. productCertificate: {
  496. value: [],
  497. sort: 7
  498. }
  499. },
  500. treeData: [],
  501. btnLoading: false
  502. };
  503. },
  504. created() {
  505. let id = this.$route.query.id;
  506. this.getDetilInfo(id);
  507. this.query();
  508. },
  509. methods: {
  510. // 树形结构数据
  511. query() {
  512. listOrganizations()
  513. .then((list) => {
  514. this.treeData = this.$util.toTreeData({
  515. data: list,
  516. idField: 'id',
  517. parentIdField: 'parentId'
  518. });
  519. })
  520. .catch((e) => {});
  521. },
  522. setImgs(type, sort, info) {
  523. if (info[0]) {
  524. this.attUrl[type] = info[0];
  525. this.attUrl[type].sort = sort;
  526. } else {
  527. this.attUrl[type] = null;
  528. }
  529. },
  530. // 处理文档信息
  531. setWd() {
  532. let attUrl = [];
  533. Object.entries(this.attUrl).forEach(([key, value], index) => {
  534. if (value) {
  535. attUrl.push(value);
  536. } else {
  537. attUrl.push({ sort: index + 1 });
  538. }
  539. });
  540. return attUrl;
  541. },
  542. async getDetilInfo(id) {
  543. const data = await getAssetInfo(id);
  544. if (data) {
  545. this.info = data;
  546. this.$set(this.info, 'baseInfo', data.category.category); //基础信息
  547. this.$set(this.info, 'extraInfo', data.category.categoryMold); //模具配置
  548. this.itemForm.addList = this.info.extInfoSelf
  549. ? this.info.extInfoSelf
  550. : [];
  551. if (data.attUrl && data.attUrl.length > 0) {
  552. // 文档信息
  553. Object.keys(this.attUrl).forEach((n, index) => {
  554. this.attUrl[n].value =
  555. (data.attUrl[index]?.storePath && [data.attUrl[index]]) || [];
  556. });
  557. }
  558. // 设备图片
  559. this.imageUrl = data.imageUrl || {};
  560. this.searchMoudol(data.category.category.id);
  561. }
  562. },
  563. async searchMoudol(id) {
  564. const res = await getDetailInfo(id);
  565. console.log(res);
  566. this.categoryObj = {
  567. ...res.category,
  568. // deptId:
  569. fileName: res.category.remarkAttach
  570. ? res.category.remarkAttach.map((item) => item.name).join(', ')
  571. : ''
  572. };
  573. this.$nextTick(() => {
  574. this.$refs.basicInfoVueRef.getDetailInfoAugr(this.categoryObj);
  575. });
  576. await this.searchDeptNodeClick(res.category.deptLeaderId);
  577. for (const key in this.depList) {
  578. if (this.depList[key].id == res.category.deptId) {
  579. this.depInfo = this.depList[key];
  580. break;
  581. }
  582. }
  583. for (const key in this.depList) {
  584. if (this.depList[key].id == res.categoryQms.checkPerson) {
  585. console.log('++', this.depList[key]);
  586. this.cgInfo = this.depList[key];
  587. break;
  588. }
  589. }
  590. this.categoryWms = {
  591. ...res.categoryWms,
  592. warrantyPeriodUnit: await sysDict(
  593. '保质期单位',
  594. res.categoryWms.warrantyPeriodUnit
  595. ),
  596. warrantyWarnRefer: await sysDict(
  597. '质保预警参考',
  598. res.categoryWms.warrantyWarnRefer
  599. )
  600. };
  601. this.categoryMes = {
  602. ...res.categoryMes,
  603. apsType: await sysDict('排程类型', res.categoryMes.apsType)
  604. };
  605. this.categoryAps = {
  606. ...res.categoryAps,
  607. orderIntervalUnit: await sysDict(
  608. '提前期单位',
  609. res.categoryAps.orderIntervalUnit
  610. ),
  611. unit: await sysDict('提前期单位', res.categoryAps.unit)
  612. };
  613. this.categoryQms = {
  614. ...res.categoryQms,
  615. checkFormula: await sysDict('检验方案', res.categoryQms.checkFormula)
  616. };
  617. this.categoryMold = { ...res.categoryMold };
  618. },
  619. // 选择所属部门
  620. async searchDeptNodeClick(id, ids) {
  621. // 根据部门获取人员
  622. const res = await getUserPage({
  623. pageNum: 1,
  624. size: -1,
  625. executeGroupId: id
  626. });
  627. this.depList = res.list;
  628. },
  629. // 选择图片回调
  630. cbUploadImg(data) {
  631. if (data.length > 0) {
  632. this.imageUrl = data[0];
  633. } else {
  634. this.imageUrl = '';
  635. }
  636. },
  637. // 删除自定义参数
  638. delt(item, index) {
  639. this.itemForm.addList.splice(index, 1);
  640. },
  641. // 添加自定义参数
  642. addItem() {
  643. if (this.itemForm.addList.length < 10) {
  644. let item = { key: '', value: '' };
  645. this.itemForm.addList.push(item);
  646. } else {
  647. this.$message.warning('自定义参数最多添加10条');
  648. }
  649. },
  650. // 点击确定保存
  651. toSave() {
  652. let extendField = this.itemForm.addList;
  653. let params = {
  654. id: this.info.id,
  655. code: this.info.code,
  656. fixCode: this.info.fixCode,
  657. extInfoSelf: extendField,
  658. ownershipGroupId: this.info.ownershipGroupId,
  659. rootCategoryLevelId: this.info.rootCategoryLevelId,
  660. categoryId: this.info.categoryId,
  661. // positionIds: JSON.parse(this.info.category.categoryLevelPathId).join(','),
  662. position:
  663. typeof this.info.positionList == 'string'
  664. ? {}
  665. : this.info.positionList[0],
  666. // 文档信息
  667. attUrl: this.setWd() || [],
  668. // // 设备图片
  669. imageUrl: this.imageUrl || {}
  670. };
  671. //============================
  672. params.extInfo = {
  673. ownershipGroupId: this.info.ownershipGroupId,
  674. mouldCode: this.info.mouldCode,
  675. fixCode: this.info.fixCode,
  676. codeNumber: this.info.codeNumber,
  677. startCyTimes: this.info.startCyTimes
  678. };
  679. let obj = {};
  680. params.extInfoSelf.forEach((item) => {
  681. obj[item.key] = item.value;
  682. });
  683. params.extInfoSelf = obj;
  684. params = { ...params, ...params.extInfo };
  685. //============================
  686. this.btnLoading = true;
  687. this.$refs['formCustom'].validate((valid) => {
  688. if (valid) {
  689. saveOrEdit(params)
  690. .then((res) => {
  691. if (res) {
  692. this.$message.success('模具编辑成功');
  693. this.$router.go(-1);
  694. }
  695. })
  696. .finally(() => {
  697. this.btnLoading = false;
  698. });
  699. } else {
  700. return false;
  701. }
  702. });
  703. },
  704. // 处理文档信息
  705. setWd() {
  706. return Object.values(this.attUrl).map((item) => ({
  707. ...(item.value[0] || {}),
  708. sort: item.sort
  709. }));
  710. }
  711. }
  712. };
  713. </script>
  714. <style lang="scss" scoped>
  715. .equipment-container {
  716. background-color: #fff;
  717. padding: 20px;
  718. .content {
  719. padding: 0 20px;
  720. }
  721. .page-title {
  722. width: 100%;
  723. padding-bottom: 10px;
  724. border-bottom: 1px solid #ccc;
  725. }
  726. .basic-details-title {
  727. width: 100%;
  728. display: flex;
  729. align-items: center;
  730. justify-content: space-between;
  731. margin: 15px 0px;
  732. font-size: 16px;
  733. }
  734. .label-none {
  735. .el-form-item__content {
  736. margin-left: 0 !important;
  737. }
  738. }
  739. .upload-container {
  740. display: flex;
  741. .file-list {
  742. margin-left: 50px;
  743. flex: 1;
  744. }
  745. }
  746. .row-form {
  747. width: 100%;
  748. .add-col {
  749. display: flex;
  750. align-items: center;
  751. margin-left: 20px;
  752. .col-input {
  753. margin-right: 5px;
  754. }
  755. }
  756. }
  757. .qsbm .el-select {
  758. width: 100%;
  759. }
  760. }
  761. ::v-deep .el-descriptions {
  762. .el-form-item {
  763. margin-bottom: 0px;
  764. }
  765. }
  766. </style>