RetailOutList.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. <template>
  2. <a-row :gutter="24">
  3. <a-col :md="24">
  4. <a-card :style="cardStyle" :bordered="false">
  5. <!-- 查询区域 -->
  6. <div class="table-page-search-wrapper">
  7. <!-- 搜索区域 -->
  8. <a-form layout="inline" @keyup.enter.native="searchQuery">
  9. <a-row :gutter="24">
  10. <a-col :md="6" :sm="24">
  11. <a-form-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
  12. <a-input placeholder="请输入单据编号" v-model="queryParam.number"></a-input>
  13. </a-form-item>
  14. </a-col>
  15. <a-col :md="6" :sm="24">
  16. <a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
  17. <a-input
  18. placeholder="请输入条码、名称、助记码、规格、型号等信息"
  19. v-model="queryParam.materialParam"
  20. ></a-input>
  21. </a-form-item>
  22. </a-col>
  23. <a-col :md="6" :sm="24">
  24. <a-form-item label="单据日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
  25. <a-range-picker
  26. style="width: 100%"
  27. v-model="queryParam.createTimeRange"
  28. format="YYYY-MM-DD"
  29. :placeholder="['开始时间', '结束时间']"
  30. @change="onDateChange"
  31. @ok="onDateOk"
  32. />
  33. </a-form-item>
  34. </a-col>
  35. <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
  36. <a-col :md="6" :sm="24">
  37. <a-button type="primary" @click="searchQuery">查询</a-button>
  38. <a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
  39. <a @click="handleToggleSearch" style="margin-left: 8px">
  40. {{ toggleSearchStatus ? '收起' : '展开' }}
  41. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  42. </a>
  43. </a-col>
  44. </span>
  45. </a-row>
  46. <template v-if="toggleSearchStatus">
  47. <a-row :gutter="24">
  48. <a-col :md="6" :sm="24">
  49. <a-form-item label="会员卡号" :labelCol="labelCol" :wrapperCol="wrapperCol">
  50. <a-select
  51. placeholder="请选择会员卡号"
  52. showSearch
  53. optionFilterProp="children"
  54. v-model="queryParam.organId"
  55. >
  56. <a-select-option v-for="(item, index) in retailList" :key="index" :value="item.id">
  57. {{ item.supplier }}
  58. </a-select-option>
  59. </a-select>
  60. </a-form-item>
  61. </a-col>
  62. <a-col :md="6" :sm="24">
  63. <a-form-item label="仓库名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
  64. <a-select
  65. placeholder="请选择仓库"
  66. showSearch
  67. optionFilterProp="children"
  68. v-model="queryParam.depotId"
  69. >
  70. <a-select-option v-for="(depot, index) in depotList" :value="depot.id" :key="index">
  71. {{ depot.depotName }}
  72. </a-select-option>
  73. </a-select>
  74. </a-form-item>
  75. </a-col>
  76. <a-col :md="6" :sm="24">
  77. <a-form-item label="操作员" :labelCol="labelCol" :wrapperCol="wrapperCol">
  78. <a-select
  79. placeholder="请选择操作员"
  80. showSearch
  81. optionFilterProp="children"
  82. v-model="queryParam.creator"
  83. >
  84. <a-select-option v-for="(item, index) in userList" :key="index" :value="item.id">
  85. {{ item.userName }}
  86. </a-select-option>
  87. </a-select>
  88. </a-form-item>
  89. </a-col>
  90. <a-col :md="6" :sm="24">
  91. <a-form-item label="结算账户" :labelCol="labelCol" :wrapperCol="wrapperCol">
  92. <a-select
  93. placeholder="请选择结算账户"
  94. showSearch
  95. optionFilterProp="children"
  96. v-model="queryParam.accountId"
  97. >
  98. <a-select-option v-for="(item, index) in accountList" :key="index" :value="item.id">
  99. {{ item.name }}
  100. </a-select-option>
  101. </a-select>
  102. </a-form-item>
  103. </a-col>
  104. <a-col :md="6" :sm="24">
  105. <a-form-item label="单据状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
  106. <a-select placeholder="请选择单据状态" v-model="queryParam.status">
  107. <a-select-option value="0">未审核</a-select-option>
  108. <a-select-option value="9" v-if="!checkFlag">审核中</a-select-option>
  109. <a-select-option value="1">已审核</a-select-option>
  110. </a-select>
  111. </a-form-item>
  112. </a-col>
  113. <a-col :md="6" :sm="24">
  114. <a-form-item label="单据备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
  115. <a-input placeholder="请输入单据备注" v-model="queryParam.remark"></a-input>
  116. </a-form-item>
  117. </a-col>
  118. </a-row>
  119. </template>
  120. </a-form>
  121. </div>
  122. <!-- 操作按钮区域 -->
  123. <div class="table-operator" style="margin-top: 5px">
  124. <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
  125. <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
  126. <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
  127. >审核</a-button
  128. >
  129. <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
  130. >反审核</a-button
  131. >
  132. <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
  133. >导出</a-button
  134. >
  135. <a-popover trigger="click" placement="right">
  136. <template slot="content">
  137. <a-checkbox-group @change="onColChange" v-model="settingDataIndex" :defaultValue="settingDataIndex">
  138. <a-row style="width: 500px">
  139. <template v-for="(item, index) in defColumns">
  140. <template>
  141. <a-col :span="8">
  142. <a-checkbox :value="item.dataIndex">
  143. <j-ellipsis :value="item.title" :length="10"></j-ellipsis>
  144. </a-checkbox>
  145. </a-col>
  146. </template>
  147. </template>
  148. </a-row>
  149. <a-row style="padding-top: 10px">
  150. <a-col>
  151. 恢复默认列配置:<a-button @click="handleRestDefault" type="link" size="small">恢复默认</a-button>
  152. </a-col>
  153. </a-row>
  154. </a-checkbox-group>
  155. </template>
  156. <a-button icon="setting">列设置</a-button>
  157. </a-popover>
  158. <a-tooltip placement="left" title="用于非会员和会员的单据录入,主要是用于散户使用,不能欠款。" slot="action">
  159. <a-icon v-if="btnEnableList.indexOf(1) > -1" type="question-circle" style="font-size: 20px; float: right" />
  160. </a-tooltip>
  161. </div>
  162. <!-- table区域-begin -->
  163. <div>
  164. <a-table
  165. ref="table"
  166. size="middle"
  167. bordered
  168. rowKey="id"
  169. :columns="columns"
  170. :dataSource="dataSource"
  171. :components="handleDrag(columns)"
  172. :pagination="ipagination"
  173. :scroll="scroll"
  174. :loading="loading"
  175. :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
  176. @change="handleTableChange"
  177. >
  178. <span slot="action" slot-scope="text, record">
  179. <a @click="myHandleDetail(record, '零售出库', prefixNo)">查看</a>
  180. <a-divider v-if="btnEnableList.indexOf(1) > -1" type="vertical" />
  181. <a v-if="btnEnableList.indexOf(1) > -1" @click="myHandleEdit(record)">编辑</a>
  182. <a-divider v-if="btnEnableList.indexOf(1) > -1" type="vertical" />
  183. <a v-if="btnEnableList.indexOf(1) > -1" @click="myHandleCopyAdd(record)">复制</a>
  184. <a-divider v-if="btnEnableList.indexOf(1) > -1" type="vertical" />
  185. <a-popconfirm
  186. v-if="btnEnableList.indexOf(1) > -1"
  187. title="确定删除吗?"
  188. @confirm="() => myHandleDelete(record)"
  189. >
  190. <a>删除</a>
  191. </a-popconfirm>
  192. </span>
  193. <template slot="customRenderStatus" slot-scope="status">
  194. <a-tag v-if="status == '0'" color="red">未审核</a-tag>
  195. <a-tag v-if="status == '1'" color="green">已审核</a-tag>
  196. <a-tag v-if="status == '9'" color="orange">审核中</a-tag>
  197. </template>
  198. </a-table>
  199. </div>
  200. <!-- table区域-end -->
  201. <!-- 表单区域 -->
  202. <retail-out-modal ref="modalForm" @ok="modalFormOk" @close="modalFormClose"></retail-out-modal>
  203. <bill-detail ref="modalDetail" @ok="modalFormOk" @close="modalFormClose"></bill-detail>
  204. <bill-excel-iframe ref="billExcelIframe" @ok="modalFormOk" @close="modalFormClose"></bill-excel-iframe>
  205. </a-card>
  206. </a-col>
  207. </a-row>
  208. </template>
  209. <!-- create ji sheng hua-->
  210. <script>
  211. import RetailOutModal from './modules/RetailOutModal'
  212. import BillDetail from './dialog/BillDetail'
  213. import BillExcelIframe from '@/components/tools/BillExcelIframe'
  214. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  215. import { BillListMixin } from './mixins/BillListMixin'
  216. import JEllipsis from '@/components/jeecg/JEllipsis'
  217. import JDate from '@/components/jeecg/JDate'
  218. import Vue from 'vue'
  219. export default {
  220. name: 'RetailOutList',
  221. mixins: [JeecgListMixin, BillListMixin],
  222. components: {
  223. RetailOutModal,
  224. BillDetail,
  225. BillExcelIframe,
  226. JEllipsis,
  227. JDate,
  228. },
  229. data() {
  230. return {
  231. // 查询条件
  232. queryParam: {
  233. number: '',
  234. materialParam: '',
  235. type: '出库',
  236. subType: '零售',
  237. organId: undefined,
  238. depotId: undefined,
  239. creator: undefined,
  240. accountId: undefined,
  241. status: undefined,
  242. remark: '',
  243. },
  244. prefixNo: 'LSCK',
  245. labelCol: {
  246. span: 5,
  247. },
  248. wrapperCol: {
  249. span: 18,
  250. offset: 1,
  251. },
  252. // 默认索引
  253. defDataIndex: [
  254. 'action',
  255. 'organName',
  256. 'number',
  257. 'materialsList',
  258. 'operTimeStr',
  259. 'userName',
  260. 'materialCount',
  261. 'totalPrice',
  262. 'getAmount',
  263. 'backAmount',
  264. 'status',
  265. ],
  266. // 默认列
  267. defColumns: [
  268. {
  269. title: '操作',
  270. dataIndex: 'action',
  271. align: 'center',
  272. width: 180,
  273. scopedSlots: { customRender: 'action' },
  274. },
  275. { title: '会员', dataIndex: 'organName', width: 120, ellipsis: true },
  276. {
  277. title: '单据编号',
  278. dataIndex: 'number',
  279. width: 160,
  280. customRender: function (text, record, index) {
  281. text = record.hasBackFlag ? text + '[退]' : text
  282. return text
  283. },
  284. },
  285. { title: '商品信息', dataIndex: 'materialsList', width: 220, ellipsis: true },
  286. { title: '单据日期', dataIndex: 'operTimeStr', width: 145 },
  287. { title: '收款类型', dataIndex: 'payType', width: 80 },
  288. { title: '操作员', dataIndex: 'userName', width: 80, ellipsis: true },
  289. { title: '数量', dataIndex: 'materialCount', width: 60 },
  290. { title: '金额合计', dataIndex: 'totalPrice', width: 80 },
  291. {
  292. title: '收款金额',
  293. dataIndex: 'getAmount',
  294. width: 80,
  295. customRender: function (text, record, index) {
  296. if (record.backAmount) {
  297. return record.changeAmount + record.backAmount
  298. } else {
  299. return record.changeAmount
  300. }
  301. },
  302. },
  303. { title: '找零', dataIndex: 'backAmount', width: 50 },
  304. { title: '收款账户', dataIndex: 'accountName', width: 80 },
  305. { title: '备注', dataIndex: 'remark', width: 200 },
  306. {
  307. title: '状态',
  308. dataIndex: 'status',
  309. width: 80,
  310. align: 'center',
  311. scopedSlots: { customRender: 'customRenderStatus' },
  312. },
  313. ],
  314. url: {
  315. list: '/depotHead/list',
  316. delete: '/depotHead/delete',
  317. deleteBatch: '/depotHead/deleteBatch',
  318. batchSetStatusUrl: '/depotHead/batchSetStatus',
  319. },
  320. }
  321. },
  322. computed: {},
  323. created() {
  324. this.initSystemConfig()
  325. this.initRetail()
  326. this.getDepotData()
  327. this.initUser()
  328. this.initAccount()
  329. },
  330. methods: {},
  331. }
  332. </script>
  333. <style scoped>
  334. @import '~@assets/less/common.less';
  335. </style>