SyCarryDetailModal.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. <template>
  2. <div class="reply" ref = "replyModal">
  3. <a-modal
  4. title="详情"
  5. width="85%"
  6. :visible="visible"
  7. :confirmLoading="confirmLoading"
  8. :getContainer ='()=>$refs.replyModal'
  9. @cancel="handleCancel"
  10. >
  11. <template slot="footer">
  12. <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" @change="handleImportExcel" :customRequest="implementImport" >
  13. <a-button type="primary">导入</a-button>
  14. </a-upload> -->
  15. <a-button @click="handleCancel" style="margin-left: 8px;">关闭</a-button>
  16. </template>
  17. <div class="table-page-search-wrapper">
  18. <a-form-model layout="inline" ref="form" :model="formState" :rules="validatorRules">
  19. <a-row :gutter="24">
  20. <!-- <a-col :md="8" :sm="8">
  21. <a-form-model-item label="编号" prop="code">
  22. <a-input placeholder="请输入" v-model="formState.code" readOnly/>
  23. </a-form-model-item>
  24. </a-col> -->
  25. <a-col :md="6" :sm="8">
  26. <a-form-model-item label="名称" prop="userId">
  27. <a-input placeholder="请输入名称" v-model="formState.name" readOnly/>
  28. </a-form-model-item>
  29. </a-col>
  30. <a-col :md="6" :sm="8">
  31. <a-form-model-item label="合计" prop="code">
  32. <a-input placeholder="请输入" v-model="formState.totalNum" disabled="false"/>
  33. </a-form-model-item>
  34. </a-col>
  35. <a-col :md="12" :sm="8">
  36. <a-form-model-item label="合计大写" prop="code">
  37. <a-input placeholder="请输入" v-model="formState.totalText" disabled="false"/>
  38. </a-form-model-item>
  39. </a-col>
  40. </a-row>
  41. <a-row :gutter="24">
  42. <a-col :md="24" :sm="8">
  43. <a-form-model-item label="备注" prop="code">
  44. <a-input placeholder="请输入" v-model="formState.remarks" readOnly/>
  45. </a-form-model-item>
  46. </a-col>
  47. </a-row>
  48. <a-row :gutter="24">
  49. <a-col :md="24" :sm="8">
  50. <a-form-model-item label="账户信息" class="nresume" style="height:100px !important">
  51. <a-input type="textarea" placeholder="请输入" v-model="formState.demo" readOnly/>
  52. </a-form-model-item>
  53. </a-col>
  54. </a-row>
  55. </a-form-model>
  56. <!-- 主表单区域 -->
  57. <!-- <a-form :model="form">
  58. <a-form-item
  59. :labelCol="labelCol"
  60. :wrapperCol="wrapperCol"
  61. label="编号">
  62. <a-input placeholder="请输入编号" v-decorator="['code', {}]"/>
  63. </a-form-item>
  64. <a-form-item
  65. :labelCol="labelCol"
  66. :wrapperCol="wrapperCol"
  67. label="名称">
  68. <a-input placeholder="请输入名称" v-decorator="['name', {}]"/>
  69. </a-form-item>
  70. <a-form-item label="合计" :labelCol="labelCol" :wrapperCol="wrapperCol" >
  71. <a-input placeholder="请输入" v-decorator="['total_num', {}] "/>
  72. </a-form-item>
  73. <a-form-item
  74. :labelCol="labelCol"
  75. :wrapperCol="wrapperCol"
  76. class="nresume" style="height:100px !important"
  77. label="备注">
  78. <a-input type="textarea" placeholder="请输入备注" v-decorator="['demo', {}]"/>
  79. </a-form-item>
  80. </a-form> -->
  81. <!-- 子表单区域 -->
  82. <a-tabs v-model="activeKey" @change="handleChangeTabs">
  83. <a-tab-pane tab="搬运工对账单" :key="refKeys[0]" :forceRender="true">
  84. <!-- <a-button type="primary" @click="addList">增行</a-button> -->
  85. <a-table
  86. bordered
  87. :columns="syCarryBTable.columns"
  88. :data-source="syCarryBTable.dataSource"
  89. :loading="syCarryBTable.loading"
  90. :scroll="{x: 2000, y:220}"
  91. :pagination="false"
  92. >
  93. <div :title="record.containerNo" :style="{maxWidth: '250px',whiteSpace: 'nowrap',textOverflow: 'ellipsis',overflow: 'hidden', wordWrap: 'break-word', wordBreak: 'break-all' }" slot="containerNo" slot-scope="text, record">
  94. {{record.containerNo}}
  95. </div>
  96. <!-- 操作 -->
  97. <span slot="option" slot-scope="text, record, index">
  98. <a-popconfirm title="确定签字?" @confirm="handelAutograph(record)" okText="确定" cancelText="取消">
  99. <a href="">签名</a>
  100. </a-popconfirm>
  101. </span>
  102. </a-table>
  103. <!-- <j-editable-table
  104. :ref="refKeys[0]"
  105. :loading="syCarryBTable.loading"
  106. :columns="syCarryBTable.columns"
  107. :dataSource="syCarryBTable.dataSource"
  108. :maxHeight="300"
  109. :minWidth="2000"
  110. :rowNumber="false"
  111. :rowSelection="true"
  112. :actionButton="true">
  113. <template v-slot:action="props">
  114. <a @click="handleAutograph(props)">签名</a>
  115. </template> -->
  116. <!-- <template v-slot:jhyName="props">
  117. <a-select @change='changeJhy(props)' >
  118. <a-select-option
  119. v-for="(item,index) in jhyNameOption"
  120. :key="index"
  121. :value="item.value">
  122. {{item.label}}
  123. </a-select-option>
  124. </a-select>
  125. </template> -->
  126. <!-- </j-editable-table> -->
  127. </a-tab-pane>
  128. </a-tabs>
  129. </div>
  130. </a-modal>
  131. </div>
  132. </template>
  133. <script>
  134. import moment from 'moment'
  135. import pick from 'lodash.pick'
  136. import { FormTypes } from '@/utils/JEditableTableUtil'
  137. import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
  138. import { getAction } from '@/api/manage'
  139. import {fileDetail} from '@api/oa/cd-sy-carry'
  140. import JEllipsis from '@/components/jeecg/JEllipsis'
  141. export default {
  142. name: 'SyCarryDetailModa',
  143. mixins: [JEditableTableMixin],
  144. components: {
  145. moment,
  146. JEllipsis
  147. },
  148. data() {
  149. let ellipsis = (v, l) => <j-ellipsis value={v} length={l} /> // 省略
  150. return {
  151. // 新增时子表默认添加几行空数据
  152. addDefaultRowNum: 1,
  153. validatorRules: {
  154. },
  155. formState:{},
  156. refKeys: ['syCarryB', ],
  157. activeKey: 'syCarryB',
  158. jhyNameOption:[],
  159. dateFormat: 'YYYY-MM-DD',
  160. zhuId:'',
  161. // 搬运装卸费用-搬运工对账单-子表
  162. syCarryBTable: {
  163. loading: false,
  164. dataSource: [],
  165. columns: [
  166. {
  167. title: '日期',
  168. align: "center",
  169. dataIndex: 'orderDate',
  170. width: 150,
  171. ellipsis: true,
  172. },
  173. {
  174. title: '入库单号/发票号',
  175. align: "center",
  176. dataIndex: 'invoiceNo',
  177. width: 140,
  178. ellipsis: true,
  179. },
  180. {
  181. title: '外销发票号',
  182. dataIndex: 'saleInvoiceNo',
  183. width: 140,
  184. ellipsis: true,
  185. scopedSlots: { customRender: 'saleInvoiceNo' },
  186. className: 'replacecolor',
  187. // slots:{title:'invoiceNoTitle'}
  188. },
  189. {
  190. title: '总件数',
  191. dataIndex: 'allNum',
  192. width: 120,
  193. ellipsis: true,
  194. className: 'replacecolor',
  195. },
  196. {
  197. title: '柜子数量',
  198. dataIndex: 'cabinets',
  199. width: 120,
  200. ellipsis: true,
  201. className: 'replacecolor'
  202. },
  203. {
  204. title: '明细',
  205. dataIndex: 'detailedNum',
  206. width: 120,
  207. ellipsis: true,
  208. className: 'replacecolor',
  209. // slots:{title:'detailedNumTitle'}
  210. },
  211. {
  212. title: '衣架/吨数',
  213. dataIndex: 'coatHanger',
  214. width:120,
  215. ellipsis: true,
  216. className: 'replacecolor'
  217. },
  218. {
  219. title: '集装箱号',
  220. dataIndex: 'containerNo',
  221. width: 290,
  222. className: 'replacecolor',
  223. // customRender: (t) => ellipsis(t,30),
  224. scopedSlots: { customRender: 'containerNo' },
  225. },
  226. {
  227. title: '单价',
  228. dataIndex: 'price',
  229. width: 100,
  230. ellipsis: true,
  231. className: 'replacecolor',
  232. },
  233. {
  234. title: '总价',
  235. dataIndex: 'totalPrice',
  236. width: 100,
  237. ellipsis: true,
  238. className: 'replacecolor',
  239. },
  240. {
  241. title: '原因',
  242. dataIndex: 'reason',
  243. width: 180,
  244. ellipsis: true,
  245. className: 'replacecolor',
  246. },
  247. {
  248. title: '备注',
  249. dataIndex: 'demo',
  250. width: 180,
  251. ellipsis: true,
  252. className: 'replacecolor'
  253. } ,
  254. {
  255. title: '计划员',
  256. dataIndex: 'jhyNameData',
  257. width: 240,
  258. fixed:'right',
  259. ellipsis: true,
  260. className: 'replacecolor',
  261. },
  262. {
  263. title: '签名',
  264. dataIndex: 'jhyName',
  265. width: 100,
  266. fixed:'right',
  267. ellipsis: true,
  268. className: 'replacecolor'
  269. },
  270. {
  271. title: '操作',
  272. dataIndex: 'option',
  273. width: 100,
  274. ellipsis: true,
  275. fixed:'right',
  276. scopedSlots: { customRender: 'option' },
  277. className: 'replacecolor'
  278. }
  279. ]
  280. },
  281. url: {
  282. add: "/oa/syCarry/add",
  283. edit: "/oa/syCarry/edit",
  284. syCarryB: {
  285. list: '/oa/syCarry/querySyCarryBByMainId'
  286. },
  287. }
  288. }
  289. },
  290. created(){
  291. },
  292. methods: {
  293. // 获取表头信息
  294. getHeaderList(id){
  295. this.zhuId = id
  296. getAction('/oa/syCarry/queryById', {id:id}).then((res) => {
  297. if(res.success){
  298. var zhuId = '' //主表id
  299. this.formState=res.result //详情
  300. zhuId = res.result.id
  301. this.getTable(zhuId)
  302. }else{
  303. this.$message.warning(res.message)
  304. }
  305. })
  306. },
  307. getTable(id){
  308. getAction('/oa/syCarry/querySyCarryBByMainId', {id:id}).then((res) => {
  309. if(res.success){
  310. res.result.map(item =>{
  311. if(item.orderDate !==''&& item.orderDate){
  312. item.orderDate = moment(item.orderDate).format('YYYY-MM-DD')
  313. }
  314. })
  315. this.syCarryBTable.dataSource = res.result
  316. }else{
  317. this.$message.warning(res.message)
  318. }
  319. })
  320. },
  321. handelAutograph(record){
  322. getAction('/oa/syCarry/signPlan', {id:record.id}).then((res) => {
  323. if(res.success){
  324. this.getHeaderList(this.zhuId)
  325. this.$message.success('签名成功');
  326. }else{
  327. this.$message.warning(res.message)
  328. }
  329. })
  330. // if(record.jhyNameData == this.$store.getters.nickname){
  331. // record.jhyName = record.jhyNameData
  332. // }else{
  333. // this.$message.error('不可签名');
  334. // }
  335. },
  336. // 导入
  337. implementImport(file) {
  338. const formData = new FormData()
  339. formData.append('file', file.file)
  340. fileDetail(formData).then(res => {
  341. // this.loading = false
  342. if (res.success) {
  343. // this.visible = true
  344. this.message = res.message.split(';').filter((element) => {
  345. return element !== "";
  346. });
  347. this.file = file
  348. this.$message.success('导入成功')
  349. }else{
  350. this.$message.error(res.message);
  351. }
  352. })
  353. },
  354. //关闭
  355. handleCancel(){
  356. this.syCarryBTable.dataSource=[]
  357. this.formState = {}
  358. this.visible = false
  359. this.zhuId = ''
  360. this.$emit('close')
  361. },
  362. }
  363. }
  364. </script>
  365. <style scoped lang="less">
  366. /deep/ .nresume .ant-input{
  367. height: 100px !important;
  368. }
  369. /deep/ .td{
  370. text-align:center;
  371. }
  372. // /deep/.ant-form-item{
  373. // width: 31%;
  374. // }
  375. // /deep/.ant-form-horizontal{
  376. // display: flex;
  377. // width: 100%;
  378. // flex-wrap: wrap;
  379. // }
  380. // .nresume{
  381. // width: 100% !important;
  382. // }
  383. // /deep/ .nresume .ant-form-item-label{
  384. // width: 3% !important;
  385. // }
  386. // /deep/ .nresume .ant-form-item-control-wrapper{
  387. // width: 85% !important;
  388. // }
  389. // /deep/ .nresume .ant-input{
  390. // height: 100px !important;
  391. // }
  392. // /deep/ .ant-col-sm-6{
  393. // width: 10%;
  394. // }
  395. /deep/ .ant-select{
  396. width: 100%;
  397. }
  398. /deep/ .input-table .thead .td{
  399. text-align: center;
  400. }
  401. /deep/ .input-table .tbody .td{
  402. text-align: center;
  403. }
  404. /deep/ .ant-table-thead > tr > th {
  405. text-align: center;
  406. // font-weight: 700;
  407. }
  408. /deep/ .ant-table-tbody {
  409. text-align: center;
  410. }
  411. /deep/.ant-table-tbody>tr>td{
  412. white-space: break-spaces;
  413. }
  414. /deep/ .ant-calendar-picker{
  415. width: 113px !important;
  416. }
  417. /deep/ .ant-table-fixed-left table,.ant-table-fixed-right table{
  418. width: min-content;
  419. }
  420. /deep/ .ant-table-fixed-left table,.ant-table-fixed-right table{
  421. width: min-content;
  422. }
  423. /deep/ .ant-table-tbody .ant-table-row td {
  424. padding-top: 7px !important;
  425. padding-bottom: 7px !important;
  426. }
  427. /deep/ .ant-table-thead > tr > th, .ant-table-tbody > tr > td {
  428. padding: 7px 16px;
  429. }
  430. /deep/ .table-page-search-wrapper .ant-form-inline .ant-form-item > .ant-form-item-label {
  431. width: 118px;
  432. }
  433. </style>