PurchaseOrderList.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  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 supList" :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.creator"
  69. >
  70. <a-select-option v-for="(item, index) in userList" :key="index" :value="item.id">
  71. {{ item.userName }}
  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-input placeholder="请输入关联请购单" v-model="queryParam.linkApply"></a-input>
  79. </a-form-item>
  80. </a-col>
  81. <a-col :md="6" :sm="24" v-if="purchaseBySaleFlag">
  82. <a-form-item label="关联订单" :labelCol="labelCol" :wrapperCol="wrapperCol">
  83. <a-input placeholder="请输入关联订单" v-model="queryParam.linkNumber"></a-input>
  84. </a-form-item>
  85. </a-col>
  86. <a-col :md="6" :sm="24">
  87. <a-form-item label="单据状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
  88. <a-select placeholder="请选择单据状态" v-model="queryParam.status">
  89. <a-select-option value="0">未审核</a-select-option>
  90. <a-select-option value="9" v-if="!checkFlag">审核中</a-select-option>
  91. <a-select-option value="1">已审核</a-select-option>
  92. <a-select-option value="3">部分采购</a-select-option>
  93. <a-select-option value="2">完成采购</a-select-option>
  94. </a-select>
  95. </a-form-item>
  96. </a-col>
  97. <a-col :md="6" :sm="24">
  98. <a-form-item label="单据备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
  99. <a-input placeholder="请输入单据备注" v-model="queryParam.remark"></a-input>
  100. </a-form-item>
  101. </a-col>
  102. </a-row>
  103. </template>
  104. </a-form>
  105. </div>
  106. <!-- 操作按钮区域 -->
  107. <div class="table-operator" style="margin-top: 5px">
  108. <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
  109. <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
  110. <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
  111. >审核</a-button
  112. >
  113. <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
  114. >反审核</a-button
  115. >
  116. <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
  117. >导出</a-button
  118. >
  119. <a-popover trigger="click" placement="right">
  120. <template slot="content">
  121. <a-checkbox-group @change="onColChange" v-model="settingDataIndex" :defaultValue="settingDataIndex">
  122. <a-row style="width: 500px">
  123. <template v-for="(item, index) in defColumns">
  124. <template>
  125. <a-col :span="8" v-if="purchaseBySaleFlag">
  126. <a-checkbox :value="item.dataIndex">
  127. <j-ellipsis :value="item.title" :length="10"></j-ellipsis>
  128. </a-checkbox>
  129. </a-col>
  130. <a-col :span="8" v-if="!purchaseBySaleFlag && item.dataIndex !== 'linkNumber'">
  131. <a-checkbox :value="item.dataIndex">
  132. <j-ellipsis :value="item.title" :length="10"></j-ellipsis>
  133. </a-checkbox>
  134. </a-col>
  135. </template>
  136. </template>
  137. </a-row>
  138. <a-row style="padding-top: 10px">
  139. <a-col>
  140. 恢复默认列配置:<a-button @click="handleRestDefault" type="link" size="small">恢复默认</a-button>
  141. </a-col>
  142. </a-row>
  143. </a-checkbox-group>
  144. </template>
  145. <a-button icon="setting">列设置</a-button>
  146. </a-popover>
  147. <a-tooltip
  148. placement="left"
  149. title="采购订单不涉及付款金额,采购订单可以转采购入库单,但需要先对采购订单进行审核。
  150. 勾选单据之后可以进行批量操作(删除、审核、反审核)"
  151. slot="action"
  152. >
  153. <a-icon v-if="btnEnableList.indexOf(1) > -1" type="question-circle" style="font-size: 20px; float: right" />
  154. </a-tooltip>
  155. </div>
  156. <!-- table区域-begin -->
  157. <div>
  158. <a-table
  159. ref="table"
  160. size="middle"
  161. bordered
  162. rowKey="id"
  163. :columns="columns"
  164. :dataSource="dataSource"
  165. :components="handleDrag(columns)"
  166. :pagination="ipagination"
  167. :scroll="scroll"
  168. :loading="loading"
  169. :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
  170. @change="handleTableChange"
  171. >
  172. <span slot="action" slot-scope="text, record">
  173. <a @click="myHandleDetail(record, '采购订单', prefixNo)">查看</a>
  174. <a-divider v-if="btnEnableList.indexOf(1) > -1" type="vertical" />
  175. <a v-if="btnEnableList.indexOf(1) > -1" @click="myHandleEdit(record)">编辑</a>
  176. <a-divider v-if="btnEnableList.indexOf(1) > -1" type="vertical" />
  177. <a v-if="btnEnableList.indexOf(1) > -1" @click="myHandleCopyAdd(record)">复制</a>
  178. <a-divider v-if="btnEnableList.indexOf(1) > -1" type="vertical" />
  179. <a-popconfirm
  180. v-if="btnEnableList.indexOf(1) > -1"
  181. title="确定删除吗?"
  182. @confirm="() => myHandleDelete(record)"
  183. >
  184. <a>删除</a>
  185. </a-popconfirm>
  186. </span>
  187. <template slot="customRenderStatus" slot-scope="status">
  188. <a-tag v-if="status == '0'" color="red">未审核</a-tag>
  189. <a-tag v-if="status == '1'" color="green">已审核</a-tag>
  190. <a-tag v-if="status == '2'" color="cyan">完成采购</a-tag>
  191. <a-tag v-if="status == '3'" color="blue">部分采购</a-tag>
  192. <a-tag v-if="status == '4'" color="purple">进行中</a-tag>
  193. <a-tag v-if="status == '9'" color="orange">审核中</a-tag>
  194. </template>
  195. </a-table>
  196. </div>
  197. <!-- table区域-end -->
  198. <!-- 表单区域 -->
  199. <purchase-order-modal ref="modalForm" @ok="modalFormOk" @close="modalFormClose"></purchase-order-modal>
  200. <bill-detail ref="modalDetail" @ok="modalFormOk" @close="modalFormClose"></bill-detail>
  201. <bill-excel-iframe ref="billExcelIframe" @ok="modalFormOk" @close="modalFormClose"></bill-excel-iframe>
  202. </a-card>
  203. </a-col>
  204. </a-row>
  205. </template>
  206. <!-- by ji sheng hua-->
  207. <script>
  208. import PurchaseOrderModal from './modules/PurchaseOrderModal'
  209. import BillDetail from './dialog/BillDetail'
  210. import BillExcelIframe from '@/components/tools/BillExcelIframe'
  211. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  212. import { BillListMixin } from './mixins/BillListMixin'
  213. import JEllipsis from '@/components/jeecg/JEllipsis'
  214. import JDate from '@/components/jeecg/JDate'
  215. import Vue from 'vue'
  216. export default {
  217. name: 'PurchaseOrderList',
  218. mixins: [JeecgListMixin, BillListMixin],
  219. components: {
  220. PurchaseOrderModal,
  221. BillDetail,
  222. BillExcelIframe,
  223. JEllipsis,
  224. JDate,
  225. },
  226. data() {
  227. return {
  228. // 查询条件
  229. queryParam: {
  230. number: '',
  231. materialParam: '',
  232. type: '其它',
  233. subType: '采购订单',
  234. organId: undefined,
  235. depotId: undefined,
  236. linkApply: '',
  237. linkNumber: '',
  238. creator: undefined,
  239. status: undefined,
  240. remark: '',
  241. },
  242. prefixNo: 'CGDD',
  243. labelCol: {
  244. span: 5,
  245. },
  246. wrapperCol: {
  247. span: 18,
  248. offset: 1,
  249. },
  250. // 默认索引
  251. defDataIndex: [
  252. 'action',
  253. 'organName',
  254. 'number',
  255. 'materialsList',
  256. 'operTimeStr',
  257. 'userName',
  258. 'materialCount',
  259. 'totalPrice',
  260. 'totalTaxLastMoney',
  261. 'changeAmount',
  262. 'status',
  263. ],
  264. // 默认列
  265. defColumns: [
  266. {
  267. title: '操作',
  268. dataIndex: 'action',
  269. align: 'center',
  270. width: 180,
  271. scopedSlots: { customRender: 'action' },
  272. },
  273. { title: '供应商', dataIndex: 'organName', width: 120, ellipsis: true },
  274. {
  275. title: '单据编号',
  276. dataIndex: 'number',
  277. width: 160,
  278. customRender: function (text, record, index) {
  279. text = record.linkApply ? text + '[请]' : text
  280. text = record.linkNumber ? text + '[转]' : text
  281. return text
  282. },
  283. },
  284. { title: '关联请购单', dataIndex: 'linkApply', width: 140 },
  285. { title: '关联订单', dataIndex: 'linkNumber', width: 140 },
  286. { title: '商品信息', dataIndex: 'materialsList', width: 220, ellipsis: true },
  287. { title: '单据日期', dataIndex: 'operTimeStr', width: 145 },
  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: 'totalTaxLastMoney',
  294. width: 80,
  295. customRender: function (text, record, index) {
  296. if (record.discountLastMoney) {
  297. return (record.discountMoney + record.discountLastMoney).toFixed(2)
  298. } else {
  299. return record.totalPrice
  300. }
  301. },
  302. },
  303. {
  304. title: '优惠率',
  305. dataIndex: 'discount',
  306. width: 60,
  307. customRender: function (text, record, index) {
  308. return text ? text + '%' : ''
  309. },
  310. },
  311. { title: '付款优惠', dataIndex: 'discountMoney', width: 80 },
  312. { title: '优惠后金额', dataIndex: 'discountLastMoney', width: 100 },
  313. { title: '结算账户', dataIndex: 'accountName', width: 80 },
  314. { title: '支付订金', dataIndex: 'changeAmount', width: 80 },
  315. { title: '备注', dataIndex: 'remark', width: 200 },
  316. {
  317. title: '状态',
  318. dataIndex: 'status',
  319. width: 80,
  320. align: 'center',
  321. scopedSlots: { customRender: 'customRenderStatus' },
  322. },
  323. ],
  324. url: {
  325. list: '/depotHead/list',
  326. delete: '/depotHead/delete',
  327. deleteBatch: '/depotHead/deleteBatch',
  328. batchSetStatusUrl: '/depotHead/batchSetStatus',
  329. },
  330. }
  331. },
  332. created() {
  333. this.initSystemConfig()
  334. this.initSupplier()
  335. this.initUser()
  336. },
  337. computed: {},
  338. methods: {},
  339. }
  340. </script>
  341. <style scoped>
  342. @import '~@assets/less/common.less';
  343. </style>