OtherOutList.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  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="请输入SKU、名称、助记码、规格、型号等信息"
  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 cusList" :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" :key="index" :value="depot.id">
  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-input placeholder="请输入关联单据" v-model="queryParam.linkNumber"></a-input>
  93. </a-form-item>
  94. </a-col>
  95. <a-col :md="6" :sm="24">
  96. <a-form-item label="单据状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
  97. <a-select placeholder="请选择单据状态" v-model="queryParam.status">
  98. <a-select-option value="0">未审核</a-select-option>
  99. <a-select-option value="9" v-if="!checkFlag">审核中</a-select-option>
  100. <a-select-option value="8">审核不通过</a-select-option>
  101. <a-select-option value="1">已审核</a-select-option>
  102. </a-select>
  103. </a-form-item>
  104. </a-col>
  105. <a-col :md="6" :sm="24">
  106. <a-form-item label="单据备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
  107. <a-input placeholder="请输入单据备注" v-model="queryParam.remark"></a-input>
  108. </a-form-item>
  109. </a-col>
  110. </a-row>
  111. </template>
  112. </a-form>
  113. </div>
  114. <!-- 操作按钮区域 -->
  115. <div class="table-operator" style="margin-top: 5px">
  116. <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
  117. <a-button v-if="inOutManageFlag && btnEnableList.indexOf(1) > -1" @click="handleWaitBill" icon="link"
  118. >待出库({{ waitTotal }})</a-button
  119. >
  120. <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
  121. <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
  122. >导出</a-button
  123. >
  124. <a-popover trigger="click" placement="right">
  125. <template slot="content">
  126. <a-checkbox-group @change="onColChange" v-model="settingDataIndex" :defaultValue="settingDataIndex">
  127. <a-row style="width: 500px">
  128. <template v-for="(item, index) in defColumns">
  129. <template>
  130. <a-col :span="8">
  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 placement="left" title="可以进行库存初始化,生产管理模块的领料出库。" slot="action">
  148. <a-icon v-if="btnEnableList.indexOf(1) > -1" type="question-circle" style="font-size: 20px; float: right" />
  149. </a-tooltip>
  150. </div>
  151. <!-- table区域-begin -->
  152. <div>
  153. <a-table
  154. ref="table"
  155. size="middle"
  156. bordered
  157. rowKey="id"
  158. :columns="columns"
  159. :dataSource="dataSource"
  160. :components="handleDrag(columns)"
  161. :pagination="ipagination"
  162. :scroll="scroll"
  163. :loading="loading"
  164. :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
  165. @change="handleTableChange"
  166. >
  167. <span slot="action" slot-scope="text, record">
  168. <a @click="myHandleDetail(record, '其它出库', prefixNo)">查看</a>
  169. <a-divider v-if="btnEnableList.indexOf(1) > -1" type="vertical" />
  170. <a v-if="btnEnableList.indexOf(1) > -1" @click="myHandleEdit(record)">编辑</a>
  171. <a-divider v-if="btnEnableList.indexOf(1) > -1" type="vertical" />
  172. <a v-if="btnEnableList.indexOf(1) > -1" @click="myHandleCopyAdd(record)">复制</a>
  173. <a-divider v-if="btnEnableList.indexOf(1) > -1" type="vertical" />
  174. <a-popconfirm
  175. v-if="btnEnableList.indexOf(1) > -1"
  176. title="确定删除吗?"
  177. @confirm="() => myHandleDelete(record)"
  178. >
  179. <a>删除</a>
  180. </a-popconfirm>
  181. </span>
  182. <template slot="customRenderStatus" slot-scope="status">
  183. <a-tag v-if="status == '0'" color="red">未审核</a-tag>
  184. <a-tag v-if="status == '1'" color="green">已审核</a-tag>
  185. <a-tag v-if="status == '8'" color="red">审核不通过</a-tag>
  186. <a-tag v-if="status == '9'" color="orange">审核中</a-tag>
  187. </template>
  188. </a-table>
  189. </div>
  190. <!-- table区域-end -->
  191. <!-- 表单区域 -->
  192. <other-out-modal ref="modalForm" @ok="modalFormOk" @close="modalFormClose"></other-out-modal>
  193. <bill-detail ref="modalDetail" @ok="modalFormOk" @close="modalFormClose"></bill-detail>
  194. <bill-excel-iframe ref="billExcelIframe" @ok="modalFormOk" @close="modalFormClose"></bill-excel-iframe>
  195. <batch-wait-bill-list ref="batchWaitBill" @ok="modalFormOk" @close="waitModalFormClose"></batch-wait-bill-list>
  196. </a-card>
  197. </a-col>
  198. </a-row>
  199. </template>
  200. <!--power by j i s h e n g h u a-->
  201. <script>
  202. import OtherOutModal from './modules/OtherOutModal'
  203. import BillDetail from './dialog/BillDetail'
  204. import BillExcelIframe from '@/components/tools/BillExcelIframe'
  205. import BatchWaitBillList from './dialog/BatchWaitBillList'
  206. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  207. import { BillListMixin } from './mixins/BillListMixin'
  208. import JEllipsis from '@/components/jeecg/JEllipsis'
  209. import JDate from '@/components/jeecg/JDate'
  210. import { deleteAction } from '@/api/manage'
  211. export default {
  212. name: 'OtherOutList',
  213. mixins: [JeecgListMixin, BillListMixin],
  214. components: {
  215. OtherOutModal,
  216. BillDetail,
  217. BillExcelIframe,
  218. BatchWaitBillList,
  219. JEllipsis,
  220. JDate,
  221. },
  222. data() {
  223. return {
  224. // 查询条件
  225. queryParam: {
  226. number: '',
  227. materialParam: '',
  228. type: '出库',
  229. subType: '其它',
  230. organId: undefined,
  231. depotId: undefined,
  232. creator: undefined,
  233. linkNumber: '',
  234. status: undefined,
  235. remark: '',
  236. },
  237. prefixNo: 'QTCK',
  238. //出入库管理开关,适合独立仓管场景
  239. inOutManageFlag: false,
  240. labelCol: {
  241. span: 5,
  242. },
  243. wrapperCol: {
  244. span: 18,
  245. offset: 1,
  246. },
  247. // 默认索引
  248. defDataIndex: [
  249. 'action',
  250. 'organName',
  251. 'number',
  252. 'materialsList',
  253. 'operTimeStr',
  254. 'userName',
  255. 'auditorName',
  256. 'materialCount',
  257. 'totalPrice',
  258. 'status',
  259. ],
  260. // 默认列
  261. defColumns: [
  262. {
  263. title: '操作',
  264. dataIndex: 'action',
  265. align: 'center',
  266. width: 160,
  267. scopedSlots: { customRender: 'action' },
  268. },
  269. { title: '客户', dataIndex: 'organName', width: 120, ellipsis: true },
  270. {
  271. title: '单据编号',
  272. dataIndex: 'number',
  273. width: 160,
  274. customRender: function (text, record, index) {
  275. text = record.linkNumber ? text + '[转]' : text
  276. return text
  277. },
  278. },
  279. { title: '关联单据', dataIndex: 'linkNumber', width: 140 },
  280. { title: '商品信息', dataIndex: 'materialsList', width: 220, ellipsis: true },
  281. { title: '单据日期', dataIndex: 'operTimeStr', width: 145 },
  282. { title: '操作员', dataIndex: 'userName', width: 80, ellipsis: true },
  283. { title: '复核人员', dataIndex: 'auditorName;', width: 80, ellipsis: true },
  284. { title: '数量', dataIndex: 'materialCount', width: 60 },
  285. { title: '金额合计', dataIndex: 'totalPrice', width: 80 },
  286. { title: '备注', dataIndex: 'remark', width: 200 },
  287. {
  288. title: '状态',
  289. dataIndex: 'status',
  290. width: 80,
  291. align: 'center',
  292. scopedSlots: { customRender: 'customRenderStatus' },
  293. },
  294. ],
  295. url: {
  296. list: '/depotHead/list',
  297. delete: '/depotHead/delete',
  298. deleteBatch: '/depotHead/deleteBatch',
  299. batchSetStatusUrl: '/depotHead/batchSetStatus',
  300. },
  301. }
  302. },
  303. computed: {},
  304. created() {
  305. this.initSystemConfig()
  306. this.initCustomer()
  307. this.getDepotData()
  308. this.initUser()
  309. this.initWaitBillCount('出库', '销售,采购退货', '1,3')
  310. },
  311. methods: {
  312. searchQuery() {
  313. this.loadData(1)
  314. if (this.inOutManageFlag) {
  315. this.initWaitBillCount('出库', '销售,采购退货', '1,3')
  316. }
  317. },
  318. searchReset() {
  319. this.queryParam = {
  320. type: this.queryParam.type,
  321. subType: this.queryParam.subType,
  322. }
  323. this.loadData(1)
  324. if (this.inOutManageFlag) {
  325. this.initWaitBillCount('出库', '销售,采购退货', '1,3')
  326. }
  327. },
  328. myHandleDelete(record) {
  329. let that = this
  330. if (record.status === '0') {
  331. deleteAction(that.url.delete, { id: record.id }).then((res) => {
  332. if (res.code === 200) {
  333. that.loadData(1)
  334. if (that.inOutManageFlag) {
  335. that.initWaitBillCount('出库', '销售,采购退货', '1,3')
  336. }
  337. } else {
  338. that.$message.warning(res.data.message)
  339. }
  340. })
  341. } else {
  342. this.$message.warning('抱歉,只有未审核的单据才能删除!')
  343. }
  344. },
  345. batchDel: function () {
  346. if (this.selectedRowKeys.length <= 0) {
  347. this.$message.warning('请选择一条记录!')
  348. } else {
  349. let ids = ''
  350. for (let i = 0; i < this.selectedRowKeys.length; i++) {
  351. ids += this.selectedRowKeys[i] + ','
  352. }
  353. let that = this
  354. this.$confirm({
  355. title: '确认删除',
  356. content: '是否删除选中数据?',
  357. onOk: function () {
  358. that.loading = true
  359. deleteAction(that.url.deleteBatch, { ids: ids })
  360. .then((res) => {
  361. if (res.code === 200) {
  362. that.loadData()
  363. that.onClearSelected()
  364. if (that.inOutManageFlag) {
  365. that.initWaitBillCount('出库', '销售,采购退货', '1,3')
  366. }
  367. } else {
  368. that.$message.warning(res.data.message)
  369. }
  370. })
  371. .finally(() => {
  372. that.loading = false
  373. })
  374. },
  375. })
  376. }
  377. },
  378. //待出库
  379. handleWaitBill() {
  380. this.$refs.batchWaitBill.show('出库', '销售,采购退货', '1,3')
  381. this.$refs.batchWaitBill.title = '批量选择销售出库或采购退货'
  382. },
  383. waitModalFormClose() {
  384. this.loadData()
  385. this.initWaitBillCount('出库', '销售,采购退货', '1,3')
  386. },
  387. },
  388. }
  389. </script>
  390. <style scoped>
  391. @import '~@assets/less/common.less';
  392. </style>