PurchaseApplyList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  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.creator"
  55. >
  56. <a-select-option v-for="(item, index) in userList" :key="index" :value="item.id">
  57. {{ item.userName }}
  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 placeholder="请选择单据状态" v-model="queryParam.status">
  65. <a-select-option value="0">未审核</a-select-option>
  66. <a-select-option value="9" v-if="!checkFlag">审核中</a-select-option>
  67. <a-select-option value="1">已审核</a-select-option>
  68. <a-select-option value="3">部分采购</a-select-option>
  69. <a-select-option value="2">完成采购</a-select-option>
  70. </a-select>
  71. </a-form-item>
  72. </a-col>
  73. <a-col :md="6" :sm="24">
  74. <a-form-item label="单据备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
  75. <a-input placeholder="请输入单据备注" v-model="queryParam.remark"></a-input>
  76. </a-form-item>
  77. </a-col>
  78. </a-row>
  79. </template>
  80. </a-form>
  81. </div>
  82. <!-- 操作按钮区域 -->
  83. <div class="table-operator" style="margin-top: 5px">
  84. <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
  85. <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
  86. <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
  87. >审核</a-button
  88. >
  89. <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
  90. >反审核</a-button
  91. >
  92. <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
  93. >导出</a-button
  94. >
  95. <a-popover trigger="click" placement="right">
  96. <template slot="content">
  97. <a-checkbox-group @change="onColChange" v-model="settingDataIndex" :defaultValue="settingDataIndex">
  98. <a-row style="width: 500px">
  99. <template v-for="(item, index) in defColumns">
  100. <template>
  101. <a-col :span="8">
  102. <a-checkbox :value="item.dataIndex">
  103. <j-ellipsis :value="item.title" :length="10"></j-ellipsis>
  104. </a-checkbox>
  105. </a-col>
  106. </template>
  107. </template>
  108. </a-row>
  109. <a-row style="padding-top: 10px">
  110. <a-col>
  111. 恢复默认列配置:<a-button @click="handleRestDefault" type="link" size="small">恢复默认</a-button>
  112. </a-col>
  113. </a-row>
  114. </a-checkbox-group>
  115. </template>
  116. <a-button icon="setting">列设置</a-button>
  117. </a-popover>
  118. <a-tooltip
  119. placement="left"
  120. title="请购单只涉及数量,请购单可以转采购订单,但需要先对请购单进行审核。
  121. 勾选单据之后可以进行批量操作(删除、审核、反审核)"
  122. slot="action"
  123. >
  124. <a-icon v-if="btnEnableList.indexOf(1) > -1" type="question-circle" style="font-size: 20px; float: right" />
  125. </a-tooltip>
  126. </div>
  127. <!-- table区域-begin -->
  128. <div>
  129. <a-table
  130. ref="table"
  131. size="middle"
  132. bordered
  133. rowKey="id"
  134. :columns="columns"
  135. :dataSource="dataSource"
  136. :components="handleDrag(columns)"
  137. :pagination="ipagination"
  138. :scroll="scroll"
  139. :loading="loading"
  140. :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
  141. @change="handleTableChange"
  142. >
  143. <span slot="action" slot-scope="text, record">
  144. <a @click="myHandleDetail(record, '请购单', prefixNo)">查看</a>
  145. <a-divider v-if="btnEnableList.indexOf(1) > -1" type="vertical" />
  146. <a v-if="btnEnableList.indexOf(1) > -1" @click="myHandleEdit(record)">编辑</a>
  147. <a-divider v-if="btnEnableList.indexOf(1) > -1" type="vertical" />
  148. <a v-if="btnEnableList.indexOf(1) > -1" @click="myHandleCopyAdd(record)">复制</a>
  149. <a-divider v-if="btnEnableList.indexOf(1) > -1" type="vertical" />
  150. <a-popconfirm
  151. v-if="btnEnableList.indexOf(1) > -1"
  152. title="确定删除吗?"
  153. @confirm="() => myHandleDelete(record)"
  154. >
  155. <a>删除</a>
  156. </a-popconfirm>
  157. </span>
  158. <template slot="customRenderStatus" slot-scope="status">
  159. <a-tag v-if="status == '0'" color="red">未审核</a-tag>
  160. <a-tag v-if="status == '1'" color="green">已审核</a-tag>
  161. <a-tag v-if="status == '2'" color="cyan">完成采购</a-tag>
  162. <a-tag v-if="status == '3'" color="blue">部分采购</a-tag>
  163. <a-tag v-if="status == '9'" color="orange">审核中</a-tag>
  164. </template>
  165. </a-table>
  166. </div>
  167. <!-- table区域-end -->
  168. <!-- 表单区域 -->
  169. <purchase-apply-modal ref="modalForm" @ok="modalFormOk" @close="modalFormClose"></purchase-apply-modal>
  170. <bill-detail ref="modalDetail" @ok="modalFormOk" @close="modalFormClose"></bill-detail>
  171. <bill-excel-iframe ref="billExcelIframe" @ok="modalFormOk" @close="modalFormClose"></bill-excel-iframe>
  172. </a-card>
  173. </a-col>
  174. </a-row>
  175. </template>
  176. <!-- by ji sheng hua-->
  177. <script>
  178. import PurchaseApplyModal from './modules/PurchaseApplyModal'
  179. import BillDetail from './dialog/BillDetail'
  180. import BillExcelIframe from '@/components/tools/BillExcelIframe'
  181. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  182. import { BillListMixin } from './mixins/BillListMixin'
  183. import JEllipsis from '@/components/jeecg/JEllipsis'
  184. import JDate from '@/components/jeecg/JDate'
  185. import Vue from 'vue'
  186. export default {
  187. name: 'PurchaseApplyList',
  188. mixins: [JeecgListMixin, BillListMixin],
  189. components: {
  190. PurchaseApplyModal,
  191. BillDetail,
  192. BillExcelIframe,
  193. JEllipsis,
  194. JDate,
  195. },
  196. data() {
  197. return {
  198. // 查询条件
  199. queryParam: {
  200. number: '',
  201. materialParam: '',
  202. type: '其它',
  203. subType: '请购单',
  204. creator: undefined,
  205. status: undefined,
  206. remark: '',
  207. },
  208. prefixNo: 'QGD',
  209. labelCol: {
  210. span: 5,
  211. },
  212. wrapperCol: {
  213. span: 18,
  214. offset: 1,
  215. },
  216. // 默认索引
  217. defDataIndex: ['action', 'number', 'materialsList', 'operTimeStr', 'userName', 'materialCount', 'status'],
  218. // 默认列
  219. defColumns: [
  220. {
  221. title: '操作',
  222. dataIndex: 'action',
  223. align: 'center',
  224. width: 180,
  225. scopedSlots: { customRender: 'action' },
  226. },
  227. { title: '单据编号', dataIndex: 'number', width: 180 },
  228. { title: '商品信息', dataIndex: 'materialsList', width: 320, ellipsis: true },
  229. { title: '单据日期', dataIndex: 'operTimeStr', width: 185 },
  230. { title: '操作员', dataIndex: 'userName', width: 120, ellipsis: true },
  231. { title: '数量', dataIndex: 'materialCount', width: 80 },
  232. { title: '备注', dataIndex: 'remark', width: 250 },
  233. {
  234. title: '状态',
  235. dataIndex: 'status',
  236. width: 100,
  237. align: 'center',
  238. scopedSlots: { customRender: 'customRenderStatus' },
  239. },
  240. ],
  241. url: {
  242. list: '/depotHead/list',
  243. delete: '/depotHead/delete',
  244. deleteBatch: '/depotHead/deleteBatch',
  245. batchSetStatusUrl: '/depotHead/batchSetStatus',
  246. },
  247. }
  248. },
  249. created() {
  250. this.initSystemConfig()
  251. this.initUser()
  252. },
  253. computed: {},
  254. methods: {},
  255. }
  256. </script>
  257. <style scoped>
  258. @import '~@assets/less/common.less';
  259. </style>