queryPart.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <div class="productInfoList-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.shDate" id="salesReturn-shDate"/>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :md="6" :sm="24">
  13. <a-form-item label="产品编码">
  14. <a-input id="productInfoList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入产品编码"/>
  15. </a-form-item>
  16. </a-col>
  17. <a-col :md="6" :sm="24">
  18. <a-form-item label="产品名称">
  19. <a-input id="productInfoList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入产品名称"/>
  20. </a-form-item>
  21. </a-col>
  22. <template v-if="advanced">
  23. <a-col :md="6" :sm="24">
  24. <a-form-item label="销售单号">
  25. <a-input id="productInfoList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入销售单号"/>
  26. </a-form-item>
  27. </a-col>
  28. </template>
  29. <a-col :md="6" :sm="24">
  30. <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
  31. <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productInfoList-reset">重置</a-button>
  32. <a @click="advanced=!advanced" style="margin:0 15px 0 8px">
  33. {{ advanced ? '收起' : '展开' }}
  34. <a-icon :type="advanced ? 'up' : 'down'"/>
  35. </a>
  36. </a-col>
  37. </a-row>
  38. </a-form>
  39. </div>
  40. <!-- 列表 -->
  41. <s-table
  42. class="sTable"
  43. ref="table"
  44. size="default"
  45. :rowKey="(record) => record.id"
  46. :columns="columns"
  47. :data="loadData"
  48. :scroll="{ x: 1700, y: 300 }"
  49. bordered>
  50. <!-- 价格 -->
  51. <template slot="price" slot-scope="text, record">
  52. {{ text }} 元
  53. </template>
  54. <span slot="customTitle">
  55. 操作
  56. <a-popover>
  57. <template slot="content">
  58. 双击列表配件可快速选中添加
  59. </template>
  60. <a-icon type="question-circle" theme="twoTone" />
  61. </a-popover>
  62. </span>
  63. <!-- 操作 -->
  64. <template slot="action" slot-scope="text, record">
  65. <a-button type="primary" size="small" @click="handleadd(record)" id="productInfoList-edit-btn">添加</a-button>
  66. </template>
  67. </s-table>
  68. </div>
  69. </template>
  70. <script>
  71. // import { customerBundleDelayList, customerBundleExportDelay } from '@/api/FinancialManagement'
  72. import { STable, VSelect } from '@/components'
  73. export default {
  74. name: 'QueryPart',
  75. components: { STable, VSelect },
  76. data () {
  77. return {
  78. advanced: false, // 高级搜索 展开/关闭
  79. queryParam: { // 查询条件
  80. bundleName: '', // 供应商名称
  81. state: undefined // 状态
  82. },
  83. disabled: false, // 查询、重置按钮是否可操作
  84. exportLoading: false, // 导出loading
  85. brandData: [], // 下拉数据
  86. typeData: [], // 产品类别 下拉数据
  87. columns: [
  88. {
  89. title: '序号',
  90. dataIndex: 'no',
  91. align: 'center',
  92. width: 100
  93. },
  94. {
  95. title: '产品编码',
  96. dataIndex: 'productNo',
  97. align: 'center',
  98. sorter: true
  99. },
  100. {
  101. title: '产品名称',
  102. dataIndex: 'productName',
  103. align: 'center'
  104. },
  105. {
  106. title: '原厂编码',
  107. dataIndex: 'ycNo',
  108. align: 'center'
  109. },
  110. {
  111. title: '销售单号',
  112. dataIndex: 'productBrand',
  113. align: 'center'
  114. },
  115. {
  116. title: '销售审核时间',
  117. dataIndex: 'cangku',
  118. align: 'center'
  119. },
  120. {
  121. title: '售价',
  122. dataIndex: 'price',
  123. align: 'center',
  124. width: 150,
  125. scopedSlots: { customRender: 'price' }
  126. },
  127. {
  128. title: '单位',
  129. dataIndex: 'dw',
  130. align: 'center'
  131. },
  132. {
  133. title: '销售数量',
  134. dataIndex: 'salesNums',
  135. align: 'center'
  136. },
  137. {
  138. title: '已退数量',
  139. dataIndex: 'returnNums',
  140. align: 'center'
  141. },
  142. { slots: { title: 'customTitle' }, scopedSlots: { customRender: 'action' }, width: 100, align: 'center' }
  143. ],
  144. // 加载数据方法 必须为 Promise 对象
  145. loadData: parameter => {
  146. this.disabled = true
  147. // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
  148. // const data = res.data
  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. // return data
  155. // })
  156. const _this = this
  157. return new Promise(function (resolve, reject) {
  158. const data = {
  159. pageNo: 1,
  160. pageSize: 10,
  161. list: [
  162. {
  163. id: '1',
  164. productNo: 'jgqp11111111111',
  165. productName: '产品1',
  166. ycNo: 'jgqp111123545',
  167. productBrand: '箭冠品牌',
  168. productType: '产品分类1',
  169. price: 5.6,
  170. salesNums: 12,
  171. dw: '个'
  172. }
  173. ],
  174. count: 10
  175. }
  176. const no = (data.pageNo - 1) * data.pageSize
  177. for (var i = 0; i < data.list.length; i++) {
  178. data.list[i].no = no + i + 1
  179. }
  180. _this.disabled = false
  181. resolve(data)
  182. })
  183. },
  184. openModal: false, // 查看客户详情 弹框
  185. itemId: '' // 当前产品id
  186. }
  187. },
  188. methods: {
  189. // 重置
  190. resetSearchForm () {
  191. this.queryParam.orderBundleNo = ''
  192. this.queryParam.orderBundle.custMobile = ''
  193. this.queryParam.bundleName = ''
  194. this.queryParam.itemName = ''
  195. this.oldTime = undefined
  196. this.newTime = undefined
  197. this.$refs.table.refresh(true)
  198. },
  199. filterOption (input, option) {
  200. return (
  201. option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
  202. )
  203. },
  204. // 选择配件
  205. handleadd (row) {
  206. this.$emit('add', row)
  207. },
  208. // 销售记录
  209. handleDetail (row) {
  210. this.itemId = row.id
  211. this.openModal = true
  212. },
  213. // 关闭弹框
  214. closeModal () {
  215. this.itemId = ''
  216. this.openModal = false
  217. }
  218. }
  219. }
  220. </script>