TestRunForm.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  1. <template>
  2. <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
  3. <a-row :gutter="48" slot="extra">
  4. <a-col :md="48" :sm="48">
  5. <span class="table-page-search-submitButtons" style="float: right">
  6. <a-button type="primary" @click="save()">提交</a-button>
  7. <a-button style="margin-left: 8px" @click="handleCancel()">返回</a-button>
  8. </span>
  9. </a-col>
  10. </a-row>
  11. <title-divider title="基本信息" width="90px"></title-divider>
  12. <a-form :form="form">
  13. <a-form-item v-show="false" >
  14. <a-input v-decorator="['id']" type="hidden"/>
  15. <a-input v-decorator="['parentId']" type="hidden"/>
  16. </a-form-item>
  17. <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
  18. <a-col :lg="12" :md="24" :sm="24">
  19. <a-form-item
  20. label="设备编号"
  21. :labelCol="BaseTool.Constant.labelCol"
  22. :wrapperCol="BaseTool.Constant.wrapperCol"
  23. >
  24. <a-input
  25. v-decorator="['no', {rules: [{required: true, message: '不能为空'}]}]" />
  26. </a-form-item>
  27. </a-col>
  28. <a-col :lg="12" :md="24" :sm="24">
  29. <a-form-item
  30. label="设备(旧号)"
  31. :labelCol="BaseTool.Constant.labelCol"
  32. :wrapperCol="BaseTool.Constant.wrapperCol"
  33. >
  34. <a-input
  35. v-decorator="['zbh', {rules: [{required: false, message: '不能为空'}]}]" />
  36. </a-form-item>
  37. </a-col>
  38. </a-row>
  39. <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
  40. <a-col :lg="12" :md="24" :sm="24">
  41. <a-form-item
  42. label="设备名称"
  43. :labelCol="BaseTool.Constant.labelCol"
  44. :wrapperCol="BaseTool.Constant.wrapperCol"
  45. >
  46. <a-input
  47. v-decorator="['name', {rules: [{required: true, message: '设备名称不能为空'}]}]" />
  48. </a-form-item>
  49. </a-col>
  50. <a-col :lg="12" :md="24" :sm="24">
  51. <a-form-item
  52. label="型号"
  53. :labelCol="BaseTool.Constant.labelCol"
  54. :wrapperCol="BaseTool.Constant.wrapperCol"
  55. >
  56. <a-input
  57. v-decorator="['model', {rules: [{required: true, message: '设备型号不能为空'}]}]" />
  58. </a-form-item>
  59. </a-col>
  60. </a-row>
  61. <title-divider title="试车数据记录" width="120px"></title-divider>
  62. <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
  63. <a-col :lg="12" :md="24" :sm="24">
  64. <a-form-item
  65. label="连续运转时间"
  66. :labelCol="BaseTool.Constant.labelCol"
  67. :wrapperCol="BaseTool.Constant.wrapperCol"
  68. >
  69. <a-input
  70. :rows="4"
  71. suffix="分钟"
  72. v-decorator="['fdjh']"/>
  73. </a-form-item>
  74. </a-col>
  75. <a-col :lg="12" :md="24" :sm="24">
  76. <a-form-item
  77. label="启动电流"
  78. :labelCol="BaseTool.Constant.labelCol"
  79. :wrapperCol="BaseTool.Constant.wrapperCol"
  80. >
  81. <a-input
  82. suffix="A"
  83. v-decorator="['zz']"/>
  84. </a-form-item>
  85. </a-col>
  86. </a-row>
  87. <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
  88. <a-col :lg="12" :md="24" :sm="24">
  89. <a-form-item
  90. label="压力"
  91. :labelCol="BaseTool.Constant.labelCol"
  92. :wrapperCol="BaseTool.Constant.wrapperCol"
  93. >
  94. <a-input
  95. :rows="4"
  96. suffix="进口"
  97. v-decorator="['fdjh']"/>
  98. </a-form-item>
  99. </a-col>
  100. <a-col :lg="12" :md="24" :sm="24">
  101. <a-form-item
  102. label="压力"
  103. :labelCol="BaseTool.Constant.labelCol"
  104. :wrapperCol="BaseTool.Constant.wrapperCol"
  105. >
  106. <a-input
  107. suffix="出口"
  108. v-decorator="['zz']"/>
  109. </a-form-item>
  110. </a-col>
  111. </a-row>
  112. <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
  113. <a-col :lg="12" :md="24" :sm="24">
  114. <a-form-item
  115. label="轴承温度"
  116. :labelCol="BaseTool.Constant.labelCol"
  117. :wrapperCol="BaseTool.Constant.wrapperCol"
  118. >
  119. <a-input
  120. :rows="4"
  121. suffix="前"
  122. v-decorator="['fdjh']"/>
  123. </a-form-item>
  124. </a-col>
  125. <a-col :lg="12" :md="24" :sm="24">
  126. <a-form-item
  127. label="轴承温度"
  128. :labelCol="BaseTool.Constant.labelCol"
  129. :wrapperCol="BaseTool.Constant.wrapperCol"
  130. >
  131. <a-input
  132. suffix="后"
  133. v-decorator="['zz']"/>
  134. </a-form-item>
  135. </a-col>
  136. </a-row>
  137. <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
  138. <a-col :lg="12" :md="24" :sm="24">
  139. <a-form-item
  140. label="电压"
  141. :labelCol="BaseTool.Constant.labelCol"
  142. :wrapperCol="BaseTool.Constant.wrapperCol"
  143. >
  144. <a-input
  145. :rows="4"
  146. suffix="V"
  147. v-decorator="['fdjh']"/>
  148. </a-form-item>
  149. </a-col>
  150. <a-col :lg="12" :md="24" :sm="24">
  151. <a-form-item
  152. label="电流"
  153. :labelCol="BaseTool.Constant.labelCol"
  154. :wrapperCol="BaseTool.Constant.wrapperCol"
  155. >
  156. <a-input
  157. suffix="A"
  158. v-decorator="['zz']"/>
  159. </a-form-item>
  160. </a-col>
  161. </a-row>
  162. <title-divider title="试车意见" width="120px"></title-divider>
  163. <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
  164. <a-col :lg="24" :md="24" :sm="24">
  165. <a-form-item
  166. label="试车意见"
  167. :labelCol="BaseTool.Constant.labelCol2"
  168. :wrapperCol="BaseTool.Constant.wrapperCol2"
  169. >
  170. <a-textarea
  171. :rows="4"
  172. v-decorator="['fdjh']"/>
  173. </a-form-item>
  174. </a-col>
  175. </a-row>
  176. <title-divider title="试车记录文件" width="120px"></title-divider>
  177. <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
  178. <a-col :lg="12" :md="24" :sm="24">
  179. <a-form-item
  180. label="试车文件"
  181. :labelCol="BaseTool.Constant.labelCol"
  182. :wrapperCol="BaseTool.Constant.wrapperCol"
  183. >
  184. <a-upload
  185. :action="uploadUrl"
  186. :multiple="true"
  187. :file-list="this.defaultRepairFileList"
  188. @change="handleRepairFileChange"
  189. :headers="headers"
  190. >
  191. <a-button> <a-icon type="upload" /> 选择上传文件 </a-button>
  192. </a-upload>
  193. </a-form-item>
  194. </a-col>
  195. <a-col :lg="12" :md="24" :sm="24">
  196. <a-form-item
  197. label="试车照片"
  198. :labelCol="BaseTool.Constant.labelCol"
  199. :wrapperCol="BaseTool.Constant.wrapperCol"
  200. >
  201. <a-upload
  202. :action="uploadUrl"
  203. :multiple="true"
  204. :file-list="this.defaultSbFileList"
  205. @change="handleSbFileChange"
  206. accept="image/*"
  207. :headers="headers"
  208. >
  209. <a-button> <a-icon type="upload" /> 选择上传文件 </a-button>
  210. </a-upload>
  211. </a-form-item>
  212. </a-col>
  213. </a-row>
  214. </a-form>
  215. </a-card>
  216. </template>
  217. <script>
  218. import pick from 'lodash.pick'
  219. import { addSbInfo, updateSbInfo, fetchSbInfo, copySbInfo } from '@/api/sb/info'
  220. import BaseTool from '../../../../utils/tool'
  221. import { ACCESS_TOKEN } from '@/store/mutation-types'
  222. import Vue from 'vue'
  223. import { uploadUrl } from '@/api/upms/file'
  224. import DetailList from '@/components/tools/DetailList'
  225. const DetailListItem = DetailList.Item
  226. export default {
  227. name: 'BaseSbInfo',
  228. components: {
  229. DetailList,
  230. DetailListItem
  231. },
  232. data () {
  233. return {
  234. confirmLoading: false,
  235. modalTitle: null,
  236. form: this.$form.createForm(this),
  237. areaList: {},
  238. companyList: {},
  239. paramList: [],
  240. projectList: {},
  241. deptList: {},
  242. groupList: {},
  243. visible: false,
  244. sbTypeTreeData: [],
  245. // sbInfoTreeData: [],
  246. // sourceSbInfoTreeData: [],
  247. // sbPositionTreeData: [],
  248. depreciationTypeMap: {},
  249. sourceTypeMap: {},
  250. levelMap: {},
  251. rlTypeMap: {},
  252. colorMap: {},
  253. useTypeMap: {},
  254. statusMap: {},
  255. isChildMap: {},
  256. isShowMap: {},
  257. isFinancingMap: {},
  258. userList: {},
  259. unitMap: {},
  260. sbInfoSelectType: null,
  261. repairFileList: [], // 维修手册
  262. defaultRepairFileList: [],
  263. defaultUseFileList: [],
  264. defaultRecheckFileList: [],
  265. defaultSbFileList: [],
  266. useFileList: [], // 使用手册
  267. recheckFileList: [], // 验收手册
  268. sbFileList: [], // 设备图片,
  269. uploadUrl: uploadUrl,
  270. qrcodesrc: null,
  271. id: null,
  272. fileList: [],
  273. type: null,
  274. headers: {
  275. Authorization: 'Bearer ' + Vue.ls.get(ACCESS_TOKEN)
  276. }
  277. }
  278. },
  279. props: {
  280. useType: {
  281. type: Number,
  282. default: 3
  283. }
  284. },
  285. created () {
  286. this.depreciationTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_DEPRECIATIONTYPE)
  287. this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_LEVEL)
  288. this.colorMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_COLOR)
  289. this.rlTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.RANLIAO_TYPE)
  290. this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_INFO_STATUS)
  291. this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
  292. },
  293. methods: {
  294. base (record, type) {
  295. // 清除文件列表
  296. this.visible = true
  297. // 选择框查询条件
  298. // 如果是空标识添加
  299. if (this.BaseTool.Object.isBlank(record)) {
  300. this.qrcodesrc = null
  301. this.modalTitle = '添加'
  302. this.clearFileList()
  303. return
  304. }
  305. this.useType = record.useType
  306. this.modalTitle = '编辑'
  307. this.id = record.id
  308. this.qrcodesrc = record.qrCode
  309. this.repairFileList = record.repairFileList
  310. this.useFileList = record.useFileList
  311. this.recheckFileList = record.recheckFileList
  312. this.sbFileList = record.sbFileList
  313. this.defaultRepairFileList = this.BaseTool.UPLOAD.transImg(this.repairFileList)
  314. this.defaultUseFileList = this.BaseTool.UPLOAD.transImg(this.useFileList)
  315. this.defaultRecheckFileList = this.BaseTool.UPLOAD.transImg(this.recheckFileList)
  316. this.defaultSbFileList = this.BaseTool.UPLOAD.transImg(this.sbFileList)
  317. this.paramList = JSON.parse(record.paramList)
  318. if (type === 1) {
  319. this.type = type
  320. this.modalTitle = '复制'
  321. this.qrcodesrc = null
  322. record.no = null
  323. this.clearFileList()
  324. }
  325. const { form: { setFieldsValue } } = this
  326. // 日期处理
  327. // record.buyDate = this.BaseTool.Moment(record.buyDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  328. // record.startDate = this.BaseTool.Moment(record.startDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  329. // record.nextCheckDate = this.BaseTool.Moment(record.nextCheckDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  330. // record.guaranteeDate = this.BaseTool.Moment(record.guaranteeDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  331. // record.retirementDate = this.BaseTool.Moment(record.retirementDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  332. // record.lastRepaireTime = this.BaseTool.Moment(record.lastRepaireTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  333. // record.lastBaoyangTime = this.BaseTool.Moment(record.lastBaoyangTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  334. if (record.buyDate != null) {
  335. record.buyDate = this.BaseTool.Moment(record.buyDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  336. this.$nextTick(() => {
  337. setFieldsValue(Object.assign(pick(record, [
  338. 'buyDate'
  339. ])))
  340. })
  341. }
  342. if (record.startDate != null) {
  343. record.startDate = this.BaseTool.Moment(record.startDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  344. this.$nextTick(() => {
  345. setFieldsValue(Object.assign(pick(record, [
  346. 'startDate'
  347. ])))
  348. })
  349. }
  350. if (record.checkDate != null) {
  351. record.checkDate = this.BaseTool.Moment(record.checkDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  352. this.$nextTick(() => {
  353. setFieldsValue(Object.assign(pick(record, [
  354. 'checkDate'
  355. ])))
  356. })
  357. }
  358. if (record.nextCheckDate != null) {
  359. record.nextCheckDate = this.BaseTool.Moment(record.nextCheckDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  360. this.$nextTick(() => {
  361. setFieldsValue(Object.assign(pick(record, [
  362. 'nextCheckDate'
  363. ])))
  364. })
  365. }
  366. if (record.retirementDate != null) {
  367. record.retirementDate = this.BaseTool.Moment(record.retirementDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  368. this.$nextTick(() => {
  369. setFieldsValue(Object.assign(pick(record, [
  370. 'retirementDate'
  371. ])))
  372. })
  373. }
  374. if (record.registerDate != null) {
  375. record.registerDate = this.BaseTool.Moment(record.registerDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  376. this.$nextTick(() => {
  377. setFieldsValue(Object.assign(pick(record, [
  378. 'registerDate'
  379. ])))
  380. })
  381. }
  382. record.unitName = this.BaseTool.Object.getField(this.unitMap, record.unit)
  383. record.useTypeName = this.BaseTool.Object.getField(this.useTypeMap, record.useType)
  384. this.$nextTick(() => {
  385. setFieldsValue(Object.assign(pick(record, [
  386. 'id',
  387. 'no',
  388. 'parentId',
  389. 'parentSbName',
  390. 'isChild',
  391. 'isShow',
  392. 'isFinancing',
  393. 'financingNo',
  394. 'financingNoTwo',
  395. 'financingNoThird',
  396. 'financingNoFour',
  397. 'financingNoFive',
  398. 'name',
  399. 'model',
  400. 'cph',
  401. 'positionId',
  402. 'producerName',
  403. 'useArea',
  404. 'useCompany',
  405. 'useProject',
  406. 'useDept',
  407. 'saveUser',
  408. 'repairUser',
  409. 'useGroup',
  410. 'typeId',
  411. 'level',
  412. 'initialValue',
  413. // 'cutValue',
  414. 'producerId',
  415. // 'sourceType',
  416. 'unit',
  417. 'buyDate',
  418. 'startDate',
  419. 'zbh',
  420. // 'wbFile',
  421. // 'useFile',
  422. // 'checkFile',
  423. // 'sbImage',
  424. 'status',
  425. 'remark',
  426. 'zzh',
  427. 'zz',
  428. 'zjm',
  429. 'jbdh',
  430. 'useType',
  431. 'cardNo',
  432. 'fdjxh',
  433. 'checkDate',
  434. 'checkPeriod',
  435. 'nextCheckDate',
  436. 'dph',
  437. 'zaiz',
  438. 'rlType',
  439. 'color',
  440. 'sbdh',
  441. 'seatNumber',
  442. 'registerNo',
  443. 'characterType',
  444. 'usedNo',
  445. 'supplier',
  446. 'repairUserSecond',
  447. 'batchNo',
  448. 'workYear',
  449. 'retirementDate',
  450. 'registerDate'
  451. ])))
  452. })
  453. },
  454. save () {
  455. const { form: { validateFieldsAndScroll } } = this
  456. this.confirmLoading = true
  457. validateFieldsAndScroll((errors, values) => {
  458. if (errors) {
  459. this.confirmLoading = false
  460. return
  461. }
  462. // 日期数据的处理
  463. values.buyDate = BaseTool.Date.formatter(values.buyDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  464. values.startDate = BaseTool.Date.formatter(values.startDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  465. values.checkDate = BaseTool.Date.formatter(values.checkDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  466. values.nextCheckDate = BaseTool.Date.formatter(values.nextCheckDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  467. values.guaranteeDate = BaseTool.Date.formatter(values.guaranteeDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  468. values.retirementDate = BaseTool.Date.formatter(values.retirementDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  469. values.lastRepaireTime = this.BaseTool.Date.formatter(values.lastRepaireTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  470. values.lastBaoyangTime = this.BaseTool.Date.formatter(values.lastBaoyangTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  471. values.spDate = this.BaseTool.Date.formatter(values.spDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  472. values.jbdDate = this.BaseTool.Date.formatter(values.jbdDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  473. values.sbdDate = this.BaseTool.Date.formatter(values.sbdDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  474. values.sbDate = this.BaseTool.Date.formatter(values.sbDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  475. // 上传文件
  476. values.repairFileList = this.repairFileList
  477. values.useFileList = this.useFileList
  478. values.recheckFileList = this.recheckFileList
  479. values.sbFileList = this.sbFileList
  480. values.paramList = JSON.stringify(this.paramList)
  481. values.useType = this.useType
  482. if (this.BaseTool.String.isBlank(values.id)) {
  483. addSbInfo(values)
  484. .then(() => {
  485. this.handleCancel(values)
  486. }).catch(() => {
  487. this.confirmLoading = false
  488. })
  489. } else {
  490. if (this.type == null) {
  491. updateSbInfo(values)
  492. .then(() => {
  493. this.handleCancel(values)
  494. }).catch(() => {
  495. this.confirmLoading = false
  496. })
  497. } else {
  498. copySbInfo(values)
  499. .then(() => {
  500. this.handleCancel(values)
  501. }).catch(() => {
  502. this.confirmLoading = false
  503. })
  504. }
  505. }
  506. })
  507. },
  508. getQrcodeSrc () {
  509. console.log(111, 22)
  510. },
  511. handleCancel () {
  512. this.visible = false
  513. this.confirmLoading = false
  514. this.form.resetFields()
  515. this.$emit('ok')
  516. },
  517. handleFresh () {
  518. fetchSbInfo({ id: this.id }).then(res => {
  519. const { form: { setFieldsValue } } = this
  520. const record = res.data
  521. this.$nextTick(() => {
  522. setFieldsValue(Object.assign(pick(record, [
  523. 'zjm',
  524. 'jbdh'
  525. ])))
  526. })
  527. })
  528. },
  529. beforeRecheckFileListUpload (file) {
  530. const reg = /\.(xls|xlsx)(\?.*)?$/
  531. return new Promise((resolve, reject) => {
  532. if (reg.test(file.name)) {
  533. this.recheckFileList = [file]
  534. return true
  535. } else {
  536. this.$message.error(`请上传正确的xls|xlsx文件`)
  537. reject(new Error('请上传正确的xls|xlsx文件'))
  538. return false
  539. }
  540. })
  541. },
  542. beforeUploadPic (file) {
  543. const reg = /\.(jpg|jpeg|png)(\?.*)?$/
  544. return new Promise((resolve, reject) => {
  545. if (reg.test(file.name)) {
  546. this.sbFileList = [file]
  547. return true
  548. } else {
  549. this.$message.error(`请上传正确的jpg|jpeg|png文件`)
  550. reject(new Error('请上传正确的jpg|jpeg|png文件'))
  551. return false
  552. }
  553. })
  554. },
  555. clearFileList () {
  556. this.repairFileList = []
  557. this.useFileList = []
  558. this.recheckFileList = []
  559. this.sbFileList = []
  560. },
  561. handleRepairFileChange (info) {
  562. this.defaultRepairFileList = info.fileList
  563. this.repairFileList = this.setFileList(info, 1)
  564. },
  565. handleUseFileChange (info) {
  566. this.defaultUseFileList = info.fileList
  567. this.useFileList = this.setFileList(info, 2)
  568. },
  569. handleRecheckFileChange (info) {
  570. this.defaultRecheckFileList = info.fileList
  571. this.recheckFileList = this.setFileList(info, 3)
  572. },
  573. handleSbFileChange (info) {
  574. this.defaultSbFileList = info.fileList
  575. this.sbFileList = this.setFileList(info, 4)
  576. },
  577. setFileList1 (info, type) {
  578. const fileList = [...info.fileList]
  579. const file = [...info.file]
  580. if (file.status === 'done') {
  581. return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
  582. } else if (file.status === 'removed') {
  583. return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
  584. } else if (file.status === 'error') {
  585. this.$message.error('上传失败')
  586. return []
  587. }
  588. },
  589. clearParent () {
  590. const { form: { setFieldsValue } } = this
  591. // 日期处理
  592. this.$nextTick(() => {
  593. setFieldsValue(Object.assign({
  594. 'parentId': null,
  595. 'parentSbName': null
  596. }))
  597. })
  598. },
  599. setFileList (info, type) {
  600. // { file, fileList }
  601. const file = info.file
  602. const fileList = info.fileList
  603. // fileList = fileList.slice(-2)
  604. // console.log(111, this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type))
  605. if (file.status === 'done') {
  606. return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
  607. } else if (file.status === 'removed') {
  608. return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
  609. } else if (file.status === 'error') {
  610. this.$message.error('上传失败')
  611. return null
  612. }
  613. }
  614. }
  615. }
  616. </script>