SyCarryDetailModal.vue 12 KB

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