commerce_list.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  1. <template>
  2. <template-page
  3. ref="pageRef"
  4. :getList="getList"
  5. :operation="operation()"
  6. :optionsEvensGroup="optionsEvensGroup"
  7. :exportList="exportList"
  8. :columnParsing="columnParsing"
  9. :tableAttributes="tableAttributes"
  10. :tableEvents="tableEvents"
  11. >
  12. <!-- 密码记录 -->
  13. <el-dialog
  14. title="密码记录"
  15. :visible.sync="isShowDialog"
  16. :show-close="false"
  17. width="50%"
  18. :close-on-click-modal="false"
  19. >
  20. <div class="table" style="margin: 10px 0 20px">
  21. <el-table
  22. v-loading="dialogTable_listLoading"
  23. :data="dialogTable_dataList"
  24. element-loading-text="Loading"
  25. tooltip-effect="dark"
  26. style="width: 100%"
  27. max-height="270"
  28. >
  29. <el-table-column align="center" label="序号" type="index" width="50" />
  30. <el-table-column align="center" prop="printPassword" label="密码" />
  31. <el-table-column align="center" prop="createTime" label="打印时间" />
  32. </el-table>
  33. </div>
  34. <div class="pagination clearfix">
  35. <div class="fr">
  36. <el-pagination
  37. :current-page="dialogTable_currentPage"
  38. :page-size="dialogTable_pageSize"
  39. background
  40. layout="prev, pager, next"
  41. :total="dialogTable_listTotal"
  42. @current-change="dialogTableCurrentChange"
  43. />
  44. </div>
  45. </div>
  46. <div slot="footer" class="dialog-footer">
  47. <el-button @click="isShowDialog = false">关 闭</el-button>
  48. </div>
  49. </el-dialog>
  50. <Popu v-if="isShowDetail">
  51. <CommerceDetail v-if="isShowDetail" ref="refDetail" :list-item="queryItem" @backListFormDetail="backList" />
  52. </Popu>
  53. </template-page>
  54. </template>
  55. <script>
  56. import {
  57. getEnginList,
  58. getPassword,
  59. getPasswordRecord,
  60. invoiceListProjectV2,
  61. invoiceListProjectV2Export
  62. } from '@/api/supply/deliver'
  63. import { getCategoryList, getSalesmanList } from '@/api/common'
  64. import CommerceDetail from '@/views/supply/deliver/components/commerce_detail'
  65. import TemplatePage from '@/components/template/template-page-1.vue'
  66. import Popu from '@/components/template/popu.vue'
  67. let that
  68. export default {
  69. components: {
  70. CommerceDetail,
  71. TemplatePage,
  72. Popu
  73. },
  74. filters: {
  75. statusFilter(val) {
  76. const obj = that.statusList.find(o => o.value == val)
  77. return obj ? obj.label : ''
  78. },
  79. orderTypeFilter(val) {
  80. const obj = that.orderTypeList.find(o => o.value == val)
  81. return obj ? obj.label : ''
  82. }
  83. },
  84. data() {
  85. return {
  86. // 事件组合
  87. optionsEvensGroup: [],
  88. // 表格属性
  89. tableAttributes: {
  90. // 启用勾选列
  91. selectColumn: false
  92. },
  93. // 表格事件
  94. tableEvents: {
  95. 'selection-change': this.selectionChange
  96. },
  97. recordSelected: [],
  98. currentPage: 1, // 当前页码
  99. pageSize: 10, // 每页数量
  100. listTotal: 0, // 列表总数
  101. dataList: null, // 列表数据
  102. listLoading: false, // 列表加载loading
  103. screenForm: {
  104. // 筛选表单数据
  105. orderNum: '',
  106. orderNo: '',
  107. contractNo: '',
  108. warehouse: '',
  109. jxsName: '',
  110. chName: '',
  111. model: '',
  112. date: [],
  113. jxsNum: '',
  114. status: '',
  115. salesMan: '',
  116. refRegionWork: '',
  117. createBy: ''
  118. },
  119. categoryList: [],
  120. salesmanList: [],
  121. isCollapse: true,
  122. isShowDialog: false, // 密码记录 - 弹窗
  123. dialogTable_dataList: null, // 密码记录 - 列表数据
  124. dialogTable_listLoading: true, // 密码记录 - 列表加载loading
  125. dialogTable_currentPage: 1, // 密码记录 - 当前页码
  126. dialogTable_pageSize: 10, // 密码记录 - 每页数量
  127. dialogTable_listTotal: 0, // 密码记录 - 列表总数
  128. statusList: [
  129. { label: '已保存', value: 'SAVE' },
  130. { label: '待审核', value: 'WAIT' },
  131. { label: '审核通过', value: 'OK' },
  132. // // { label: '审核驳回', value: 'FAIL' },,
  133. { label: '已关闭', value: 'CLOSE' }
  134. ],
  135. orderTypeList: [
  136. { label: '发货申请单', value: 1 },
  137. { label: '退货申请单', value: 2 },
  138. { label: '直调发货单', value: 3 }
  139. ],
  140. queryItem: {}
  141. }
  142. },
  143. computed: {
  144. exParams() {
  145. return {
  146. id: this.screenForm.orderNum,
  147. enginOrderNo: this.screenForm.orderNo,
  148. refEnginRecordNo: this.screenForm.contractNo,
  149. customerNumber: this.screenForm.jxsNum,
  150. customerName: this.screenForm.jxsName,
  151. materialName: this.screenForm.chName,
  152. specification: this.screenForm.model,
  153. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  154. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  155. categoryName: this.screenForm.type,
  156. refRegionWork: this.screenForm.refRegionWork,
  157. serviceId: this.screenForm.salesMan,
  158. createBy: this.screenForm.createBy,
  159. orderType: 3 // 2家用工程 3商用工程
  160. }
  161. },
  162. isShowDetail() {
  163. return this.queryItem.hasOwnProperty('id')
  164. },
  165. isDealer() {
  166. return JSON.parse(localStorage.getItem('supply_user')).isCustomer
  167. }
  168. },
  169. beforeCreate() {
  170. that = this
  171. },
  172. created() {
  173. // this.getSalesmanList()
  174. // this.getCategoryList()
  175. // this.getList()
  176. },
  177. methods: {
  178. // 列表请求函数
  179. getList(...p) {
  180. let params = {
  181. ...p[0],
  182. orderType: 3
  183. }
  184. return invoiceListProjectV2(params)
  185. },
  186. // 列表导出函数
  187. exportList: invoiceListProjectV2Export,
  188. // 表格列解析渲染数据更改
  189. columnParsing(item, defaultData) {
  190. return defaultData
  191. },
  192. // 监听勾选变化
  193. selectionChange(data) {
  194. this.recordSelected = data
  195. },
  196. operation() {
  197. return (h, { row, index, column }) => {
  198. return (
  199. <div class="operation-btns">
  200. <div class="operation-btns">
  201. <el-button
  202. size="mini"
  203. type="text"
  204. onClick={async () => {
  205. this.toDetail(row)
  206. }}
  207. >
  208. 详情
  209. </el-button>
  210. <el-button
  211. size="mini"
  212. type="text"
  213. onClick={async () => {
  214. this.getPassword(row.id)
  215. }}
  216. >
  217. 获取密码
  218. </el-button>
  219. <el-button
  220. size="mini"
  221. type="text"
  222. onClick={async () => {
  223. this.openShareDetail(row.id)
  224. }}
  225. >
  226. 密码记录
  227. </el-button>
  228. </div>
  229. </div>
  230. )
  231. }
  232. },
  233. // 获取业务员列表
  234. getSalesmanList() {
  235. getSalesmanList({
  236. pageNum: 1,
  237. pageSize: -1,
  238. isCustomer: 0,
  239. status: true
  240. }).then(res => {
  241. this.salesmanList = res.data.records
  242. })
  243. },
  244. // 获取存货类别列表
  245. getCategoryList() {
  246. getCategoryList({
  247. pageNum: 1,
  248. pageSize: -1
  249. }).then(res => {
  250. this.categoryList = res.data.records
  251. })
  252. },
  253. // 查询列表
  254. // getList() {
  255. // this.listLoading = true
  256. // const params = {
  257. // pageNum: this.currentPage,
  258. // pageSize: this.pageSize,
  259. // id: this.screenForm.orderNum,
  260. // enginOrderNo: this.screenForm.orderNo,
  261. // refEnginRecordNo: this.screenForm.contractNo,
  262. // customerNumber: this.screenForm.jxsNum,
  263. // customerName: this.screenForm.jxsName,
  264. // materialName: this.screenForm.chName,
  265. // specification: this.screenForm.model,
  266. // refRegionWork: this.screenForm.refRegionWork,
  267. // startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  268. // endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  269. // categoryName: this.screenForm.type,
  270. // serviceId: this.screenForm.salesMan,
  271. // createBy: this.screenForm.createBy,
  272. // orderType: 3 // 2家用工程 3商用工程
  273. // }
  274. // getEnginList(params).then(res => {
  275. // res.data.records.forEach(item => {
  276. // item.notOutNumber = item.salesStatus ? 0 : item.refundableQty
  277. // item.sums1 = ['refundableQty', 'notOutNumber']
  278. // item.sums2 = []
  279. // })
  280. // this.dataList = res.data.records
  281. // this.listTotal = res.data.total
  282. // this.listLoading = false
  283. // })
  284. // },
  285. // 提交筛选表单
  286. submitScreenForm() {
  287. this.currentPage = 1
  288. this.getList()
  289. },
  290. // 重置筛选表单
  291. resetScreenForm() {
  292. this.$refs.screenForm.resetFields()
  293. this.currentPage = 1
  294. this.getList()
  295. },
  296. // 更改每页数量
  297. handleSizeChange(val) {
  298. this.pageSize = val
  299. this.currentPage = 1
  300. this.getList()
  301. },
  302. // 更改当前页
  303. handleCurrentChange(val) {
  304. this.currentPage = val
  305. this.getList()
  306. },
  307. // 进入详情
  308. toDetail(item) {
  309. this.queryItem = item
  310. this.$nextTick(() => {
  311. this.$refs.refDetail.initPrint()
  312. })
  313. },
  314. backList() {
  315. this.queryItem = {}
  316. },
  317. // 获取密码
  318. getPassword(id) {
  319. getPassword({ id }).then(res => {
  320. this.$alert(res.data, '新密码', {
  321. confirmButtonText: '确定',
  322. callback: action => {}
  323. })
  324. })
  325. },
  326. // 密码记录 - 获取列表
  327. getPasswordRecord(id) {
  328. getPasswordRecord({
  329. pageNum: this.dialogTable_currentPage,
  330. pageSize: this.dialogTable_pageSize,
  331. id
  332. }).then(res => {
  333. this.dialogTable_dataList = res.data.records
  334. this.dialogTable_listTotal = res.data.total
  335. this.dialogTable_listLoading = false
  336. })
  337. },
  338. // 密码记录 - 打开弹窗
  339. openShareDetail(id) {
  340. this.isShowDialog = true
  341. this.dialogTable_currentPage = 1
  342. this.getPasswordRecord(id)
  343. },
  344. // 密码记录 - 更改列表当前页
  345. dialogTableCurrentChange(val) {
  346. this.dialogTable_currentPage = val
  347. this.getPasswordRecord()
  348. }
  349. }
  350. }
  351. </script>
  352. <style lang="scss" scoped></style>