list.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <template>
  2. <a-card size="small" :bordered="false" class="provinceTypeSalesDetailsList-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. <rangeDate ref="rangeDate" @change="dateChange" />
  10. </a-form-item>
  11. </a-col>
  12. <a-col :md="6" :sm="24">
  13. <a-form-item label="销售单号">
  14. <a-input id="bulkWarehousingOrderList-productCode" v-model.trim="queryParam.productCode" 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="productPricingList-queryWord" v-model.trim="queryParam.queryWord" 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-select id="provinceTypeSalesDetailsList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择区域" allowClear >
  26. <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
  27. </a-select>
  28. </a-form-item>
  29. </a-col>
  30. <a-col :md="6" :sm="24">
  31. <a-form-item label="省份">
  32. <a-select id="provinceTypeSalesDetailsList-state" v-model="queryParam.state" placeholder="请选择省份" allowClear >
  33. <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
  34. </a-select>
  35. </a-form-item>
  36. </a-col>
  37. <a-col :md="6" :sm="24">
  38. <a-form-item label="产品名称">
  39. <a-input id="productPricingList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
  40. </a-form-item>
  41. </a-col>
  42. <a-col :md="6" :sm="24">
  43. <a-form-item label="客户名称">
  44. <a-input id="productPricingList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入客户名称"/>
  45. </a-form-item>
  46. </a-col>
  47. <a-col :md="6" :sm="24">
  48. <a-form-item label="产品品牌">
  49. <a-select
  50. placeholder="请选择"
  51. id="productPricingList-productBrandSn"
  52. allowClear
  53. v-model="queryParam.productBrandSn"
  54. :showSearch="true"
  55. option-filter-prop="children"
  56. :filter-option="filterOption">
  57. <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
  58. </a-select>
  59. </a-form-item>
  60. </a-col>
  61. <a-col :md="6" :sm="24">
  62. <a-form-item label="客户级别">
  63. <a-select
  64. placeholder="请选择"
  65. id="productPricingList-productBrandSn"
  66. allowClear
  67. v-model="queryParam.productBrandSn"
  68. :showSearch="true"
  69. option-filter-prop="children"
  70. :filter-option="filterOption">
  71. <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
  72. </a-select>
  73. </a-form-item>
  74. </a-col>
  75. <a-col :md="6" :sm="24">
  76. <a-form-item label="品牌类别">
  77. <v-select code="BRAND_TYPE" id="productBrandList-brandType" v-model="queryParam.brandType" allowClear placeholder="请选择品牌分类"></v-select>
  78. </a-form-item>
  79. </a-col>
  80. <a-col :md="6" :sm="24">
  81. <a-form-item label="二级分类">
  82. <a-select
  83. placeholder="请选择"
  84. id="productPricingList-productBrandSn"
  85. allowClear
  86. v-model="queryParam.productBrandSn"
  87. :showSearch="true"
  88. option-filter-prop="children"
  89. :filter-option="filterOption">
  90. <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
  91. </a-select>
  92. </a-form-item>
  93. </a-col>
  94. <a-col :md="6" :sm="24">
  95. <a-form-item label="三级分类">
  96. <a-select
  97. placeholder="请选择"
  98. id="productPricingList-productBrandSn"
  99. allowClear
  100. v-model="queryParam.productBrandSn"
  101. :showSearch="true"
  102. option-filter-prop="children"
  103. :filter-option="filterOption">
  104. <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
  105. </a-select>
  106. </a-form-item>
  107. </a-col>
  108. <a-col :md="6" :sm="24">
  109. <a-form-item label="盘点区间日期">
  110. <a-checkbox @change="onChange"></a-checkbox>
  111. </a-form-item>
  112. </a-col>
  113. </template>
  114. <a-col :md="6" :sm="24">
  115. <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productPricingList-refresh">查询</a-button>
  116. <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productPricingList-reset">重置</a-button>
  117. <a @click="advanced=!advanced" style="margin-left: 8px">
  118. {{ advanced ? '收起' : '展开' }}
  119. <a-icon :type="advanced ? 'up' : 'down'"/>
  120. </a>
  121. </a-col>
  122. </a-row>
  123. </a-form>
  124. </div>
  125. <!-- 列表 -->
  126. <s-table
  127. class="sTable"
  128. ref="table"
  129. size="small"
  130. :rowKey="(record) => record.id"
  131. :columns="columns"
  132. :data="loadData"
  133. :scroll="{ x: 3500 }"
  134. bordered>
  135. <template slot="footer" slot-scope="currentPageData">
  136. <a-row :gutter="15">
  137. <a-col :md="4" :sm="24">
  138. 数量:69
  139. </a-col>
  140. <a-col :md="4" :sm="24">
  141. 实售价:1130.36
  142. </a-col>
  143. <a-col :md="4" :sm="24">
  144. 开单价:1187.11
  145. </a-col>
  146. <a-col :md="4" :sm="24">
  147. 成本:1052.30
  148. </a-col>
  149. <a-col :md="4" :sm="24">
  150. 折后金额:1187.11
  151. </a-col>
  152. </a-row>
  153. </template>
  154. </s-table>
  155. </a-card>
  156. </template>
  157. <script>
  158. import { STable, VSelect } from '@/components'
  159. import reportData from '@/libs/reportData'
  160. import rangeDate from '@/views/common/rangeDate.vue'
  161. // import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
  162. // import { allocateTypeAllList } from '@/api/allocateType'
  163. export default {
  164. components: { STable, VSelect, rangeDate },
  165. data () {
  166. return {
  167. advanced: false, // 高级搜索 展开/关闭
  168. tableHeight: 0,
  169. queryParam: { // 查询条件
  170. beginDate: '',
  171. endDate: '',
  172. targetName: '', // 调往对象
  173. allocateTypeSn: undefined, // 调拨类型
  174. state: undefined, // 业务状态
  175. allocateNo: '' // 调拨单号
  176. },
  177. disabled: false, // 查询、重置按钮是否可操作
  178. exportLoading: false,
  179. checkVal: '',
  180. reportData: reportData.reportDataList,
  181. columns: [
  182. { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
  183. { title: '区域', dataIndex: 'data1', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
  184. { title: '销售单号', dataIndex: 'data2', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
  185. { title: '省份', dataIndex: 'data3', align: 'center', customRender: function (text) { return text || '--' } },
  186. { title: '客户名称', dataIndex: 'data4', width: 220, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  187. { title: '客户类型', dataIndex: 'data5', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  188. { title: '直接绑定客户类型', dataIndex: 'data6', width: 200, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  189. { title: '间接绑定客户类型', dataIndex: 'data7', width: 200, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  190. { title: '开单日期', dataIndex: 'data8', width: 160, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  191. { title: '销售日期', dataIndex: 'data9', width: 160, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  192. { title: '品牌', dataIndex: 'data10', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  193. { title: '二级类别', dataIndex: 'data11', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  194. { title: '产品名称', dataIndex: 'data12', width: 120, align: 'center', ellipsis: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  195. { title: '产品编码', dataIndex: 'data13', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  196. { title: '单位', dataIndex: 'data14', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  197. { title: '产品批次', dataIndex: 'data15', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  198. { title: '销售数量', dataIndex: 'data16', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  199. { title: '成本价', dataIndex: 'data17', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  200. { title: '实售价', dataIndex: 'data18', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  201. { title: '开单价', dataIndex: 'data19', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  202. { title: '市级价', dataIndex: 'data20', width: 140, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  203. { title: '直接差价', dataIndex: 'data21', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  204. { title: '间接差价', dataIndex: 'data22', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  205. { title: '操作员', dataIndex: 'data23', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
  206. ],
  207. // 加载数据方法 必须为 Promise 对象
  208. loadData: parameter => {
  209. this.disabled = true
  210. // return allocateBillList(Object.assign(parameter, this.queryParam)).then(res => {
  211. // const data = res.data
  212. // const no = (data.pageNo - 1) * data.pageSize
  213. // for (var i = 0; i < data.list.length; i++) {
  214. // data.list[i].no = no + i + 1
  215. // }
  216. // this.disabled = false
  217. // return data
  218. // })
  219. const _this = this
  220. return new Promise(function (resolve, reject) {
  221. const data = {
  222. pageNo: 1,
  223. pageSize: 10,
  224. list: reportData.salesDetailsList,
  225. count: 10
  226. }
  227. for (var i = 0; i < data.list.length; i++) {
  228. data.list[i].no = i + 1
  229. }
  230. _this.disabled = false
  231. resolve(data)
  232. })
  233. },
  234. allocateTypeList: [], // 调拨类型
  235. openModal: false // 新增编辑 弹框
  236. }
  237. },
  238. methods: {
  239. handleFooterShow (currentPageData) {
  240. console.log(currentPageData, '[=currentPageData]')
  241. },
  242. // 创建时间 change
  243. dateChange (date) {
  244. this.queryParam.beginDate = date[0]
  245. this.queryParam.endDate = date[1]
  246. },
  247. // 选择盘点日期
  248. onChange (e) {
  249. console.log(e)
  250. // this.checkVal
  251. },
  252. // 重置
  253. resetSearchForm () {
  254. this.$refs.rangeDate.resetDate()
  255. this.queryParam.beginDate = ''
  256. this.queryParam.endDate = ''
  257. this.queryParam.targetName = ''
  258. this.queryParam.allocateTypeSn = undefined
  259. this.queryParam.state = undefined
  260. this.queryParam.allocateNo = ''
  261. this.$refs.table.refresh(true)
  262. }
  263. },
  264. beforeRouteEnter (to, from, next) {
  265. next(vm => {})
  266. }
  267. }
  268. </script>