productionTotalOrderList.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659
  1. <template>
  2. <div>
  3. <a-card :bordered="false" class="top" style="margin-bottom:1%">
  4. <!-- 查询区域 -->
  5. <div class="table-page-search-wrapper">
  6. <a-form layout="inline" @keyup.enter.native="searchQuery">
  7. <a-row :gutter="24">
  8. <a-col :md="4" :sm="24">
  9. <a-form-item label="生产组织">
  10. <a-input placeholder="请输入" v-model="queryParam.productionOrg" ></a-input>
  11. </a-form-item>
  12. </a-col>
  13. <a-col :md="4" :sm="24">
  14. <a-form-item label="单据号">
  15. <a-input placeholder="请输入" v-model="queryParam.orderCode"></a-input>
  16. </a-form-item>
  17. </a-col>
  18. <a-col :md="4" :sm="24">
  19. <a-form-item label="单据日期">
  20. <a-range-picker v-model="orderDate" style="width: 100%;" @change="changeStartDate" />
  21. </a-form-item>
  22. </a-col>
  23. <a-col :md="4" :sm="24">
  24. <a-form-item label="单据状态">
  25. <a-select v-model="queryParam.state" style='width:100%' >
  26. <a-select-option value='开立'> 开立</a-select-option>
  27. <a-select-option value='审核'> 审核</a-select-option>
  28. <a-select-option value='已运算'> 已运算</a-select-option>
  29. <a-select-option value='关闭'> 关闭</a-select-option>
  30. </a-select>
  31. </a-form-item>
  32. </a-col>
  33. <template v-if="toggleSearchStatus">
  34. <a-col :md="4" :sm="24">
  35. <a-form-item label="业务员">
  36. <a-input placeholder="请输入" v-model="queryParam.salesperson"></a-input>
  37. </a-form-item>
  38. </a-col>
  39. <a-col :md="4" :sm="24">
  40. <a-form-item label="计划部门">
  41. <a-input placeholder="请输入" v-model="queryParam.planDept" ></a-input>
  42. </a-form-item>
  43. </a-col>
  44. <a-col :md="4" :sm="24">
  45. <a-form-item label="项目">
  46. <a-input placeholder="请输入" v-model="queryParam.project"></a-input>
  47. </a-form-item>
  48. </a-col>
  49. <a-col :md="4" :sm="24">
  50. <a-form-item label="备注">
  51. <a-input placeholder="请输入" v-model="queryParam.remarks"></a-input>
  52. </a-form-item>
  53. </a-col>
  54. <a-col :md="4" :sm="24">
  55. <a-form-item label="业务类型">
  56. <a-select v-model="queryParam.type" style='width:100%' >
  57. <a-select-option value='工装'> 工装</a-select-option>
  58. <a-select-option value='家装'> 家装</a-select-option>
  59. </a-select>
  60. </a-form-item>
  61. </a-col>
  62. <a-col :md="4" :sm="24">
  63. <a-form-item label="加工单号">
  64. <a-input placeholder="请输入" v-model="queryParam.workNo"></a-input>
  65. </a-form-item>
  66. </a-col>
  67. <a-col :md="4" :sm="24">
  68. <a-form-item label="制单人">
  69. <a-input placeholder="请输入" v-model="queryParam.createBy"></a-input>
  70. </a-form-item>
  71. </a-col>
  72. <a-col :md="4" :sm="24">
  73. <a-form-item label="审核人">
  74. <a-input placeholder="请输入" v-model="queryParam.reviewer"></a-input>
  75. </a-form-item>
  76. </a-col>
  77. <a-col :md="4" :sm="24">
  78. <a-form-item label="工单号">
  79. <a-input placeholder="请输入" v-model="queryParam.workNo"></a-input>
  80. </a-form-item>
  81. </a-col>
  82. <a-col :md="4" :sm="24">
  83. <a-form-item label="项目编码">
  84. <a-input placeholder="请输入" v-model="queryParam.projectCode"></a-input>
  85. </a-form-item>
  86. </a-col>
  87. <!-- <a-col :md="4" :sm="24">
  88. <a-form-item label="来源标识">
  89. <a-input placeholder="请输入" v-model="queryParam.sourceInfo"></a-input>
  90. </a-form-item>
  91. </a-col>
  92. <a-col :md="4" :sm="24">
  93. <a-form-item label="改单版本">
  94. <a-input placeholder="请输入" v-model="queryParam.version"></a-input>
  95. </a-form-item>
  96. </a-col>
  97. <a-col :md="4" :sm="24">
  98. <a-form-item label="制单时间">
  99. <a-input placeholder="请输入" v-model="queryParam.createTime"></a-input>
  100. </a-form-item>
  101. </a-col> -->
  102. </template>
  103. <a-col :md="4" :sm="24">
  104. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  105. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  106. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  107. <a @click="handleToggleSearch" style="margin-left: 8px">
  108. {{ toggleSearchStatus ? '收起' : '展开' }}
  109. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  110. </a>
  111. </span>
  112. </a-col>
  113. </a-row>
  114. </a-form>
  115. </div>
  116. </a-card>
  117. <a-card class="middle" style="margin-bottom:1%">
  118. <!-- 操作按钮区域 -->
  119. <div class="table-operator">
  120. <a-button type="danger" size="small" @click='addList'>新增</a-button>
  121. <a-button size="small" @click="editList">修改</a-button>
  122. <a-button size="small" @click='actionList'>订单操作</a-button>
  123. <a-button type="danger" size="small" @click="delecteList">删除</a-button>
  124. <a-button size="small" @click="detailList">详情</a-button>
  125. <a-button size="small" @click="examineApprove">审批</a-button>
  126. <a-button size="small" @click="abstainExamineApprove">弃审</a-button>
  127. <a-button size="small" @click="exportList('生产总订单列表')">导出</a-button>
  128. <a-upload name="file" :showUploadList="false" @change="handleUploadChange" :multiple="false" :headers="tokenHeader" :action="fileUpload">
  129. <a-button size="small">导入</a-button>
  130. </a-upload>
  131. <a-button type="danger" size="small" @click="entireClose">整单关闭</a-button>
  132. </div>
  133. <!-- table区域-begin -->
  134. <div>
  135. <a-table
  136. ref="table"
  137. size="middle"
  138. bordered
  139. rowKey="id"
  140. :columns="columns"
  141. :dataSource="dataSource"
  142. :pagination="ipagination"
  143. :scroll="{ x: 2000, y: 300 }"
  144. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  145. @change="handleTableChange"
  146. :customRow ="clickRow"
  147. >
  148. </a-table>
  149. </div>
  150. <!-- table区域-end -->
  151. </a-card>
  152. <productionTotalOrderAdd ref="productionTotalOrderAdd" @ok='searchQuery'></productionTotalOrderAdd>
  153. <productionTotalOrderDetail ref="productionTotalOrderDetail" @ok='searchQuery'></productionTotalOrderDetail>
  154. </div>
  155. </template>
  156. <script>
  157. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  158. import moment from 'dayjs'
  159. import { httpAction ,getAction,postAction,putAction,deleteAction,downFile} from '@/api/manage'
  160. import productionTotalOrderAdd from './modules/productionTotalOrderAdd'
  161. import productionTotalOrderDetail from './modules/productionTotalOrderDetail'
  162. import {queryDepartTreeList} from '@/api/api'
  163. import alertModal from '../../../plugins/modal'
  164. import { Message } from "element-ui";
  165. //---------workflow by fhf end -------------
  166. export default {
  167. name: "materialProcurementList",
  168. mixins: [JeecgListMixin],
  169. components: {
  170. productionTotalOrderAdd,
  171. productionTotalOrderDetail
  172. },
  173. data () {
  174. return {
  175. description: '资产调拨主表管理页面',
  176. queryParam:{},
  177. selectedRowKeys:[],
  178. selectedRows:[],
  179. documentData:[],
  180. orderDate:[],
  181. toggleSearchStatus:false,
  182. dataSource:[ ],
  183. ipagination:{
  184. current: 1,
  185. pageSize: 10,
  186. pageSizeOptions: ['10', '20', '30'],
  187. showTotal: (total, range) => {
  188. return range[0] + '-' + range[1] + ' 共' + total + '条'
  189. },
  190. showQuickJumper: true,
  191. showSizeChanger: true,
  192. total: 0
  193. },
  194. // 表头
  195. columns: [
  196. {
  197. title: '行号',
  198. dataIndex: '',
  199. key: 'rowIndex',
  200. width: 60,
  201. align: "center",
  202. customRender:function (t, r, index) {
  203. return parseInt(index)+1;
  204. }
  205. },
  206. {
  207. title: '生产组织',
  208. align:"center",
  209. dataIndex: 'orgName',
  210. ellipsis: true,
  211. },
  212. {
  213. title: '单据号',
  214. align:"center",
  215. dataIndex: 'orderCode',
  216. ellipsis: true,
  217. },
  218. {
  219. title: '单据日期',
  220. align:"center",
  221. dataIndex: 'orderDate',
  222. ellipsis: true,
  223. },
  224. {
  225. title: '单据状态',
  226. align:"center",
  227. dataIndex: 'state',
  228. ellipsis: true,
  229. },
  230. {
  231. title: '业务员',
  232. align:"center",
  233. dataIndex: 'salesperson',
  234. ellipsis: true,
  235. },
  236. {
  237. title: '计划部门',
  238. align:"center",
  239. dataIndex: 'planDept',
  240. ellipsis: true,
  241. },
  242. {
  243. title: '项目',
  244. align:"center",
  245. dataIndex: 'projectName',
  246. ellipsis: true,
  247. },
  248. {
  249. title: '项目编码',
  250. align:"center",
  251. dataIndex: 'projectCode',
  252. ellipsis: true,
  253. },
  254. {
  255. title: '工单号',
  256. align:"center",
  257. dataIndex: 'workNo',
  258. ellipsis: true,
  259. },
  260. {
  261. title: '业务类型',
  262. align:"center",
  263. dataIndex: 'type',
  264. ellipsis: true,
  265. },
  266. {
  267. title: '备注',
  268. align:"center",
  269. dataIndex: 'remarks',
  270. ellipsis: true,
  271. },
  272. {
  273. title: '审核人',
  274. align:"center",
  275. dataIndex: 'reviewer',
  276. ellipsis: true,
  277. },
  278. {
  279. title: '制单人',
  280. align:"center",
  281. dataIndex: 'createBy',
  282. ellipsis: true,
  283. },
  284. // {
  285. // title: '来源标识',
  286. // align:"center",
  287. // dataIndex: 'sourceInfo',
  288. // ellipsis: true,
  289. // },
  290. // {
  291. // title: '改单版本',
  292. // align:"center",
  293. // dataIndex: 'version',
  294. // ellipsis: true,
  295. // },
  296. {
  297. title: '制单时间',
  298. align:"center",
  299. dataIndex: 'createTime',
  300. ellipsis: true,
  301. },
  302. ],
  303. fileUpload: window._CONFIG['domianURL'] + "/productionOrder/madeProductionOrders/importExcel",
  304. // ---------workflow by fhf start -------------
  305. serviceName: 'assetAllocationService',
  306. // ---------workflow by fhf end -------------
  307. }
  308. },
  309. computed: {},
  310. created () {
  311. this.getTableList()
  312. },
  313. methods: {
  314. //获取数据
  315. getTableList(){
  316. alertModal.loading("执行中,请稍后!")
  317. this.selectedRowKeys = []
  318. this.selectedRows = []
  319. getAction('/productionOrder/madeProductionOrders/list',this.queryParam).then(res=>{
  320. alertModal.closeLoading();
  321. if(res.success){
  322. this.dataSource =res.result.records
  323. this.selectedRowKeys = []
  324. this.selectedRows = []
  325. this.ipagination = {
  326. total: res.result.total,
  327. current: res.result.current,
  328. pageSize: res.result.size
  329. }
  330. }else{
  331. this.$message.error(res.message);
  332. }
  333. })
  334. },
  335. //查询
  336. searchQuery(){
  337. this.selectedRow=[]
  338. this.selectedRowKeys
  339. this.queryParam.pageNo=1
  340. this.getTableList()
  341. },
  342. handleUploadChange({ file, fileList }){
  343. if (file.status === 'done'&&file.response.success) {
  344. this.$message.success(file.response.message)
  345. this.getTableList()
  346. }else if(file.status === 'done'&&!file.response.success){
  347. this.$message.error(file.response.message)
  348. }
  349. },
  350. //单据日期
  351. changeStartDate(data){
  352. this.orderDate = data
  353. this.queryParam.orderDate_begin = data.length==2?moment(data[0]).format('YYYY-MM-DD'):''
  354. this.queryParam.orderDate_end = data.length==2?moment(data[1]).format('YYYY-MM-DD'):''
  355. },
  356. onSearch(){
  357. },
  358. //重置
  359. searchReset(){
  360. this.queryParam={}
  361. this.orderDate = []
  362. this.getTableList()
  363. },
  364. //新增
  365. addList(){
  366. this.$refs.productionTotalOrderAdd.visible=true
  367. this.$refs.productionTotalOrderAdd.defaultMethod='add'
  368. this.$refs.productionTotalOrderAdd.form.state='开立'
  369. this.$refs.productionTotalOrderAdd.title = '新增'
  370. },
  371. editList(){
  372. if(this.selectedRowKeys.length==0){
  373. this.$message.warning('请选择数据!')
  374. }else if(this.selectedRowKeys.length>1){
  375. this.$message.warning('请选择一条数据!')
  376. }else if(this.selectedRows[0].state=='审核'){
  377. this.$message.warning('此状态数据不可修改!')
  378. }else{
  379. this.$refs.productionTotalOrderAdd.visible=true
  380. this.$refs.productionTotalOrderAdd.defaultMethod='edit'
  381. this.$refs.productionTotalOrderAdd.getMainData(this.selectedRowKeys[0])
  382. this.$refs.productionTotalOrderAdd.title = '编辑'
  383. }
  384. },
  385. actionList(){
  386. if(this.selectedRowKeys.length!==1){
  387. this.$message.warning('请勾选一条数据!')
  388. }else if(this.selectedRows[0].state=='开立'||this.selectedRows[0].state=='关闭'){
  389. this.$message.warning('该状态订单不可操作')
  390. }else{
  391. this.$refs.productionTotalOrderAdd.visible=true
  392. this.$refs.productionTotalOrderAdd.defaultMethod='edit'
  393. this.$refs.productionTotalOrderAdd.getMainData(this.selectedRowKeys[0])
  394. this.$refs.productionTotalOrderAdd.title = '订单操作'
  395. }
  396. },
  397. detailList(){
  398. if(this.selectedRowKeys.length==0){
  399. this.$message.warning('请选择数据!')
  400. }else if(this.selectedRowKeys.length>1){
  401. this.$message.warning('请选择一条数据!')
  402. }else{
  403. this.$refs.productionTotalOrderDetail.visible=true
  404. this.$refs.productionTotalOrderDetail.getMainData(this.selectedRowKeys[0])
  405. }
  406. },
  407. //弃审
  408. abstainExamineApprove(){
  409. if(this.selectedRowKeys.length==0){
  410. this.$message.warning('请选择数据!')
  411. }else{
  412. this.$confirm({
  413. title: '确认弃审',
  414. content: '是否弃审选中数据?',
  415. onOk: ()=> {
  416. var ids = this.selectedRowKeys.toString()
  417. alertModal.loading("执行中,请稍后!")
  418. getAction('/productionOrder/madeProductionOrders/unReviewerByIds',{ids:ids}).then(res=>{
  419. alertModal.closeLoading();
  420. if(res.success){
  421. this.getTableList()
  422. var arr = res.message.split(";");
  423. var str = arr.join(' <br/> ');
  424. Message({
  425. dangerouslyUseHTMLString: true,
  426. message: str,
  427. type: ''
  428. });
  429. // this.$message.success(res.message)
  430. }else{
  431. this.$message.error(res.message)
  432. }
  433. })
  434. }
  435. })
  436. }
  437. },
  438. //整单关闭
  439. entireClose(){
  440. if(this.selectedRowKeys.length==0){
  441. this.$message.warning('请选择要关闭的数据!')
  442. }else{
  443. this.$confirm({
  444. title: '是否确认关闭?',
  445. content: '注:关闭后此单据将无法进行任何操作',
  446. onOk: ()=> {
  447. var ids = this.selectedRowKeys.toString()
  448. alertModal.loading("执行中,请稍后!")
  449. getAction('/productionOrder/madeProductionOrders/unReviewerByIds',{ids:ids}).then(res=>{
  450. alertModal.closeLoading();
  451. if(res.success){
  452. this.getTableList()
  453. this.$message.success(res.message)
  454. }else{
  455. this.$message.error(res.message)
  456. }
  457. })
  458. }
  459. })
  460. }
  461. },
  462. //删除
  463. delecteList(){
  464. if(this.selectedRowKeys.length==0){
  465. this.$message.warning('请勾选数据!')
  466. }else if(this.selectedRowKeys.length==1){
  467. this.$confirm({
  468. title: '确认删除',
  469. content: '是否删除选中数据?',
  470. onOk: ()=>{
  471. alertModal.loading("执行中,请稍后!")
  472. deleteAction('/productionOrder/madeProductionOrders/delete', {id: this.selectedRowKeys[0]}).then((res) => {
  473. alertModal.closeLoading();
  474. if (res.success) {
  475. this.selectedRowKeys =[]
  476. this.selectedRows =[]
  477. this.$message.success('删除成功!');
  478. this.getTableList()
  479. } else {
  480. this.$message.error(res.message);
  481. }
  482. });
  483. }
  484. })
  485. }else{
  486. this.$confirm({
  487. title: '确认删除',
  488. content: '是否删除选中数据?',
  489. onOk: ()=> {
  490. var ids = this.selectedRowKeys.toString()
  491. alertModal.loading("执行中,请稍后!")
  492. deleteAction('/productionOrder/madeProductionOrders/deleteBatch', {ids: ids}).then((res) => {
  493. alertModal.closeLoading();
  494. if (res.success) {
  495. this.selectedRowKeys =[]
  496. this.selectedRows =[]
  497. this.$message.success('删除成功!');
  498. this.getTableList()
  499. } else {
  500. this.$message.error(res.message);
  501. }
  502. });
  503. }
  504. })
  505. }
  506. },
  507. //导出
  508. exportList(fileName){
  509. this.$confirm({
  510. title: '确认导出',
  511. content: '是否导出数据?',
  512. onOk: ()=> {
  513. alertModal.loading("执行中,请稍后!")
  514. downFile('/productionOrder/madeProductionOrders/exportXls', this.queryParam).then(data => {
  515. alertModal.closeLoading();
  516. if (!data) {
  517. this.$message.warning('文件下载失败')
  518. return
  519. }
  520. if (typeof window.navigator.msSaveBlob !== 'undefined') {
  521. window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xlsx')
  522. } else {
  523. let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  524. let link = document.createElement('a')
  525. link.style.display = 'none'
  526. link.href = url
  527. link.setAttribute('download', fileName + '.xlsx')
  528. document.body.appendChild(link)
  529. link.click()
  530. document.body.removeChild(link) // 下载完成移除元素
  531. window.URL.revokeObjectURL(url) // 释放掉blob对象
  532. }
  533. })
  534. }
  535. })
  536. },
  537. examineApprove(){
  538. if(this.selectedRowKeys.length==0){
  539. this.$message.warning('请选择数据!')
  540. }else{
  541. this.$confirm({
  542. title: '确认审批',
  543. content: '是否审批选中数据?',
  544. onOk: ()=> {
  545. var ids = this.selectedRowKeys.toString()
  546. alertModal.loading("执行中,请稍后!")
  547. getAction('productionOrder/madeProductionOrders/reviewerByIds',{ids:ids}).then(res=>{
  548. alertModal.closeLoading();
  549. if(res.success){
  550. this.getTableList()
  551. var arr = res.message.split(";");
  552. var str = arr.join(' <br/> ');
  553. Message({
  554. dangerouslyUseHTMLString: true,
  555. message: str,
  556. type: ''
  557. });
  558. // this.$message.success(res.message)
  559. }else{
  560. this.$message.error(res.message)
  561. }
  562. })
  563. }
  564. })
  565. }
  566. },
  567. //勾选
  568. onSelectChange(selectedRowKeys, selectionRows) {
  569. this.selectedRowKeys = selectedRowKeys;
  570. this.selectedRows = selectionRows;
  571. },
  572. handleTableChange(pagination, filters, sorter) {
  573. this.queryParam.pageNo = pagination.current
  574. this.queryParam.pageSize = pagination.pageSize
  575. this.getTableList()
  576. },
  577. //双击
  578. clickRow(record, index){
  579. return {
  580. on: {
  581. dblclick: () => {
  582. this.$refs.productionTotalOrderDetail.visible=true
  583. this.$refs.productionTotalOrderDetail.getMainData(record.id)
  584. },
  585. }
  586. }
  587. },
  588. }
  589. }
  590. </script>
  591. <style scoped lang="less">
  592. /* @import '~@assets/less/common.less' */
  593. /deep/.ant-input{
  594. height:29px;
  595. }
  596. /deep/.ant-select-selection--single {
  597. height: 29px;
  598. }
  599. /deep/.ant-select{
  600. font-size: 12px;
  601. }
  602. /deep/.ant-form label{
  603. font-size: 12px;
  604. }
  605. /deep/.table-page-search-wrapper .ant-form-inline .ant-form-item{
  606. margin-bottom:9px
  607. }
  608. /deep/.top>.ant-card-body{
  609. padding-bottom:0px;
  610. padding-top: 12px;
  611. }
  612. /deep/.ant-btn{
  613. height:28px
  614. }
  615. /deep/.ant-table-thead > tr > th{
  616. padding: 6px 8px !important;
  617. }
  618. /deep/ .ant-table-tbody > tr > td{
  619. padding: 6px 8px !important;
  620. }
  621. /deep/ .ant-table{
  622. font-size:12px
  623. }
  624. /deep/.ant-table-fixed-header .ant-table-scroll .ant-table-header{
  625. width: calc(100% + 9px);//减去滚动条的宽度
  626. }
  627. /deep/.middle>.ant-card-body{
  628. padding-bottom:2px;
  629. padding-top:14px;
  630. }
  631. /deep/.ant-select-sm .ant-select-selection__rendered{
  632. line-height: 27px;
  633. }
  634. </style>