document.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <!-- 推送失败单据 -->
  3. <div id="document">
  4. <!-- 查询 -->
  5. <a-card :bordered="false">
  6. <div class="table-page-search-wrapper">
  7. <a-form layout="inline" @keyup.enter.native="searchQuery">
  8. <a-row :gutter="24">
  9. <a-col :md="6" :sm="8">
  10. <a-form-item label="单据号">
  11. <a-input placeholder="请输入单据号" v-model="queryParam.documentNum"></a-input>
  12. </a-form-item>
  13. </a-col>
  14. <a-col :md="6" :sm="8">
  15. <a-form-item label="开始时间">
  16. <a-date-picker
  17. placeholder="请选择开始时间"
  18. :format="dateFormat"
  19. style="width: 100%"
  20. v-model="queryParam.startTime"
  21. />
  22. </a-form-item>
  23. </a-col>
  24. <a-col :md="6" :sm="8">
  25. <a-form-item label="结束时间" style="width:100%;">
  26. <a-date-picker
  27. placeholder="请选择结束时间"
  28. :format="dateFormat"
  29. style="width: 100%"
  30. v-model="queryParam.endTime"
  31. />
  32. </a-form-item>
  33. </a-col>
  34. <template v-if="toggleSearchStatus">
  35. <a-col :md="6" :sm="8">
  36. <a-form-item label="单据类型">
  37. <a-select v-model="queryParam.documentType">
  38. <a-select-option value="">请选择</a-select-option>
  39. <a-select-option :value="0">发运明细</a-select-option>
  40. <a-select-option :value="1">预装箱单</a-select-option>
  41. <a-select-option :value="2">预托书</a-select-option>
  42. <a-select-option :value="3">装箱单</a-select-option>
  43. <a-select-option :value="4">托书</a-select-option>
  44. <a-select-option :value="5">申报要素</a-select-option>
  45. </a-select>
  46. </a-form-item>
  47. </a-col>
  48. </template>
  49. <a-col :md="6" :sm="8">
  50. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  51. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  52. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  53. <a @click="handleToggleSearch" style="margin-left: 8px">
  54. {{ toggleSearchStatus ? '收起' : '展开' }}
  55. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  56. </a>
  57. </span>
  58. </a-col>
  59. </a-row>
  60. </a-form>
  61. </div>
  62. </a-card>
  63. <!-- 子表 -->
  64. <a-card :bordered="false" style=" marginTop:10px;">
  65. <a-table
  66. bordered
  67. :row-key="record => record.id"
  68. :columns="documentColumns"
  69. :data-source="documentData"
  70. :loading="loading"
  71. :pagination="ipagination"
  72. @change="handleTableChange"
  73. >
  74. <!-- 推送状态 -->
  75. <!-- slot-scope="text, record" -->
  76. <span slot="pushStateSlot">
  77. <!-- v-if="record.isRelease == '0'" -->
  78. <a-tag color="red">推送失败</a-tag>
  79. <!-- <a-tag color="green" v-else>推送成功</a-tag> -->
  80. </span>
  81. <!-- 操作 根据推送状态进行判断 -->
  82. <span slot="operationSlot" slot-scope="text, record">
  83. <a href="javascript:void(0);" @click="rePush(record)" style="color:green">重新推送</a>
  84. </span>
  85. </a-table>
  86. </a-card>
  87. </div>
  88. </template>
  89. <script>
  90. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  91. import JEllipsis from '@/components/jeecg/JEllipsis'
  92. import moment from 'moment'
  93. export default {
  94. name: 'Document', // 推送失败单据
  95. mixins: [JeecgListMixin],
  96. components: { JEllipsis, moment },
  97. data() {
  98. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
  99. return {
  100. loading: false, // 表格加载
  101. id: '',
  102. // 表头
  103. documentColumns: [
  104. {
  105. title: '单据类型',
  106. dataIndex: 'documentType',
  107. width: 160,
  108. className: 'replacecolor'
  109. },
  110. {
  111. title: '单据号',
  112. dataIndex: 'documentNum',
  113. width: 180,
  114. className: 'replacecolor'
  115. },
  116. // {
  117. // title: '创建时间',
  118. // dataIndex: 'createTime',
  119. // align: 'center',
  120. // sorter: true,
  121. // customRender: text => {
  122. // return moment(text).format('YYYY-MM-DD')
  123. // }
  124. // },
  125. {
  126. title: '单据日期',
  127. dataIndex: 'documentDate',
  128. width: 180,
  129. className: 'replacecolor'
  130. },
  131. {
  132. title: '推送状态',
  133. dataIndex: 'pushState',
  134. scopedSlots: { customRender: 'pushStateSlot' },
  135. width: 140,
  136. className: 'replacecolor'
  137. },
  138. {
  139. title: '原因',
  140. dataIndex: 'reason',
  141. width: '200',
  142. customRender: t => ellipsis(t),
  143. className: 'replacecolor'
  144. },
  145. {
  146. title: '操作',
  147. dataIndex: 'operation',
  148. scopedSlots: { customRender: 'operationSlot' },
  149. width: 160,
  150. className: 'replacecolor'
  151. }
  152. ],
  153. documentData: [{ documentType: '发运明细' }, { documentType: '预装箱单' }],
  154. // 查询条件
  155. queryParam: {
  156. documentNum: '', // 单据号
  157. startTime: '',
  158. endTime: '',
  159. documentType: ''
  160. },
  161. dateFormat: 'YYYY-MM-DD'
  162. }
  163. },
  164. created() {
  165. // this.getShipmentList() // 推送失败的所有单据
  166. },
  167. methods: {
  168. // 查询按钮
  169. searchQuery() {
  170. // this.getAnnList() // 渲染公告
  171. },
  172. // 重置
  173. searchReset() {
  174. console.log('>>>>重置')
  175. this.queryParam = {}
  176. // this.getAnnList()
  177. },
  178. // 操作 重新推送
  179. rePush() {}
  180. // 分页、排序、筛选变化时触发
  181. // handleTableChange(pagination, filters, sorter) {
  182. // // console.log('当前页信息>>>>',pagination)
  183. // this.queryParam.pageNo = pagination.current
  184. // // this.getAnnList()
  185. // }
  186. },
  187. computed: {},
  188. mounted() {}
  189. }
  190. </script>
  191. <style lang="less" scoped>
  192. @import '~@assets/less/common.less';
  193. @import '~@assets/less/overwriter.less';
  194. /deep/ .ant-table-thead > tr > th {
  195. text-align: center;
  196. // font-weight: 700;
  197. }
  198. /deep/ .ant-table-tbody {
  199. text-align: center;
  200. }
  201. // /deep/ th.replacecolor {
  202. // background-color: #ccc;
  203. // }
  204. </style>