IncidentTicketModal.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  1. <template>
  2. <a-modal
  3. title="编辑"
  4. width="85%"
  5. :visible="visible"
  6. :maskClosable="false"
  7. :confirmLoading="confirmLoading"
  8. @ok="handleOk"
  9. @cancel="handleCancel"
  10. destroyOnClose
  11. >
  12. <a-spin :spinning="confirmLoading">
  13. <!-- 主表单区域 -->
  14. <div class="table-page-search-wrapper">
  15. <div >
  16. <a-form-model layout="inline" ref="form" :model="formState" :rules="validatorRules" labelAlign="right">
  17. <a-row :gutter="24">
  18. <a-col :span="8" >
  19. <a-form-model-item label="日期" prop="accidentData" >
  20. <a-input v-model="formState.accidentData" placeholder="请输入" readOnly></a-input>
  21. </a-form-model-item>
  22. </a-col>
  23. <a-col :span="8" >
  24. <a-form-model-item label="质量事故单主题" prop="accidentTheme">
  25. <a-input v-model="formState.accidentTheme" placeholder="请输入" readOnly></a-input>
  26. </a-form-model-item>
  27. </a-col>
  28. <a-col :span="8">
  29. <a-form-model-item label="质量事故单号" prop="accidentNumber">
  30. <a-input v-model="formState.accidentNumber" placeholder="请输入" readOnly></a-input>
  31. </a-form-model-item>
  32. </a-col>
  33. </a-row>
  34. <a-row :gutter="24">
  35. <a-col :span="8" >
  36. <a-form-model-item label="客户" prop="customer" >
  37. <a-input v-model="formState.customer" placeholder="请输入" readOnly></a-input>
  38. </a-form-model-item>
  39. </a-col>
  40. <a-col :span="8" >
  41. <a-form-model-item label="工厂(事故发生地)" prop="factory">
  42. <a-input v-model="formState.factory" placeholder="请输入" readOnly></a-input>
  43. </a-form-model-item>
  44. </a-col>
  45. <a-col :span="8" >
  46. <a-form-model-item label="责任单位" prop="responsibilityCompany">
  47. <a-input v-model="formState.responsibilityCompany" placeholder="请输入" readOnly></a-input>
  48. </a-form-model-item>
  49. </a-col>
  50. </a-row>
  51. <a-divider />
  52. <a-row :gutter="24">
  53. <a-col :span="6" >
  54. <a-form-model-item label="责任人1" prop="responsibilityPerson1" >
  55. <j-search-select-tag v-model="formState.responsibilityPerson1" placeholder=""
  56. dict="sys_user,realname,username" @search="searchName" :disabled="true"/>
  57. </a-form-model-item>
  58. </a-col>
  59. <a-col :span="6" >
  60. <a-form-model-item label="责任人2" prop="responsibilityPerson2" >
  61. <j-search-select-tag v-model="formState.responsibilityPerson2" placeholder=""
  62. dict="sys_user,realname,username" @search="searchName" :disabled="true"/>
  63. </a-form-model-item>
  64. </a-col>
  65. <a-col :span="6" >
  66. <a-form-model-item label="责任人3" prop="responsibilityPerson3">
  67. <j-search-select-tag v-model="formState.responsibilityPerson3" placeholder=""
  68. dict="sys_user,realname,username" @search="searchName" :disabled="true"/>
  69. </a-form-model-item>
  70. </a-col>
  71. <a-col :span="6" >
  72. <a-form-model-item label="责任人4" prop="responsibilityPerson4">
  73. <j-search-select-tag v-model="formState.responsibilityPerson4" placeholder=""
  74. dict="sys_user,realname,username" @search="searchName" :disabled="true"/>
  75. </a-form-model-item>
  76. </a-col>
  77. </a-row>
  78. <a-row :gutter="24">
  79. <a-col :span="6" >
  80. <a-form-model-item label="金额1" prop="sum1" >
  81. <a-input v-model="formState.sum1" placeholder="请输入" readOnly></a-input>
  82. </a-form-model-item>
  83. </a-col>
  84. <a-col :span="6" >
  85. <a-form-model-item label="金额2" prop="sum2" >
  86. <a-input v-model="formState.sum2" placeholder="请输入" readOnly></a-input>
  87. </a-form-model-item>
  88. </a-col>
  89. <a-col :span="6" >
  90. <a-form-model-item label="金额3" prop="sum3">
  91. <a-input v-model="formState.sum3" placeholder="请输入" readOnly></a-input>
  92. </a-form-model-item>
  93. </a-col>
  94. <a-col :span="6" >
  95. <a-form-model-item label="金额4" prop="sum4">
  96. <a-input v-model="formState.sum4" placeholder="请输入" readOnly></a-input>
  97. </a-form-model-item>
  98. </a-col>
  99. </a-row>
  100. <a-divider />
  101. <a-row :gutter="24">
  102. <!-- <a-col :span="8" >
  103. <a-form-model-item label="币种" prop="moneyType">
  104. <a-input v-model="formState.moneyType" placeholder="请输入" readOnly></a-input>
  105. </a-form-model-item>
  106. </a-col> -->
  107. <a-col :span="8" >
  108. <a-form-model-item label="总金额" prop="totalMoney" >
  109. <a-input v-model="formState.totalMoney" placeholder="请输入" readOnly></a-input>
  110. </a-form-model-item>
  111. </a-col>
  112. <a-col :span="8" >
  113. <a-form-model-item label="业务类型" prop="businessType">
  114. <a-input v-model="formState.businessType" placeholder="请输入" readOnly></a-input>
  115. </a-form-model-item>
  116. </a-col>
  117. </a-row>
  118. <a-row :gutter="24">
  119. <a-col :span="8" >
  120. <a-form-model-item label="成衣销售订单号" prop="garmentSalesOrder">
  121. <a-input v-model="formState.garmentSalesOrder" placeholder="请输入" readOnly></a-input>
  122. </a-form-model-item>
  123. </a-col>
  124. <a-col :span="8" >
  125. <a-form-model-item label="款号" prop="styleNumber" >
  126. <a-input v-model="formState.styleNumber" placeholder="请输入" readOnly></a-input>
  127. </a-form-model-item>
  128. </a-col>
  129. <a-col :span="8" >
  130. <a-form-model-item label="物料" prop="material">
  131. <a-input v-model="formState.material" placeholder="请输入" readOnly></a-input>
  132. </a-form-model-item>
  133. </a-col>
  134. </a-row>
  135. <a-row :gutter="24">
  136. <a-col :span="8" >
  137. <a-form-model-item label="计划员" prop="planPersonnel">
  138. <a-input v-model="formState.planPersonnel" placeholder="请输入" readOnly></a-input>
  139. </a-form-model-item>
  140. </a-col>
  141. <a-col :span="8" >
  142. <a-form-model-item label="业务员" prop="businessPeople" >
  143. <j-search-select-tag v-model="formState.businessPeople" placeholder=""
  144. dict="sys_user,realname,username" @search="searchName" :disabled="true"/>
  145. </a-form-model-item>
  146. </a-col>
  147. <a-col :span="8" >
  148. <a-form-model-item label="QC" prop="qualityControl">
  149. <j-search-select-tag v-model="formState.qualityControl" placeholder=""
  150. dict="sys_user,realname,username" @search="searchName" :disabled="true"/>
  151. </a-form-model-item>
  152. </a-col>
  153. </a-row>
  154. <a-row :gutter="24">
  155. <a-col :span="24" style="height: 290px;">
  156. <a-form-model-item label="情况说明" prop="presentationCondition" class="fff">
  157. <a-textarea v-model="formState.presentationCondition" type="textarea" placeholder="请输入" readOnly></a-textarea>
  158. <!-- <a-input v-model="formState.presentationCondition" type="textarea" placeholder="请输入" readOnly></a-input> -->
  159. </a-form-model-item>
  160. </a-col>
  161. </a-row>
  162. </a-form-model>
  163. </div>
  164. <!-- 子表单区域 -->
  165. <!-- <a-button type="primary" @click="addList" style="margin-bottom: 1%;">增行</a-button> -->
  166. <a-table
  167. bordered
  168. :columns="incidentTicketChildrenTable.columns"
  169. :data-source="incidentTicketChildrenTable.dataSource"
  170. :loading="incidentTicketChildrenTable.loading"
  171. :scroll="{x: 1200,y:300 }"
  172. :pagination="false"
  173. >
  174. <!-- 自定义表头 -->
  175. <!-- <span slot="zhanghaoIdTitle" class="form-table-heard">
  176. 账套号
  177. </span> -->
  178. <span slot="exchangeRateTitle" class="form-table-heard">
  179. 汇率
  180. </span>
  181. <span slot="practicalSumTitle" class="form-table-heard">
  182. 实际事故金额
  183. </span>
  184. <!-- 汇率 -->
  185. <span slot="exchangeRate" slot-scope="text, record, index">
  186. <a-input placeholder="请输入" v-model="record.exchangeRate" @change="changeExchangeRate(record,index)"/>
  187. </span>
  188. <!-- 实际事故金额 -->
  189. <span slot="practicalSum" slot-scope="text, record, index">
  190. <a-input placeholder="请输入" v-model="record.practicalSum" @blur="changepracticalSum(record)"/>
  191. </span>
  192. <!-- 币种 -->
  193. <span slot="moneyType" slot-scope="text, record, index">
  194. <j-dict-select-tag
  195. v-model="record.moneyType"
  196. placeholder="请选择币种"
  197. :triggerChange="true"
  198. dictCode="money-type"
  199. />
  200. </span>
  201. <!-- U8生成运费发票号 -->
  202. <span slot="u8Invoice" slot-scope="text, record, index">
  203. <a-input placeholder="请输入" v-model="record.u8Invoice" disabled="true"/>
  204. </span>
  205. <!-- 账套号 -->
  206. <span slot="zhanghaoId" slot-scope="text, record, index">
  207. <a-select v-model="record.zhanghaoId" allowClear @change="handleChange(record,index)" style="width: 100%;">
  208. <a-select-option value="101">101</a-select-option>
  209. <a-select-option value="102">102</a-select-option>
  210. <a-select-option value="103">103</a-select-option>
  211. </a-select>
  212. </span>
  213. <!-- 备注 -->
  214. <span slot="remark" slot-scope="text, record, index">
  215. <a-input placeholder="请输入" v-model="record.remark" />
  216. </span>
  217. </a-table>
  218. <a-form-model layout="inline" ref="form" :model="formState" :rules="validatorRules">
  219. <a-row :gutter="24">
  220. <a-col :span="12" >
  221. <a-form-model-item label="附件上传" prop="accessory" class="ff">
  222. <j-upload v-model="accessory" :disabled="true"></j-upload>
  223. </a-form-model-item>
  224. </a-col>
  225. <a-col :span="12" >
  226. <a-form-model-item label="工厂签章" prop="factorySignature" class="ff">
  227. <j-upload v-model="factorySignature" :disabled="true"></j-upload>
  228. </a-form-model-item>
  229. </a-col>
  230. </a-row>
  231. <a-row :gutter="24">
  232. <a-col :span="24" style="height: 230px;">
  233. <a-form-model-item label="财务备注" prop="financeRemark" class="caiwu" >
  234. <a-input v-model="formState.financeRemark" type="textarea" placeholder="请输入"></a-input>
  235. </a-form-model-item>
  236. </a-col>
  237. </a-row>
  238. <a-row :gutter="24">
  239. <a-col :span="12">
  240. <a-form-model-item label="财务添加附件" prop="accessory2" class="ff">
  241. <j-upload v-model="accessory2" ></j-upload>
  242. <!-- <a-input v-model="formState.accessory2" placeholder="请输入"></a-input> -->
  243. </a-form-model-item>
  244. </a-col>
  245. </a-row>
  246. <a-row :gutter="24">
  247. <a-col :span="18">
  248. <a-form-model-item label="通知人" prop="Noticer">
  249. <a-input v-model="formState.Noticer" placeholder="请输入"></a-input>
  250. </a-form-model-item>
  251. </a-col>
  252. <a-col :span="6">
  253. <a-form-model-item label="通知时间" prop="Noticer">
  254. <a-input v-model="formState.createTime" placeholder="请输入" readOnly></a-input>
  255. </a-form-model-item>
  256. </a-col>
  257. </a-row>
  258. <a-row :gutter="24">
  259. <a-col :span="6" >
  260. <a-form-model-item label="填报人" prop="informant">
  261. <a-input v-model="formState.informant" placeholder="请输入" readOnly></a-input>
  262. </a-form-model-item>
  263. </a-col>
  264. <a-col :span="6" >
  265. <a-form-model-item label="部门" prop="department">
  266. <a-input v-model="formState.department" placeholder="请输入" readOnly></a-input>
  267. </a-form-model-item>
  268. </a-col>
  269. <a-col :span="6">
  270. <a-form-model-item label="U8订单备注" prop="orderRemarks">
  271. <a-input maxlength="200" v-model="formState.orderRemarks" placeholder="请输入" ></a-input>
  272. </a-form-model-item>
  273. </a-col>
  274. <a-col :span="6">
  275. <a-form-model-item label="U8开票日期" prop="orderRemarks">
  276. <a-date-picker
  277. placeholder="请选择"
  278. format="YYYY-MM-DD"
  279. style="width: 100%"
  280. v-model="formState.invoicingDate"
  281. />
  282. </a-form-model-item>
  283. </a-col>
  284. </a-row>
  285. </a-form-model>
  286. <!-- <j-editable-table
  287. :ref="refKeys[0]"
  288. :loading="incidentTicketChildrenTable.loading"
  289. :columns="incidentTicketChildrenTable.columns"
  290. :dataSource="incidentTicketChildrenTable.dataSource"
  291. :maxHeight="300"
  292. :rowNumber="true"
  293. :rowSelection="true"
  294. :actionButton="true"/> -->
  295. <!-- <div class="table-page-search-wrapper">
  296. <a-form-model layout="inline" ref="form" :model="formState" :rules="validatorRules">
  297. <a-row :gutter="24">
  298. <a-col :md="24" :sm="8">
  299. <a-form-model-item label="财务备注" class="nresume" style="height:100px !important">
  300. <a-input type="textarea" placeholder="请输入" v-model="formState.demo"/>
  301. </a-form-model-item>
  302. </a-col>
  303. </a-row>
  304. </a-form-model>
  305. </div> -->
  306. <!-- </a-tab-pane> -->
  307. </div>
  308. </a-spin>
  309. </a-modal>
  310. </template>
  311. <script>
  312. import pick from 'lodash.pick'
  313. import { FormTypes,getRefPromise } from '@/utils/JEditableTableUtil'
  314. import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
  315. import { validateDuplicateValue } from '@/utils/util'
  316. import JDictSelectTag from "@/components/dict/JDictSelectTag"
  317. import JUpload from '@/components/jeecg/JUpload'
  318. import moment from 'moment'
  319. import { putAction,getAction } from '@/api/manage'
  320. import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
  321. export default {
  322. name: 'IncidentTicketModal',
  323. mixins: [JEditableTableMixin],
  324. components: {
  325. JDictSelectTag,
  326. JUpload,
  327. JSearchSelectTag,
  328. moment
  329. },
  330. data() {
  331. return {
  332. labelCol: {
  333. span: 8
  334. },
  335. wrapperCol: {
  336. span: 16
  337. },
  338. labelCol2: {
  339. span: 3
  340. },
  341. wrapperCol2: {
  342. span: 20
  343. },
  344. formState:{},
  345. // 新增时子表默认添加几行空数据
  346. addDefaultRowNum: 1,
  347. validatorRules: {
  348. financeRemark:[{required: true, message: '财务备注不能为空!'}],
  349. },
  350. refKeys: ['incidentTicketChildren', ],
  351. tableKeys:['incidentTicketChildren', ],
  352. activeKey: 'incidentTicketChildren',
  353. accessory2:[],
  354. accessory:[],
  355. factorySignature:[],
  356. // 森_工厂质量事故单-子表
  357. incidentTicketChildrenTable: {
  358. loading: false,
  359. dataSource: [],
  360. columns: [
  361. {
  362. title:'序号',
  363. align:"center",
  364. ellipsis: true,
  365. dataIndex: 'sort',
  366. customRender: (text) => {
  367. return Number(text)+1;
  368. },
  369. width:'4%'
  370. },
  371. {
  372. title: '计划单号',
  373. align: "center",
  374. dataIndex: 'planNumber',
  375. width: '7%',
  376. },
  377. {
  378. title: '事故类型',
  379. align: "center",
  380. dataIndex: 'accidentType',
  381. width: '7%',
  382. // scopedSlots: { customRender: 'accidentType' },
  383. },
  384. {
  385. title: '币种',
  386. align: "center",
  387. dataIndex: 'moneyType',
  388. width: '8%',
  389. // scopedSlots: { customRender: 'moneyType' },
  390. },
  391. {
  392. title: '事故金额',
  393. align: "center",
  394. dataIndex: 'accidentSum',
  395. width: '7%',
  396. // scopedSlots: { customRender: 'accidentSum' },
  397. },
  398. {
  399. // title: '汇率',
  400. align: "center",
  401. dataIndex: 'exchangeRate',
  402. width: '7%',
  403. scopedSlots: { customRender: 'exchangeRate' },
  404. slots:{title:'exchangeRateTitle'},
  405. },
  406. {
  407. // title: '实际事故金额',
  408. align: "center",
  409. dataIndex: 'practicalSum',
  410. width: '11%',
  411. scopedSlots: { customRender: 'practicalSum' },
  412. slots:{title:'practicalSumTitle'},
  413. },
  414. {
  415. title: 'U8生成运费发票号',
  416. align: "center",
  417. dataIndex: 'u8Invoice',
  418. width: '9%',
  419. scopedSlots: { customRender: 'u8Invoice' },
  420. },
  421. {
  422. title: '账套号',
  423. align: "center",
  424. dataIndex: 'zhanghaoId',
  425. width: '8%',
  426. scopedSlots: { customRender: 'zhanghaoId' },
  427. // slots:{title:'zhanghaoIdTitle'},
  428. },
  429. {
  430. title: '备注',
  431. align: "center",
  432. dataIndex: 'remark',
  433. width: '16%',
  434. scopedSlots: { customRender: 'remark' },
  435. },
  436. ]
  437. },
  438. url: {
  439. add: "/oa/incidentTicket/add",
  440. edit: "/oa/incidentTicket/edit",
  441. incidentTicketChildren: {
  442. list: '/oa/incidentTicket/queryIncidentTicketChildrenByMainId'
  443. },
  444. }
  445. }
  446. },
  447. methods: {
  448. moment,
  449. getHeaderList(id){
  450. getAction('/oa/incidentTicket/queryById', {id:id}).then((res) => {
  451. if(res.success){
  452. var zhuId = '' //主表id
  453. this.formState=res.result //详情
  454. if(this.formState.invoicingDate=='' || !this.formState.invoicingDate){
  455. this.formState.invoicingDate = moment(new Date())
  456. }else{
  457. this.formState.invoicingDate = moment(this.formState.invoicingDate)
  458. }
  459. this.accessory2 = this.formState.accessory2?JSON.parse(this.formState.accessory2):[]
  460. var accessory2Z =[]
  461. this.accessory2.map(item=>{
  462. accessory2Z.push(item.url)
  463. })
  464. this.accessory2 = accessory2Z
  465. this.accessory = this.formState.accessory?JSON.parse(this.formState.accessory):[]
  466. var accessoryZ=[]
  467. this.accessory.map(item =>{
  468. accessoryZ.push(item.url)
  469. })
  470. this.accessory =accessoryZ
  471. this.factorySignature = this.formState.factorySignature?JSON.parse(this.formState.factorySignature):[]
  472. var factorySignatureZ=[]
  473. this.factorySignature.map(item =>{
  474. factorySignatureZ.push(item.url)
  475. })
  476. this.factorySignature =factorySignatureZ
  477. zhuId = res.result.id
  478. this.getTable(zhuId)
  479. this.getNotifier(zhuId)
  480. }else{
  481. this.$message.warning(res.message)
  482. }
  483. })
  484. },
  485. getCurrentData(){ return new Date().toLocaleDateString(); },
  486. getTable(id){
  487. getAction('/oa/incidentTicket/queryIncidentTicketChildrenByMainId', {id:id}).then((res) => {
  488. if(res.success){
  489. this.incidentTicketChildrenTable.dataSource = res.result
  490. this.incidentTicketChildrenTable.dataSource.map(item=>{
  491. if(item.practicalSum==''||!item.practicalSum){
  492. item.practicalSum = item.accidentSum
  493. }
  494. if(item.exchangeRate==''||!item.exchangeRate){
  495. item.exchangeRate = '1'
  496. }
  497. })
  498. }else{
  499. this.$message.warning(res.message)
  500. }
  501. })
  502. },
  503. getNotifier(id){
  504. getAction('/oa/incidentTicketMsg/queryByMainId', {id:id}).then((res) => {
  505. if(res.success){
  506. var noticeList =[]
  507. res.result.map(item=>{
  508. if(item.confirm != null && item.confirm != '' && item.confirm != '否'){
  509. noticeList.push(item.userName+'('+item.confirm+')')
  510. }else{
  511. noticeList.push(item.userName+'')
  512. }
  513. })
  514. this.formState.Noticer =(noticeList!==''&&noticeList)?noticeList.toString():''
  515. this.formState.createTime = (res.result[0].createTime!==''&&res.result[0].createTime)? moment(res.result[0].createTime).format('YYYY-MM-DD HH:mm:ss'):''
  516. console.log(this.formState.Noticer)
  517. this.$forceUpdate()
  518. }else{
  519. this.formState.Noticer = ''
  520. this.formState.createTime=''
  521. }
  522. })
  523. },
  524. handleOk(){
  525. if(this.accessory2.length!==0&&this.accessory2){
  526. var begin = this.accessory2.toString().indexOf('http://220.191.168.86:18087/jeecg-boot/sys/common/static/')
  527. if(begin == -1){
  528. this.formState.accessory2 = [{"type":"file","name":this.accessory2,"status":"done","uid":1673507319016,"url":"http://220.191.168.86:18087/jeecg-boot/sys/common/static/"+this.accessory2}]
  529. }else{
  530. this.formState.accessory2 = [{"type":"file","name":this.accessory2,"status":"done","uid":1673507319016,"url":this.accessory2}]
  531. }
  532. }else{
  533. this.formState.accessory2=[]
  534. }
  535. this.formState.accessory2 = JSON.stringify(this.formState.accessory2)
  536. var addData = 'yes'
  537. this.incidentTicketChildrenTable.dataSource.every(item=>{
  538. // if(item.zhanghaoId=='' ||!item.zhanghaoId){
  539. // this.$message.warning('请选择账套号!')
  540. // addData = 'no'
  541. // return false;
  542. // }
  543. if(item.exchangeRate=='' || !item.exchangeRate){
  544. this.$message.warning('请填写汇率!')
  545. addData = 'no'
  546. return false;
  547. }
  548. if(item.practicalSum=='' || !item.practicalSum){
  549. this.$message.warning('请填写实际事故金额!')
  550. addData = 'no'
  551. return false;
  552. }
  553. return true
  554. })
  555. this.$refs.form.validate(valid => {
  556. if (valid) {
  557. if(addData=='yes'){
  558. var obj = this.formState
  559. obj.createTime = ''
  560. obj.incidentTicketChildrenList = this.incidentTicketChildrenTable.dataSource
  561. obj.invoicingDate = moment(this.formState.invoicingDate).add (1,'days')
  562. putAction('/oa/incidentTicket/edit', obj).then((res) => {
  563. if(res.success){
  564. this.$message.success('编辑成功')
  565. this.handleCancel()
  566. this.$emit('close')
  567. }else{
  568. this.$message.warning(res.message)
  569. }
  570. })
  571. }
  572. }
  573. })
  574. },
  575. // 改变账套号
  576. handleChange(record,index){
  577. if(index==0){
  578. this.incidentTicketChildrenTable.dataSource.map(item=>{
  579. item.zhanghaoId = record.zhanghaoId
  580. })
  581. }
  582. },
  583. changepracticalSum(record){
  584. record.practicalSum = Number(record.practicalSum).toFixed(2)
  585. this.$forceUpdate()
  586. },
  587. changeExchangeRate(record,index){
  588. if(index == 0){
  589. this.incidentTicketChildrenTable.dataSource.map(item=>{
  590. item.exchangeRate = record.exchangeRate
  591. })
  592. }
  593. },
  594. //关闭
  595. handleCancel(){
  596. this.incidentTicketChildrenTable.dataSource =[]
  597. this.formState = {}
  598. this.visible = false
  599. this.$emit('close')
  600. },
  601. // getAllTable() {
  602. // let values = this.tableKeys.map(key => getRefPromise(this, key))
  603. // return Promise.all(values)
  604. // },
  605. /** 调用完edit()方法之后会自动调用此方法 */
  606. // editAfter() {
  607. // let fieldval = pick(this.model,'accidentData','accidentTheme','accidentPersonLiable','supplier','personLiable','accidentNumber','customer','factory','responsibilityPerson1','responsibilityPerson2','responsibilityPerson3','responsibilityPerson4','responsibilityPerson5','sum1','sum2','sum3','sum4','sum5','responsibilityCompany','moneyType','totalMoney','businessType','garmentSalesOrder','styleNumber','material','planPersonnel','businessPeople','qualityControl','planNumber','accidentType','accidentSum','presentationCondition','accessory','informant','factorySignature','financeRemark','accessory2','isLeaders','incidentTicketId','tableNameChildren')
  608. // this.$nextTick(() => {
  609. // this.form.setFieldsValue(fieldval)
  610. // })
  611. // // 加载子表数据
  612. // if (this.model.id) {
  613. // let params = { id: this.model.id }
  614. // this.requestSubTableData(this.url.incidentTicketChildren.list, params, this.incidentTicketChildrenTable)
  615. // }
  616. // },
  617. /** 整理成formData */
  618. classifyIntoFormData(allValues) {
  619. let main = Object.assign(this.model, allValues.formValue)
  620. return {
  621. ...main, // 展开
  622. incidentTicketChildrenList: allValues.tablesValue[0].values,
  623. }
  624. },
  625. validateError(msg){
  626. this.$message.error(msg)
  627. },
  628. popupCallback(row){
  629. this.form.setFieldsValue(pick(row,'accidentData','accidentTheme','accidentPersonLiable','supplier','personLiable','accidentNumber','customer','factory','responsibilityPerson1','responsibilityPerson2','responsibilityPerson3','responsibilityPerson4','responsibilityPerson5','sum1','sum2','sum3','sum4','sum5','responsibilityCompany','moneyType','totalMoney','businessType','garmentSalesOrder','styleNumber','material','planPersonnel','businessPeople','qualityControl','planNumber','accidentType','accidentSum','presentationCondition','accessory','informant','factorySignature','financeRemark','accessory2','isLeaders','incidentTicketId','tableNameChildren'))
  630. },
  631. }
  632. }
  633. </script>
  634. <style lang="less" scoped>
  635. /deep/ .ant-table-wrapper{
  636. margin-bottom: 2%;
  637. }
  638. /deep/ .nresume .ant-input{
  639. height: 100px !important;
  640. }
  641. /deep/ .ff .ant-form-item-control {
  642. display: contents;
  643. }
  644. /deep/ .ant-divider-horizontal{
  645. margin: 10px 0;
  646. }
  647. /deep/.table-page-search-wrapper .ant-form-inline .ant-form-item>.ant-form-item-label{
  648. width: 118px;
  649. }
  650. /deep/ .fff .ant-input{
  651. height: 280px !important;
  652. }
  653. /deep/ .caiwu .ant-input{
  654. height: 226px !important;
  655. }
  656. /deep/.ant-table td { white-space: nowrap; }
  657. .form-table-heard:before {
  658. content: '*';
  659. color: red;
  660. }
  661. /deep/ .ant-table td {
  662. white-space: break-spaces !important;
  663. word-break: break-word;
  664. }
  665. /deep/.ant-select{
  666. width: 100%;
  667. }
  668. /deep/.ant-select-selection--single{
  669. width: 100%;
  670. }
  671. </style>