list.vue 14 KB

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