SyCarryModal.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727
  1. <template>
  2. <div class="reply" ref = "replyModal">
  3. <a-modal
  4. :title="(defultMethods == 'add')?'新增':'编辑'"
  5. width="85%"
  6. :visible="visible"
  7. :confirmLoading="confirmLoading"
  8. :getContainer ='()=>$refs.replyModal'
  9. @cancel="handleCancel"
  10. destroyOnClose
  11. >
  12. <template #footer>
  13. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" @change="handleImportExcel" :customRequest="implementImport" >
  14. <a-button type="primary">导入</a-button>
  15. </a-upload>
  16. <a-button @click="handleCancel" style="margin-left: 8px;">取消</a-button>
  17. <a-button type="primary" @click="handleOk">保存</a-button>
  18. </template>
  19. <div class="table-page-search-wrapper">
  20. <a-form-model layout="inline" ref="form" :model="formState" :rules="validatorRules">
  21. <a-row :gutter="24">
  22. <!-- <a-col :md="8" :sm="8">
  23. <a-form-model-item label="编号" prop="code">
  24. <a-input placeholder="请输入" v-model="formState.code" />
  25. </a-form-model-item>
  26. </a-col> -->
  27. <a-col :md="8" :sm="8">
  28. <a-form-model-item label="名称" prop="name">
  29. <a-input placeholder="请输入名称" v-model="formState.name"/>
  30. </a-form-model-item>
  31. </a-col>
  32. <a-col :md="8" :sm="8">
  33. <a-form-model-item label="合计" prop="totalNum">
  34. <a-input placeholder="" v-model="formState.totalNum" disabled="false"/>
  35. </a-form-model-item>
  36. </a-col>
  37. </a-row>
  38. <a-row :gutter="24">
  39. <a-col :md="24" :sm="8">
  40. <a-form-model-item label="备注信息" class="nresume" style="height:100px !important">
  41. <a-input type="textarea" placeholder="请输入" v-model="formState.demo"/>
  42. </a-form-model-item>
  43. </a-col>
  44. </a-row>
  45. </a-form-model>
  46. <!-- 主表单区域 -->
  47. <!-- <a-form :model="form">
  48. <a-form-item
  49. :labelCol="labelCol"
  50. :wrapperCol="wrapperCol"
  51. label="编号">
  52. <a-input placeholder="请输入编号" v-decorator="['code', {}]"/>
  53. </a-form-item>
  54. <a-form-item
  55. :labelCol="labelCol"
  56. :wrapperCol="wrapperCol"
  57. label="名称">
  58. <a-input placeholder="请输入名称" v-decorator="['name', {}]"/>
  59. </a-form-item>
  60. <a-form-item label="合计" :labelCol="labelCol" :wrapperCol="wrapperCol" >
  61. <a-input placeholder="请输入" v-decorator="['total_num', {}] "/>
  62. </a-form-item>
  63. <a-form-item
  64. :labelCol="labelCol"
  65. :wrapperCol="wrapperCol"
  66. class="nresume" style="height:100px !important"
  67. label="备注">
  68. <a-input type="textarea" placeholder="请输入备注" v-decorator="['demo', {}]"/>
  69. </a-form-item>
  70. </a-form> -->
  71. <!-- 子表单区域 -->
  72. <a-tabs v-model="activeKey" @change="handleChangeTabs">
  73. <a-tab-pane tab="搬运工对账单" :key="refKeys[0]" :forceRender="true">
  74. <a-button type="primary" @click="addList" style="margin-bottom: 1%;">增行</a-button>
  75. <a-table
  76. bordered
  77. :columns="syCarryBTable.columns"
  78. :data-source="syCarryBTable.dataSource"
  79. :loading="syCarryBTable.loading"
  80. :scroll="{x: 2500,y:300 }"
  81. :pagination="false"
  82. >
  83. <!-- 表头--日期 -->
  84. <span slot="orderDateTitle" class="form-table-heard">
  85. 日期
  86. </span>
  87. <!-- 表头--集装箱号 -->
  88. <span slot="containerNoTitle" class="form-table-heard">
  89. 集装箱号
  90. </span>
  91. <!-- 表头--单价 -->
  92. <span slot="priceTitle" class="form-table-heard">
  93. 单价
  94. </span>
  95. <!-- 表头--计划员 -->
  96. <span slot="jhyByDataTitle" class="form-table-heard">
  97. 计划员
  98. </span>
  99. <!-- 表头--总价 -->
  100. <span slot="totalPriceTitle" class="form-table-heard">
  101. 总价
  102. </span>
  103. <!-- 日期 -->
  104. <span slot="orderDate" slot-scope="text, record,index">
  105. <a-date-picker
  106. placeholder="请选择"
  107. v-model="record.orderDate"
  108. format="YYYY-MM-DD"
  109. show-time
  110. />
  111. </span>
  112. <!-- 总件数 -->
  113. <span slot="allNum" slot-scope="text, record, index">
  114. <a-input placeholder="请输入" v-model="record.allNum" />
  115. </span>
  116. <!-- 柜子数量 -->
  117. <span slot="cabinets" slot-scope="text, record, index">
  118. <a-input placeholder="请输入" v-model="record.cabinets" />
  119. </span>
  120. <!-- 明细 -->
  121. <span slot="detailedNum" slot-scope="text, record, index">
  122. <a-input placeholder="请输入" v-model="record.detailedNum" @blur="handleChangePrice(record)"/>
  123. </span>
  124. <!-- 衣架/吨数 -->
  125. <span slot="coatHanger" slot-scope="text, record, index">
  126. <a-input placeholder="请输入" v-model="record.coatHanger" @blur="handleChangePrice(record)"/>
  127. </span>
  128. <!-- 集装箱号 -->
  129. <span slot="containerNo" slot-scope="text, record, index">
  130. <a-input placeholder="请输入" v-model="record.containerNo" />
  131. </span>
  132. <!-- 入库单号/发票号 -->
  133. <span slot="invoiceNo" slot-scope="text, record, index">
  134. <a-input placeholder="请输入" v-model="record.invoiceNo" />
  135. </span>
  136. <!-- 价格 -->
  137. <span slot="price" slot-scope="text, record, index">
  138. <a-input placeholder="请输入" v-model="record.price" @blur="handleChangePrice(record)"/>
  139. </span>
  140. <!-- 总价 -->
  141. <span slot="totalPrice" slot-scope="text, record, index">
  142. <a-input placeholder="请输入" v-model="record.totalPrice" disabled="false"/>
  143. </span>
  144. <!-- 计划员 -->
  145. <span slot="jhyByData" slot-scope="text, record, index">
  146. <a-select v-model="record.jhyByData" style="width:100%" mode="multiple"
  147. show-search :filterOption="filterOption" @change="handleChange(record)">
  148. <a-select-option
  149. v-for="(item,index) in jhyNameOption"
  150. :key="index"
  151. :value="item.value"
  152. >
  153. {{item.label}}
  154. </a-select-option>
  155. </a-select>
  156. </span>
  157. <!-- 原因 -->
  158. <span slot="reason" slot-scope="text, record, index">
  159. <a-input placeholder="请输入" v-model="record.reason" />
  160. </span>
  161. <!-- 备注 -->
  162. <span slot="demo" slot-scope="text, record, index">
  163. <a-input placeholder="请输入" v-model="record.demo" />
  164. </span>
  165. <span slot="option" slot-scope="text, record, index">
  166. <a @click="copyRow(record)">复制</a>
  167. <a-divider type="vertical" />
  168. <a @click="deleteRow(record,index)" style="color:red">删行</a>
  169. </span>
  170. </a-table>
  171. <!-- <j-editable-table
  172. :ref="refKeys[0]"
  173. :loading="syCarryBTable.loading"
  174. :columns="syCarryBTable.columns"
  175. :dataSource="syCarryBTable.dataSource"
  176. :maxHeight="300"
  177. :minWidth="2000"
  178. :rowNumber="false"
  179. :rowSelection="true"
  180. :actionButton="true">
  181. <template v-slot:action="props">
  182. <a @click="handleAutograph(props)">签名</a>
  183. </template> -->
  184. <!-- <template v-slot:jhyName="props">
  185. <a-select @change='changeJhy(props)' >
  186. <a-select-option
  187. v-for="(item,index) in jhyNameOption"
  188. :key="index"
  189. :value="item.value">
  190. {{item.label}}
  191. </a-select-option>
  192. </a-select>
  193. </template> -->
  194. <!-- </j-editable-table> -->
  195. </a-tab-pane>
  196. </a-tabs>
  197. </div>
  198. </a-modal>
  199. </div>
  200. </template>
  201. <script>
  202. import moment from 'moment'
  203. import pick from 'lodash.pick'
  204. import { FormTypes } from '@/utils/JEditableTableUtil'
  205. import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
  206. import {personList,subimtList} from '@api/oa/cd-personnel-files'
  207. import {fileDetail} from '@api/oa/cd-sy-carry'
  208. import { putAction,getAction } from '@/api/manage'
  209. export default {
  210. name: 'SyCarryModal',
  211. mixins: [JEditableTableMixin],
  212. components: {
  213. moment,
  214. },
  215. data() {
  216. return {
  217. // 新增时子表默认添加几行空数据
  218. addDefaultRowNum: 1,
  219. validatorRules: {
  220. },
  221. formState:{},
  222. refKeys: ['syCarryB', ],
  223. activeKey: 'syCarryB',
  224. jhyNameOption:[],
  225. dateFormat: 'YYYY-MM-DD',
  226. passVerification:'yes',
  227. validatorRules: {
  228. name:[{required: true, message: '名称不能为空!'}],
  229. code:[{required: true, message: '编号不能为空!'}],
  230. },
  231. // 搬运装卸费用-搬运工对账单-子表
  232. syCarryBTable: {
  233. loading: false,
  234. dataSource: [],
  235. columns: [
  236. {
  237. // title: '日期',
  238. align: "center",
  239. dataIndex: 'orderDate',
  240. width: '10%',
  241. ellipsis: true,
  242. scopedSlots: { customRender: 'orderDate' },
  243. slots:{title:'orderDateTitle'}
  244. },
  245. {
  246. title: '入库单号/发票号',
  247. align: "center",
  248. dataIndex: 'invoiceNo',
  249. width: '6%',
  250. ellipsis: true,
  251. scopedSlots: { customRender: 'invoiceNo' },
  252. },
  253. {
  254. title: '总件数',
  255. dataIndex: 'allNum',
  256. width: '5%',
  257. ellipsis: true,
  258. scopedSlots: { customRender: 'allNum' },
  259. className: 'replacecolor',
  260. // slots:{title:'allNumTitle'}
  261. },
  262. {
  263. title: '柜子数量',
  264. dataIndex: 'cabinets',
  265. width: '5%',
  266. ellipsis: true,
  267. scopedSlots: { customRender: 'cabinets' },
  268. className: 'replacecolor'
  269. },
  270. {
  271. title: '明细',
  272. dataIndex: 'detailedNum',
  273. width: '5%',
  274. ellipsis: true,
  275. scopedSlots: { customRender: 'detailedNum' },
  276. className: 'replacecolor',
  277. // slots:{title:'detailedNumTitle'}
  278. },
  279. {
  280. title: '衣架/吨数',
  281. dataIndex: 'coatHanger',
  282. width:'6%',
  283. ellipsis: true,
  284. scopedSlots: { customRender: 'coatHanger' },
  285. className: 'replacecolor'
  286. },
  287. {
  288. // title: '集装箱号',
  289. dataIndex: 'containerNo',
  290. width: '15%',
  291. ellipsis: true,
  292. scopedSlots: { customRender: 'containerNo' },
  293. className: 'replacecolor',
  294. slots:{title:'containerNoTitle'}
  295. },
  296. // {
  297. // // title: '发票号',
  298. // dataIndex: 'invoiceNo',
  299. // width: '9%',
  300. // ellipsis: true,
  301. // scopedSlots: { customRender: 'invoiceNo' },
  302. // className: 'replacecolor',
  303. // slots:{title:'invoiceNoTitle'}
  304. // },
  305. {
  306. // title: '单价',
  307. dataIndex: 'price',
  308. width: '5%',
  309. ellipsis: true,
  310. scopedSlots: { customRender: 'price' },
  311. className: 'replacecolor',
  312. slots:{title:'priceTitle'}
  313. },
  314. {
  315. // title: '总价',
  316. dataIndex: 'totalPrice',
  317. width: '5%',
  318. ellipsis: true,
  319. // scopedSlots: { customRender: 'totalPrice' },
  320. className: 'replacecolor',
  321. slots:{title:'totalPriceTitle'}
  322. },
  323. {
  324. // title: '计划员',
  325. dataIndex: 'jhyByData',
  326. width: '7%',
  327. ellipsis: true,
  328. scopedSlots: { customRender: 'jhyByData' },
  329. className: 'replacecolor',
  330. slots:{title:'jhyByDataTitle'}
  331. },
  332. {
  333. title: '签名',
  334. dataIndex: 'jhyName',
  335. width: '5',
  336. ellipsis: true,
  337. className: 'replacecolor'
  338. },
  339. {
  340. title: '原因',
  341. dataIndex: 'reason',
  342. width: '10%',
  343. ellipsis: true,
  344. scopedSlots: { customRender: 'reason' },
  345. className: 'replacecolor',
  346. // slots:{title:'reasonTitle'}
  347. },
  348. {
  349. title: '备注',
  350. dataIndex: 'demo',
  351. width: '12%',
  352. ellipsis: true,
  353. scopedSlots: { customRender: 'demo' },
  354. className: 'replacecolor'
  355. } ,
  356. {
  357. title: '操作',
  358. dataIndex: 'option',
  359. width: 120,
  360. ellipsis: true,
  361. scopedSlots: { customRender: 'option' },
  362. className: 'replacecolor'
  363. }
  364. ]
  365. },
  366. defultMethods:'add',
  367. url: {
  368. add: "/oa/syCarry/add",
  369. edit: "/oa/syCarry/edit",
  370. syCarryB: {
  371. list: '/oa/syCarry/querySyCarryBByMainId'
  372. },
  373. }
  374. }
  375. },
  376. created(){
  377. this.getOption()
  378. this.getRemarks()
  379. },
  380. methods: {
  381. // 获取表头信息
  382. getHeaderList(id){
  383. getAction('/oa/syCarry/queryById', {id:id}).then((res) => {
  384. if(res.success){
  385. var zhuId = '' //主表id
  386. this.formState=res.result //详情
  387. zhuId = res.result.id
  388. this.getTable(zhuId)
  389. }else{
  390. this.$message.warning(res.message)
  391. }
  392. })
  393. },
  394. getTable(id){
  395. getAction('/oa/syCarry/querySyCarryBByMainId', {id:id}).then((res) => {
  396. if(res.success){
  397. res.result.map(item =>{
  398. if(item.jhyByData !==''&& item.jhyByData){
  399. item.jhyByData = item.jhyByData.split(",")
  400. }
  401. if(item.orderDate !==''&& item.orderDate){
  402. item.orderDate = moment(item.orderDate)
  403. }
  404. })
  405. this.syCarryBTable.dataSource = res.result
  406. }else{
  407. this.$message.warning(res.message)
  408. }
  409. })
  410. },
  411. getRemarks(){
  412. getAction('/sys/dict/getByCodeDict', {table:'sys_dict',text:'description',code:'dict_code',key:'remarks'}).then((res) => {
  413. var arr = res.split(' ')
  414. var c = ''
  415. arr.map((item,index)=>{
  416. if(index !== arr.length-1){
  417. c += item+'\n'
  418. }else{
  419. c+=item
  420. }
  421. })
  422. this.formState.demo = c
  423. })
  424. },
  425. // 计划员模糊查询
  426. filterOption(input, option) {
  427. return (
  428. option.componentOptions.children[0].text
  429. .toLowerCase()
  430. .indexOf(input.toLowerCase()) >= 0
  431. )},
  432. //增行
  433. addList(){
  434. this.syCarryBTable.dataSource.push({
  435. orderDate:'',
  436. allNum:'',
  437. detailedNum:'',
  438. coatHanger:'',
  439. containerNo:'',
  440. cabinets:'',
  441. invoiceNo:'',
  442. price:'',
  443. jhyName:'',
  444. jhyNameData:'',
  445. demo:'',
  446. name:''
  447. })
  448. },
  449. //获取计划员
  450. getOption(){
  451. personList({pageSize:'9999'}).then(res => {
  452. if (res.success) {
  453. res.result.records.map(item =>{
  454. this.jhyNameOption.push({label:item.realname,value:item.username})
  455. })
  456. }else{
  457. this.$message.error(res.message);
  458. }
  459. })
  460. },
  461. //改变计划员
  462. handleChange(record){
  463. this.jhyNameOption.map(item=>{
  464. if(item.value == record.jhyByData){
  465. record.jhyNameData = item.label
  466. }
  467. })
  468. },
  469. // 复制行
  470. copyRow(record){
  471. var newObj = {...record}
  472. this.syCarryBTable.dataSource.push(newObj)
  473. this.formState.totalNum =(Number(this.formState.totalNum) +Number(record.totalPrice)).toFixed(2)
  474. this.$forceUpdate()
  475. },
  476. //删行
  477. deleteRow(record,index){
  478. this.syCarryBTable.dataSource.splice(index,1)
  479. this.formState.totalNum =(Number(this.formState.totalNum) -Number(record.totalPrice)).toFixed(2)
  480. },
  481. /** 调用完edit()方法之后会自动调用此方法 */
  482. // editAfter() {
  483. // this.$nextTick(() => {
  484. // this.form.setFieldsValue(pick(this.model, 'name', 'code', 'demo','total_num'))
  485. // console.log(this.model)
  486. // // 时间格式化
  487. // // this.form.setFieldsValue({ ckTime: this.model.ckTime ? moment(this.model.ckTime) : null })
  488. // // this.form.setFieldsValue({ rsxzTime: this.model.rsxzTime ? moment(this.model.rsxzTime) : null })
  489. // // this.form.setFieldsValue({ cwjlTime: this.model.cwjlTime ? moment(this.model.cwjlTime) : null })
  490. // })
  491. // // 加载子表数据
  492. // if (this.model.id) {
  493. // let params = { id: this.model.id }
  494. // this.requestSubTableData(this.url.syCarryB.list, params, this.syCarryBTable)
  495. // }
  496. // },
  497. // handleAutograph(props){
  498. // var code = '',
  499. // text=''
  500. // this.syCarryBTable.columns[7].options.map(item=>{
  501. // if(item.text ==this.$store.getters.nickname ){
  502. // code = item.value
  503. // text = item.text
  504. // }
  505. // })
  506. // if(code == this.syCarryBTable.dataSource[props.index].jhyName){
  507. // this.syCarryBTable.dataSource[props.index].jhyNameData = text
  508. // })
  509. // },
  510. changeJhy(props){
  511. console.log(this.syCarryBTable.columns[7].options)
  512. },
  513. /** 整理成formData */
  514. classifyIntoFormData(allValues) {
  515. let main = Object.assign(this.model, allValues.formValue)
  516. //时间格式化
  517. // main.ckTime = main.ckTime ? main.ckTime.format('YYYY-MM-DD HH:mm:ss') : null;
  518. // main.rsxzTime = main.rsxzTime ? main.rsxzTime.format('YYYY-MM-DD HH:mm:ss') : null;
  519. // main.cwjlTime = main.cwjlTime ? main.cwjlTime.format('YYYY-MM-DD HH:mm:ss') : null;
  520. return {
  521. ...main, // 展开
  522. syCarryBList: allValues.tablesValue[0].values,
  523. }
  524. },
  525. //保存
  526. handleOk(){
  527. this.$refs.form.validate(async valid => {
  528. if(valid){
  529. var obj = this.formState
  530. this.syCarryBTable.dataSource.map(item=>{
  531. // console.log('ssssssssssss',item.jhyByData.toString());
  532. if(item.jhyByData!=''&&item.jhyByData){
  533. // item.jhyByData.forEach(t => {
  534. // console.log('ssssssssssss',t);
  535. // })
  536. item.jhyByData = item.jhyByData.toString();
  537. }
  538. if(item.orderDate!==''&&item.orderDate){
  539. item.orderDate = moment(item.orderDate).format('YYYY-MM-DD HH:mm:ss');
  540. }
  541. })
  542. obj.syCarryBList = this.syCarryBTable.dataSource
  543. await this.judageTablez(obj.syCarryBList)
  544. if(this.defultMethods == 'add' && this.passVerification == 'yes'){
  545. subimtList(obj).then(res => {
  546. if (res.success) {
  547. this.$message.success('新增成功')
  548. this.handleCancel()
  549. this.$emit('close')
  550. }else{
  551. this.$message.error(res.message);
  552. }
  553. })
  554. }else if(this.passVerification == 'yes'){
  555. putAction('/oa/syCarry/edit', obj).then((res) => {
  556. if(res.success){
  557. this.$message.success('编辑成功')
  558. this.handleCancel()
  559. this.$emit('close')
  560. }else{
  561. this.$message.warning(res.message)
  562. }
  563. })
  564. }
  565. }
  566. })
  567. },
  568. judageTablez(data){
  569. this.passVerification = 'yes'
  570. if(data.length == 0){
  571. this.$message.error('请添加子表数据!');
  572. this.passVerification = 'no'
  573. }else{
  574. for (var i=0; i<data.length;i++){
  575. var tableRow = data[i];
  576. var required = [
  577. {key:'orderDate',value:'日期'},
  578. {key:'price',value:'单价'},
  579. {key:'containerNo',value:'集装箱号'},
  580. {key:'totalPrice',value:'总价'},
  581. {key:'jhyByData',value:'计划员'},
  582. ]
  583. for(var j=0 ; j<required.length;j++){
  584. if(tableRow[required[j].key] == null || tableRow[required[j].key] == "" || tableRow[required[j].key] == undefined){
  585. this.$message.error('第'+(i+1)+'行'+required[j].value+'无值,无法保存');
  586. this.passVerification = 'no'
  587. return
  588. }
  589. }
  590. }
  591. }
  592. },
  593. // 导入
  594. implementImport(file) {
  595. const formData = new FormData()
  596. formData.append('file', file.file)
  597. fileDetail(formData).then(res => {
  598. // this.loading = false
  599. if (res.success) {
  600. this.formState = res.result
  601. this.syCarryBTable.dataSource = res.result.syCarryBList
  602. this.syCarryBTable.dataSource.map(item=>{
  603. item.orderDate = moment(item.orderDate)
  604. })
  605. // this.handleChangePrice()
  606. this.$message.success('导入成功')
  607. // this.
  608. }else{
  609. this.$message.error(res.message);
  610. }
  611. })
  612. },
  613. //关闭
  614. handleCancel(){
  615. this.syCarryBTable.dataSource=[]
  616. this.formState = {}
  617. this.visible = false
  618. this.defultMethods='add'
  619. this.getRemarks()
  620. this.$emit('close')
  621. },
  622. // 价格改变
  623. handleChangePrice(record){
  624. if(record.price && record.coatHanger){
  625. record.totalPrice = Number(record.coatHanger)* Number(record.price)+ Number((record.detailedNum?record.detailedNum:0))
  626. this.$forceUpdate()
  627. }else{
  628. record.totalPrice = record.detailedNum
  629. }
  630. var Hj = 0
  631. this.syCarryBTable.dataSource.map(item=>{
  632. item.coatHanger = Number(item.coatHanger).toFixed(4)
  633. item.totalPrice = Number(item.totalPrice).toFixed(2)
  634. item.price = Number(item.price).toFixed(2)
  635. item.allNum = Number(item.allNum).toFixed(0)
  636. item.cabinets = Number(item.cabinets).toFixed(0)
  637. item.detailedNum = Number(item.detailedNum).toFixed(0)
  638. // if(item.price=='8'&&item.totalPrice>500){
  639. // item.coatHanger = ''
  640. // item.detailedNum = ''
  641. // item.price = ''
  642. // item.totalPrice = ''
  643. // this.$message.error('单价为8的行总价不能超过500,请重新输入单价,衣架/吨数,明细!!');
  644. // }
  645. Hj+= Number(item.totalPrice)
  646. })
  647. this.formState.totalNum = Hj.toFixed(2)
  648. this.$forceUpdate()
  649. }
  650. }
  651. }
  652. </script>
  653. <style scoped lang="less">
  654. /deep/ .nresume .ant-input{
  655. height: 100px !important;
  656. }
  657. /deep/ .td{
  658. text-align:center;
  659. }
  660. // /deep/.ant-form-item{
  661. // width: 31%;
  662. // }
  663. // /deep/.ant-form-horizontal{
  664. // display: flex;
  665. // width: 100%;
  666. // flex-wrap: wrap;
  667. // }
  668. // .nresume{
  669. // width: 100% !important;
  670. // }
  671. // /deep/ .nresume .ant-form-item-label{
  672. // width: 3% !important;
  673. // }
  674. // /deep/ .nresume .ant-form-item-control-wrapper{
  675. // width: 85% !important;
  676. // }
  677. // /deep/ .nresume .ant-input{
  678. // height: 100px !important;
  679. // }
  680. // /deep/ .ant-col-sm-6{
  681. // width: 10%;
  682. // }
  683. /deep/ .ant-select{
  684. width: 100%;
  685. }
  686. /deep/ .input-table .thead .td{
  687. text-align: center;
  688. }
  689. /deep/ .input-table .tbody .td{
  690. text-align: center;
  691. }
  692. /deep/ .ant-table-thead > tr > th {
  693. text-align: center;
  694. // font-weight: 700;
  695. }
  696. /deep/ .ant-table-tbody {
  697. text-align: center;
  698. }
  699. .form-table-heard:before {
  700. content: '*';
  701. color: red;
  702. }
  703. // /deep/.ant-table-fixed-header .ant-table-scroll .ant-table-header{
  704. // width: calc(100% - 8px);//减去滚动条的宽度
  705. // }
  706. </style>