list.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <template>
  2. <a-card :bordered="false" class="purchaseOrderList-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 v-model="queryParam.creatDate" id="purchaseOrderList-creatDate"/>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :md="6" :sm="24">
  13. <a-form-item label="采购单号">
  14. <a-input id="purchaseOrderList-purchaseNo" v-model.trim="queryParam.purchaseNo" allowClear placeholder="请输入采购单号"/>
  15. </a-form-item>
  16. </a-col>
  17. <a-col :md="6" :sm="24">
  18. <a-form-item label="供应商" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
  19. <a-select id="purchaseOrderList-customeName" placeholder="请选择供应商" allowClear v-model="queryParam.dataSourceNo" :showSearch="true" option-filter-prop="children" :filter-option="filterOption">
  20. <a-select-option v-for="item in customeList" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
  21. </a-select>
  22. </a-form-item>
  23. </a-col>
  24. <template v-if="advanced">
  25. <a-col :md="6" :sm="24">
  26. <a-form-item label="单据状态">
  27. <v-select
  28. v-model="queryParam.billStatus"
  29. ref="billStatus"
  30. id="purchaseOrderList-billStatus"
  31. code="PAYMENT_TYPE"
  32. placeholder="请选择单据状态"
  33. allowClear></v-select>
  34. </a-form-item>
  35. </a-col>
  36. <a-col :md="6" :sm="24">
  37. <a-form-item label="结算状态">
  38. <v-select
  39. v-model="queryParam.billStatus"
  40. ref="billStatus"
  41. id="purchaseOrderList-billStatus"
  42. code="PAYMENT_TYPE"
  43. placeholder="请选择结算状态"
  44. allowClear></v-select>
  45. </a-form-item>
  46. </a-col>
  47. </template>
  48. <a-col :md="6" :sm="24">
  49. <span class="table-page-search-submitButtons">
  50. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="purchaseOrderList-refresh">查询</a-button>
  51. <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="purchaseOrderList-reset">重置</a-button>
  52. <a @click="advanced=!advanced" style="margin-left: 8px">
  53. {{ advanced ? '收起' : '展开' }}
  54. <a-icon :type="advanced ? 'up' : 'down'"/>
  55. </a>
  56. </span>
  57. </a-col>
  58. </a-row>
  59. </a-form>
  60. </div>
  61. <!-- 操作按钮 -->
  62. <div class="table-operator">
  63. <a-button id="purchaseOrderList-add" type="primary" @click="handleAdd">新增采购单(箭冠)</a-button>
  64. </div>
  65. <!-- alert -->
  66. <a-alert type="info" showIcon style="margin-bottom:15px">
  67. <div slot="message">共 <strong>6</strong> 条记录,采购数量合计 <strong>14</strong> ,采购金额合计¥<strong>14.00</strong> </div>
  68. </a-alert>
  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. bordered>
  78. <!-- 采购单号 -->
  79. <template slot="purchaseNo" slot-scope="text, record">
  80. <span style="color: #ed1c24;cursor: pointer;">{{record.purchaseNo}}</span>
  81. </template>
  82. <!-- 状态 -->
  83. <template slot="state" slot-scope="text, record">
  84. <span>{{record.state == 1 ? '已启用' : '已禁用'}}</span>
  85. </template>
  86. <!-- 操作 -->
  87. <template slot="action" slot-scope="text, record">
  88. <a-button size="small" type="primary" @click="handleEdit(record)" id="purchasingManagement-edit-btn">编辑</a-button>
  89. <a-button size="small" type="dashed" @click="handleDetail(record)" id="purchasingManagement-detail-btn" style="margin: 0 0 10px 8px">详情</a-button>
  90. <a-button size="small" @click="handleSubmit(record)" id="purchasingManagement-submit-btn" style="margin: 0 0 10px 8px">提交</a-button>
  91. <a-button size="small" type="primary" @click="handleWarehouse(record)" id="purchasingManagement-warehouse-btn" style="margin: 0 0 0 8px">签收入库</a-button>
  92. <a-button size="small" type="danger" @click="handleDel(record)" id="purchasingManagement-del-btn" style="margin: 0 0 0 8px">删除</a-button>
  93. </template>
  94. </s-table>
  95. <!-- 选择基本信息弹框 -->
  96. <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
  97. </a-card>
  98. </template>
  99. <script>
  100. import moment from 'moment'
  101. import { STable, VSelect } from '@/components'
  102. import basicInfoModal from './basicInfoModal.vue'
  103. // import { getRoleList, getServiceList } from '@/api/manage'
  104. export default {
  105. components: { STable, VSelect, basicInfoModal },
  106. data () {
  107. return {
  108. advanced: false, // 高级搜索 展开/关闭
  109. disabled: false, // 查询、重置按钮是否可操作
  110. openModal: false, // 基本信息弹框是否显示
  111. customeList:[],
  112. // 查询参数
  113. queryParam: {},
  114. // 表头
  115. columns: [
  116. { title: '采购单号', scopedSlots: { customRender: 'purchaseNo' }, align: 'center' },
  117. { title: '创建时间', dataIndex: 'creatDate', align: 'center' },
  118. { title: '供应商', dataIndex: 'custName', align: 'center' },
  119. { title: '产品款数', dataIndex: 'totalP', align: 'center' },
  120. { title: '采购数量', dataIndex: 'totalNums', align: 'center' },
  121. { title: '采购金额', dataIndex: 'totalPrice', align: 'center' },
  122. { title: '单据状态', dataIndex: 'payType', align: 'center' },
  123. { title: '结算状态', dataIndex: 'mementPay', align: 'center' },
  124. { title: '重要提示', dataIndex: 'shDate', align: 'center' },
  125. { title: '操作', scopedSlots: { customRender: 'action' }, width: 270, align: 'center' }
  126. ],
  127. // 加载数据方法 必须为 Promise 对象
  128. loadData: parameter => {
  129. this.disabled = true
  130. // return customerBundleDelayList( 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. const _this = this
  140. return new Promise(function(resolve, reject){
  141. const data = {
  142. pageNo: 1,
  143. pageSize: 10,
  144. list: [
  145. { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
  146. ],
  147. count: 10
  148. }
  149. const no = (data.pageNo - 1) * data.pageSize
  150. for (var i = 0; i < data.list.length; i++) {
  151. data.list[i].no = no + i + 1
  152. }
  153. _this.disabled = false
  154. resolve(data)
  155. })
  156. },
  157. }
  158. },
  159. methods: {
  160. // 新增
  161. handleAdd(){
  162. this.openModal = true
  163. },
  164. // 基本信息 保存
  165. handleOk(){
  166. this.$router.push({ path: `/purchasingManagement/purchaseOrder/add` })
  167. },
  168. // 编辑
  169. handleEdit (row) {
  170. this.$router.push({ path: `/purchasingManagement/purchaseOrder/edit/${row.id}`})
  171. },
  172. // 详情
  173. handleDetail(row){
  174. this.$router.push({ path: `/purchasingManagement/purchaseOrder/detail/${row.id}`})
  175. },
  176. // 提交
  177. handleSubmit(){
  178. },
  179. // 签收入库
  180. handleWarehouse(row){
  181. this.$router.push({ path: `/purchasingManagement/purchaseOrder/warehousing/${row.id}`})
  182. },
  183. // 删除
  184. handleDel(row){
  185. const _this = this
  186. this.$confirm({
  187. title: '提示',
  188. content: '删除后不可恢复,确定要进行删除吗?',
  189. okText: '确定',
  190. cancelText: '取消',
  191. centered: true,
  192. onOk () {
  193. // delectRolePower({
  194. // id: row.id
  195. // }).then(res => {
  196. // console.log(res, 'res1111')
  197. // if (res.status == 200) {
  198. // _this.$message.success(res.message)
  199. // _this.$refs.table.refresh()
  200. // }
  201. // })
  202. }
  203. })
  204. },
  205. // 重置
  206. resetSearchForm () {
  207. this.queryParam.orderBundleNo = ''
  208. this.queryParam.orderBundle.custMobile = ''
  209. this.queryParam.bundleName = ''
  210. this.queryParam.itemName = ''
  211. this.oldTime = undefined
  212. this.newTime = undefined
  213. this.$refs.table.refresh(true)
  214. },
  215. filterOption(input, option) {
  216. return (
  217. option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
  218. )
  219. },
  220. },
  221. beforeRouteEnter (to, from, next) {
  222. next(vm => {
  223. vm.openModal = false
  224. })
  225. }
  226. }
  227. </script>
  228. <style lang="less">
  229. .purchaseOrderList-wrap{
  230. .sTable{
  231. margin-top: 15px;
  232. }
  233. }
  234. </style>