SyCarryDetailModal.vue 13 KB

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