SaleBackList.vue 15 KB

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