mrp.vue 21 KB

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