list.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <a-card size="small" :bordered="false" class="chainTransferOutList-wrap">
  3. <!-- 搜索条件 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
  6. <a-row :gutter="15">
  7. <a-col :md="6" :sm="24">
  8. <a-form-item label="创建时间">
  9. <a-range-picker
  10. style="width:100%"
  11. id="chainTransferOutList-createDate"
  12. :disabledDate="disabledDate"
  13. v-model="createDate"
  14. :format="dateFormat"
  15. :placeholder="['开始时间', '结束时间']" />
  16. </a-form-item>
  17. </a-form-item>
  18. </a-col>
  19. <a-col :md="6" :sm="24">
  20. <a-form-item label="调往对象">
  21. <v-select
  22. v-model="queryParam.putTenantName"
  23. ref="putTenantName"
  24. id="chainTransferOutList-putTenantName"
  25. code="PAYMENT_TYPE"
  26. placeholder="请选择调往对象"
  27. allowClear></v-select>
  28. </a-form-item>
  29. </a-col>
  30. <a-col :md="6" :sm="24">
  31. <a-form-item label="调出产品类型">
  32. <v-select
  33. v-model="queryParam.allocationType"
  34. ref="allocationType"
  35. id="chainTransferOutList-allocationType"
  36. code="PAYMENT_TYPE"
  37. placeholder="请选择调出产品类型"
  38. allowClear></v-select>
  39. </a-form-item>
  40. </a-col>
  41. <template v-if="advanced">
  42. <a-col :md="6" :sm="24">
  43. <a-form-item label="单据状态">
  44. <v-select
  45. v-model="queryParam.state"
  46. ref="state"
  47. id="chainTransferOutList-state"
  48. code="PAYMENT_TYPE"
  49. placeholder="请选择单据状态"
  50. allowClear></v-select>
  51. </a-form-item>
  52. </a-col>
  53. </template>
  54. <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
  55. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="chainTransferOutList-refresh">查询</a-button>
  56. <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="chainTransferOutList-reset">重置</a-button>
  57. <a @click="advanced=!advanced" style="margin-left: 8px">
  58. {{ advanced ? '收起' : '展开' }}
  59. <a-icon :type="advanced ? 'up' : 'down'"/>
  60. </a>
  61. </a-col>
  62. </a-row>
  63. </a-form>
  64. </div>
  65. <!-- 操作按钮 -->
  66. <div class="table-operator">
  67. <a-button id="chainTransferOutList-add" type="primary" class="button-error" @click="openModal=true">新增</a-button>
  68. </div>
  69. <!-- 列表 -->
  70. <s-table
  71. class="sTable"
  72. ref="table"
  73. size="default"
  74. :rowKey="(record) => record.id"
  75. :columns="columns"
  76. :data="loadData"
  77. :scroll="{ x: 1680 }"
  78. bordered>
  79. <!-- 连锁调出单号 -->
  80. <template slot="allocationLinkageOutNo" slot-scope="text, record">
  81. <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.allocationLinkageOutNo }}</span>
  82. </template>
  83. <!-- 操作 -->
  84. <template slot="action" slot-scope="text, record">
  85. <a-button size="small" type="link" class="button-success" @click="handleExamine(record)" id="chainTransferOutList-examine-btn">审核</a-button>
  86. <a-button size="small" type="link" class="button-info" @click="handleEdit(record)" id="chainTransferOutList-edit-btn">编辑</a-button>
  87. <a-button size="small" type="link" class="button-warning" @click="handleOut(record)" id="chainTransferOutList-out-btn">出库</a-button>
  88. <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="chainTransferOutList-del-btn">删除</a-button>
  89. </template>
  90. </s-table>
  91. <!-- 新增/编辑 -->
  92. <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
  93. </a-card>
  94. </template>
  95. <script>
  96. import { STable, VSelect } from '@/components'
  97. import basicInfoModal from './basicInfoModal.vue'
  98. import { allocLinkageOutList } from '@/api/allocLinkageOut'
  99. export default {
  100. components: { STable, VSelect, basicInfoModal },
  101. data () {
  102. return {
  103. advanced: false, // 高级搜索 展开/关闭
  104. createDate: undefined, // 创建时间
  105. queryParam: { // 查询条件
  106. putTenantName: undefined, // 调往对象
  107. allocationType: undefined, // 调出产品类型
  108. state: undefined // 单据状态
  109. },
  110. disabled: false, // 查询、重置按钮是否可操作
  111. dateFormat: 'YYYY-MM-DD',
  112. columns: [
  113. { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
  114. { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
  115. { title: '连锁调出单号', scopedSlots: { customRender: 'allocationLinkageOutNo' }, align: 'center' },
  116. { title: '调往对象', dataIndex: 'putTenantName', width: 180, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  117. { title: '总款数', dataIndex: 'productTotalCategory', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  118. { title: '总数量', dataIndex: 'productTotalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  119. { title: '总成本', dataIndex: 'productTotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  120. { title: '审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  121. { title: '调拨类型', dataIndex: 'allocationType', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  122. { title: '业务状态', dataIndex: 'stateDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
  123. { title: '财务状态', dataIndex: 'settleStateDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
  124. { title: '操作', scopedSlots: { customRender: 'action' }, width: 210, align: 'center', fixed: 'right' }
  125. ],
  126. // 加载数据方法 必须为 Promise 对象
  127. loadData: parameter => {
  128. this.disabled = true
  129. this.queryParam = {}
  130. return allocLinkageOutList(Object.assign(parameter, this.queryParam)).then(res => {
  131. const data = res.data
  132. const no = (data.pageNo - 1) * data.pageSize
  133. for (var i = 0; i < data.list.length; i++) {
  134. data.list[i].no = no + i + 1
  135. }
  136. this.disabled = false
  137. return data
  138. })
  139. },
  140. openModal: false, // 新增编辑 弹框
  141. itemId: '' // 当前品牌id
  142. }
  143. },
  144. methods: {
  145. // 不可选日期
  146. disabledDate (date, dateStrings) {
  147. return date && date.valueOf() > Date.now()
  148. },
  149. // 重置
  150. resetSearchForm () {
  151. this.queryParam.putTenantName = undefined
  152. this.queryParam.allocationType = undefined
  153. this.queryParam.state = undefined
  154. this.createDate = undefined
  155. this.$refs.table.refresh(true)
  156. },
  157. // 基本信息 保存
  158. handleOk (data) {
  159. this.$router.push({ path: `/allocationManagement/chainTransferOut/add/${data.allocationLinkageOutSn}` })
  160. },
  161. // 删除
  162. handleDel (row) {
  163. const _this = this
  164. this.$confirm({
  165. title: '提示',
  166. content: '删除后不可恢复,确定要进行删除吗?',
  167. centered: true,
  168. onOk () {
  169. // delectRolePower({
  170. // id: row.id
  171. // }).then(res => {
  172. // console.log(res, 'res1111')
  173. // if (res.status == 200) {
  174. // _this.$message.success(res.message)
  175. // _this.$refs.table.refresh()
  176. // }
  177. // })
  178. }
  179. })
  180. },
  181. // 出库
  182. handleOut (row) {
  183. },
  184. // 审核
  185. handleExamine () {
  186. const _this = this
  187. this.$confirm({
  188. title: '提示',
  189. content: '确认要审核通过吗?',
  190. centered: true,
  191. onOk () {
  192. // delectRolePower({
  193. // id: row.id
  194. // }).then(res => {
  195. // console.log(res, 'res1111')
  196. // if (res.status == 200) {
  197. // _this.$message.success(res.message)
  198. // _this.$refs.table.refresh()
  199. // }
  200. // })
  201. }
  202. })
  203. },
  204. // 详情
  205. handleDetail (row) {
  206. this.$router.push({ path: `/allocationManagement/chainTransferOut/detail/${row.id}/${row.allocationLinkageOutSn}` })
  207. },
  208. // 新增/编辑
  209. handleEdit (row) {
  210. this.$router.push({ path: `/allocationManagement/chainTransferOut/edit/${row.id}/${row.allocationLinkageOutSn}` })
  211. }
  212. }
  213. }
  214. </script>