productionTotalOrderList.vue 21 KB

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