inancialReconciliation.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. <template>
  2. <!-- 【单证】 计划单统计表 -->
  3. <div id="costAllocationTotal">
  4. <!-- 查询区域 -->
  5. <a-card :bordered="false">
  6. <div class="table-page-search-wrapper">
  7. <a-form layout="inline" @keyup.enter.native="searchQuery">
  8. <a-row :gutter="24">
  9. <a-col :md="6" :sm="8">
  10. <a-form-item label="计划号">
  11. <a-input placeholder="请输入计划号" v-model="queryParam.planNo"></a-input>
  12. </a-form-item>
  13. </a-col>
  14. <a-col :md="6" :sm="8">
  15. <a-form-item label="对单人">
  16. <a-input placeholder="请输入" v-model="queryParam.planMan"></a-input>
  17. </a-form-item>
  18. </a-col>
  19. <a-col :md="6" :sm="8">
  20. <a-form-item label="日期" has-feedback>
  21. <a-range-picker
  22. :placeholder="['开始时间', '结束时间']"
  23. format="YYYY-MM-DD"
  24. style="width: 100%"
  25. v-model="dverifyDate"
  26. @change="changeCreateTime"
  27. />
  28. <!-- <a-input placeholder="请输入日期" v-model="queryParam.dverifyDate"></a-input> -->
  29. </a-form-item>
  30. </a-col>
  31. <template v-if="toggleSearchStatus">
  32. <!-- <a-col :md="6" :sm="8">
  33. <a-form-item label="是否存在对单人">
  34. <a-select v-model="queryParam.isPlanMan" placeholder="" >
  35. <a-select-option value="">请选择</a-select-option>
  36. <a-select-option value="是">是</a-select-option>
  37. <a-select-option value="否">否</a-select-option>
  38. </a-select>
  39. </a-form-item>
  40. </a-col> -->
  41. <a-col :md="6" :sm="8">
  42. <a-form-item label="面损表单据状态">
  43. <a-select v-model="queryParam.fstatus">
  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-option value="完成">完成</a-select-option>
  49. <a-select-option value="初审通过">初审通过</a-select-option>
  50. <a-select-option value="已指派">已指派</a-select-option>
  51. </a-select>
  52. <!-- <a-input placeholder="请输入面损表单据状态" v-model="queryParam.fstatus"></a-input> -->
  53. </a-form-item>
  54. </a-col>
  55. <a-col :md="6" :sm="8">
  56. <a-form-item label="分配表单据状态">
  57. <a-select v-model="queryParam.cstatus">
  58. <a-select-option value="">请选择</a-select-option>
  59. <a-select-option value="保存">保存</a-select-option>
  60. <a-select-option value="提交">提交</a-select-option>
  61. <a-select-option value="返单">返单</a-select-option>
  62. <a-select-option value="完成">完成</a-select-option>
  63. <a-select-option value="已指派">已指派</a-select-option>
  64. </a-select>
  65. <!-- <a-input placeholder="请输入分配表单据状态" v-model="queryParam.cstatus"></a-input> -->
  66. </a-form-item>
  67. </a-col>
  68. <a-col :md="6" :sm="8">
  69. <a-form-item label="部门">
  70. <a-input placeholder="请输入部门" v-model="queryParam.department"></a-input>
  71. </a-form-item>
  72. </a-col>
  73. <a-col :md="6" :sm="8">
  74. <a-form-item label="业务员">
  75. <a-input placeholder="请输入业务员" v-model="queryParam.salesman"></a-input>
  76. </a-form-item>
  77. </a-col>
  78. <a-col :md="6" :sm="8">
  79. <a-form-item label="计划师傅/制单人">
  80. <a-input placeholder="请输入" v-model="queryParam.maker"></a-input>
  81. </a-form-item>
  82. </a-col>
  83. <a-col :md="6" :sm="8">
  84. <a-form-item label="备注">
  85. <a-input placeholder="请输入" v-model="queryParam.remarks"></a-input>
  86. </a-form-item>
  87. </a-col>
  88. <a-col :md="6" :sm="8">
  89. <a-form-item label="审核结束日期">
  90. <a-range-picker
  91. :placeholder="['开始时间', '结束时间']"
  92. format="YYYY-MM-DD"
  93. v-model="ffirstApproveDate"
  94. @change="changeFfirstApproveDate"
  95. />
  96. <!-- <a-date-picker
  97. placeholder="请选择审核结束日期"
  98. style="width:100%;"
  99. :format="dateFormat"
  100. v-model="queryParam.ffirstApproveDate"
  101. @change="changeFfirstApproveDate"
  102. /> -->
  103. </a-form-item>
  104. </a-col>
  105. </template>
  106. <a-col :md="6" :sm="8">
  107. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  108. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  109. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  110. <a @click="handleToggleSearch" style="margin-left: 8px">
  111. {{ toggleSearchStatus ? '收起' : '展开' }}
  112. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  113. </a>
  114. </span>
  115. </a-col>
  116. </a-row>
  117. </a-form>
  118. </div>
  119. </a-card>
  120. <!-- table区域 -->
  121. <a-spin :spinning="loading">
  122. <a-card :bordered="false" style=" marginTop:10px;">
  123. <div class="table-operator">
  124. <a-button type="primary" @click="exportList('计划单统计表')" icon="plus">导出</a-button>
  125. </div>
  126. <a-table
  127. bordered
  128. rowKey="index"
  129. :columns="costAllocationColumns"
  130. :data-source="costAllocationData"
  131. :loading="loading"
  132. :customRow="rowClick"
  133. :pagination="pagination"
  134. :scroll="{ x: 1500,y:450 }"
  135. @change="handleTableChange"
  136. >
  137. <span slot="remarks" slot-scope="text, record">
  138. <a-input placeholder="请输入" v-model="record.remarks" v-if="record.enter=='1'"></a-input>
  139. <span v-if="record.enter=='0'">{{ record.remarks }}</span>
  140. </span>
  141. <span slot="planMan" slot-scope="text, record">
  142. <a-input placeholder="请输入" v-model="record.planMan" v-if="record.enter=='1'"></a-input>
  143. <span v-if="record.enter=='0'">{{ record.planMan }}</span>
  144. </span>
  145. <span slot="ffinalApproveDate" slot-scope="text, record">
  146. <a-date-picker style="width: 100%" v-model="record.ffinalApproveDate" :format="dateFormat" v-if="record.enter=='1'"> </a-date-picker>
  147. <!-- <a-input placeholder="请输入" v-model="record.ffinalApproveDate" v-if="record.enter=='1'"></a-input> -->
  148. <span v-if="record.enter=='0'">{{text}}</span>
  149. </span>
  150. <span slot="option" slot-scope="text, record">
  151. <a :disabled="record.enter=='0'" @click="sava(record)"> 保存</a>
  152. <a-divider type="vertical" />
  153. <a :disabled="record.enter=='0'" @click="cancel(record)"> 取消</a>
  154. </span>
  155. </a-table>
  156. </a-card>
  157. </a-spin>
  158. <!-- 详情 大抽屉 -->
  159. <!-- <costDetail-drawer ref="costDetailDrawer" :fatherList="getCostList" @ok="modalFormOk"></costDetail-drawer> -->
  160. </div>
  161. </template>
  162. <script>
  163. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  164. import JEllipsis from '@/components/jeecg/JEllipsis'
  165. import moment from 'moment'
  166. import { downFile } from '@/api/manage'
  167. import costDetailDrawer from '@views/cost-allocation-total/costDetailDrawer.vue'
  168. import { checkList,savaList,savaList1 } from '@api/document/inancialReconciliation.js'
  169. export default {
  170. name: 'inancialReconciliation', // 成本分配汇总 单证
  171. mixins: [JeecgListMixin],
  172. components: { JEllipsis, moment, costDetailDrawer },
  173. data() {
  174. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
  175. return {
  176. dverifyDate:[],
  177. ffirstApproveDate:[],
  178. costAllocationColumns: [
  179. { title: '计划单号', width: 120, dataIndex: 'planNo', fixed: 'left', className: 'replacecolor' },
  180. { title: '日期', width: 120, dataIndex: 'dverifyDate', className: 'replacecolor' },
  181. { title: '部门', width: 120, dataIndex: 'department', className: 'replacecolor',
  182. sorter:(a,b)=> {
  183. let temp1="";
  184. let temp2="";
  185. if(a.department!=null){
  186. temp1=a.department;
  187. }
  188. if(b.department!=null){
  189. temp2=b.department;
  190. }
  191. return temp1.localeCompare(temp2);
  192. },
  193. },
  194. { title: '业务员', width: 120, dataIndex: 'salesman', className: 'replacecolor' },
  195. { title: '计划师傅/制单人', width: 150, dataIndex: 'maker', className: 'replacecolor'},
  196. { title: '对单人(手输人)', width: 220, dataIndex: 'planMan', align: 'left', className: 'replacecolor',
  197. scopedSlots: { customRender: 'planMan' },
  198. sorter:(a,b)=> {
  199. let temp1="";
  200. let temp2="";
  201. if(a.planMan!=null){
  202. temp1=a.planMan;
  203. }
  204. if(b.planMan!=null){
  205. temp2=b.planMan;
  206. }
  207. return temp1.localeCompare(temp2);
  208. },
  209. },
  210. // {
  211. // title: '创建时间',
  212. // dataIndex: 'createTime',
  213. // align: 'center',
  214. // sorter: true,
  215. // customRender: text => {
  216. // return moment(text).format('YYYY-MM-DD')
  217. // }
  218. // },
  219. {
  220. title: '交单日期',
  221. width: 120,
  222. dataIndex: 'fsubmitDate',
  223. customRender: text => {
  224. if(text!==''&&text){
  225. return moment(text).format('YYYY-MM-DD')
  226. }else{
  227. return ''
  228. }
  229. },
  230. className: 'replacecolor',
  231. sorter: (a, b) => {
  232. return new Date(a.fsubmitDate) > new Date(b.fsubmitDate) ? 1 : -1;
  233. },
  234. },
  235. {
  236. title: '返单日期',
  237. width: 120,
  238. dataIndex: 'frejectDate',
  239. customRender: text => {
  240. if(text!==''&&text){
  241. return moment(text).format('YYYY-MM-DD')
  242. }else{
  243. return ''
  244. }
  245. },
  246. className: 'replacecolor',
  247. sorter: (a, b) => {
  248. return new Date(a.frejectDate) > new Date(b.frejectDate) ? 1 : -1;
  249. },
  250. },
  251. {
  252. title: '审核结束日期',
  253. width: 120,
  254. dataIndex: 'ffirstApproveDate',
  255. customRender: text => {
  256. if(text!=='' && text){
  257. return moment(text).format('YYYY-MM-DD')
  258. }else{
  259. return ''
  260. }
  261. },
  262. className: 'replacecolor',
  263. sorter: (a, b) => {
  264. return new Date(a.ffirstApproveDate) > new Date(b.ffirstApproveDate) ? 1 : -1;
  265. },
  266. },
  267. {
  268. title: '核纱结束日期',
  269. width: 150,
  270. dataIndex: 'ffinalApproveDate',
  271. scopedSlots: { customRender: 'ffinalApproveDate' },
  272. // customRender: text => {
  273. // if(text!==''&&text){
  274. // return moment(text).format('YYYY-MM-DD')
  275. // }else{
  276. // return ''
  277. // }
  278. // },
  279. className: 'replacecolor',
  280. sorter: (a, b) => {
  281. return new Date(a.ffinalApproveDate) > new Date(b.ffinalApproveDate) ? 1 : -1;
  282. },
  283. },
  284. { title: '面损表单据状态', width: 90, dataIndex: 'fstatus', className: 'replacecolor',
  285. sorter:(a,b)=> {
  286. let temp1="";
  287. let temp2="";
  288. if(a.fstatus!=null){
  289. temp1=a.fstatus;
  290. }
  291. if(b.fstatus!=null){
  292. temp2=b.fstatus;
  293. }
  294. return temp1.localeCompare(temp2);
  295. },
  296. },
  297. {
  298. title: '交单日期',
  299. width: 120,
  300. dataIndex: 'csubmitDate',
  301. customRender: text => {
  302. if(text!==''&&text){
  303. return moment(text).format('YYYY-MM-DD')
  304. }else{
  305. return ''
  306. }
  307. },
  308. className: 'replacecolor',
  309. sorter: (a, b) => {
  310. return new Date(a.csubmitDate) > new Date(b.csubmitDate) ? 1 : -1;
  311. },
  312. },
  313. {
  314. title: '返单日期',
  315. width: 120,
  316. dataIndex: 'crejectDate',
  317. customRender: text => {
  318. if(text!==''&&text){
  319. return moment(text).format('YYYY-MM-DD')
  320. }else{
  321. return ''
  322. }
  323. },
  324. className: 'replacecolor',
  325. sorter: (a, b) => {
  326. return new Date(a.crejectDate) > new Date(b.crejectDate) ? 1 : -1;
  327. },
  328. },
  329. {
  330. title: '结束日期',
  331. width: 120,
  332. dataIndex: 'cfirstApproveDate',
  333. customRender: text => {
  334. if(text!==''&&text){
  335. return moment(text).format('YYYY-MM-DD')
  336. }else{
  337. return ''
  338. }
  339. },
  340. className: 'replacecolor',
  341. sorter: (a, b) => {
  342. return new Date(a.cfirstApproveDate) > new Date(b.cfirstApproveDate) ? 1 : -1;
  343. },
  344. },
  345. { title: '分配表单据状态', width: 120, dataIndex: 'cstatus', className: 'replacecolor',
  346. sorter:(a,b)=> {
  347. let temp1="";
  348. let temp2="";
  349. if(a.cstatus!=null){
  350. temp1=a.cstatus;
  351. }
  352. if(b.cstatus!=null){
  353. temp2=b.cstatus;
  354. }
  355. return temp1.localeCompare(temp2);
  356. },
  357. },
  358. {
  359. title: '备注',
  360. width: 180,
  361. dataIndex: 'remarks',
  362. className: 'replacecolor',
  363. scopedSlots: { customRender: 'remarks' },
  364. },
  365. {
  366. title: '操作',
  367. width: 180,
  368. dataIndex: 'option',
  369. className: 'replacecolor',
  370. fixed: 'right',
  371. scopedSlots: { customRender: 'option' },
  372. },
  373. ],
  374. costAllocationData: [],
  375. // 查询条件
  376. queryParam: {
  377. // index: '',
  378. // planNum: '',
  379. // customerShortame: '',
  380. pageSize:50,
  381. pageNo: '' // 点击的页数
  382. },
  383. // 分页
  384. pagination: {
  385. pageSizeOptions: ["50","100","150", "500"],
  386. showSizeChanger: true,
  387. pageSize:50
  388. },
  389. dateFormat: 'YYYY-MM-DD',
  390. loading: false // 表格加载
  391. }
  392. },
  393. async created() {
  394. await this.defaultData()
  395. await this.getCostList()
  396. document.title = '计划单统计表'+ ' · ' + '森语'
  397. },
  398. methods: {
  399. // 分页查询
  400. getCostList() {
  401. this.$nextTick(() => {
  402. this.loading = true
  403. checkList(this.queryParam).then(res => {
  404. this.loading = false
  405. if (res.success) {
  406. this.costAllocationData = res.result.records
  407. this.costAllocationData.map(item=>{
  408. item.enter = '0'
  409. item.ffinalApproveDate = item.ffinalApproveDate!==''&&item.ffinalApproveDate ? moment(item.ffinalApproveDate).format('YYYY-MM-DD'):''
  410. })
  411. this.pagination = {
  412. total: res.result.total,
  413. current: res.result.current,
  414. pageSize: res.result.size,
  415. pageSizeOptions: ["50","100","150", "500"],
  416. showSizeChanger: true,
  417. }
  418. }else{
  419. this.$message.error(res.message);
  420. }
  421. })
  422. })
  423. },
  424. defaultData(){
  425. var tYear = new Date().getFullYear()
  426. var startTime = new Date(tYear, 0, 1)
  427. this.dverifyDate=[moment(startTime),moment(new Date())]
  428. this.queryParam.dverifyDateE=this.dverifyDate[1].format('YYYY-MM-DD')
  429. this.queryParam.dverifyDateB=this.dverifyDate[0].format('YYYY-MM-DD')
  430. },
  431. searchQuery() {
  432. this.getCostList()
  433. },
  434. changeCreateTime(){
  435. this.queryParam.dverifyDateE=( this.dverifyDate.length==2)?this.dverifyDate[1].format('YYYY-MM-DD'):''
  436. this.queryParam.dverifyDateB=( this.dverifyDate.length==2)?this.dverifyDate[0].format('YYYY-MM-DD'):''
  437. },
  438. searchReset() {
  439. this.queryParam.pageNo = ''
  440. this.queryParam = {}
  441. this.defaultData()
  442. this.getCostList()
  443. },
  444. changeFfirstApproveDate(){
  445. this.queryParam.ffirstApproveDateE=( this.ffirstApproveDate.length==2)?this.ffirstApproveDate[1].format('YYYY-MM-DD'):''
  446. this.queryParam.ffirstApproveDateB=( this.ffirstApproveDate.length==2)?this.ffirstApproveDate[0].format('YYYY-MM-DD'):''
  447. },
  448. rowClick(record) {
  449. return {
  450. on: {
  451. dblclick: () => {
  452. record.enter ='1'
  453. this.$forceUpdate()
  454. }
  455. }
  456. }
  457. },
  458. cancel(record){
  459. record.enter = '0'
  460. this.getCostList()
  461. this.$forceUpdate()
  462. },
  463. sava(record){
  464. this.loading = true
  465. var obj={
  466. planNum : record.planNo,
  467. planMan:record.planMan,
  468. remarks:record.remarks,
  469. id:record.id
  470. }
  471. var newObj ={
  472. ccode:record.planNo,
  473. final_date: record.ffinalApproveDate!==''&&record.ffinalApproveDate ? moment(record.ffinalApproveDate).format('YYYY-MM-DD HH:mm:ss'):''
  474. }
  475. savaList(obj).then(res => {
  476. this.loading = false
  477. if (res.success) {
  478. this.$message.success('保存成功')
  479. this.getCostList()
  480. }else{
  481. this.$message.error(res.message);
  482. }
  483. })
  484. savaList1(newObj).then(res => {
  485. this.loading = false
  486. if (res.success) {
  487. this.$message.success('保存成功')
  488. this.getCostList()
  489. }else{
  490. this.$message.error(res.message);
  491. }
  492. })
  493. },
  494. //导出
  495. exportList(fileName){
  496. var params = this.queryParam
  497. this.loading = true
  498. downFile('/orderData/syCostLossReview/planExportXls', params).then(data => {
  499. console.log('888')
  500. this.loading = false
  501. if (!data) {
  502. this.$message.warning('文件下载失败')
  503. return
  504. }
  505. if (typeof window.navigator.msSaveBlob !== 'undefined') {
  506. window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xlsx')
  507. } else {
  508. let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  509. let link = document.createElement('a')
  510. link.style.display = 'none'
  511. link.href = url
  512. link.setAttribute('download', fileName + '.xlsx')
  513. document.body.appendChild(link)
  514. link.click()
  515. document.body.removeChild(link) // 下载完成移除元素
  516. window.URL.revokeObjectURL(url) // 释放掉blob对象
  517. }
  518. })
  519. },
  520. handleTableChange(pagination, filters, sorter) {
  521. this.queryParam.pageNo = pagination.current
  522. this.queryParam.pageSize = pagination.pageSize
  523. this.getCostList()
  524. },
  525. },
  526. computed: {},
  527. mounted() {}
  528. }
  529. </script>
  530. <style lang="less" scoped>
  531. @import '~@assets/less/common.less';
  532. @import '~@assets/less/overwriter.less';
  533. /deep/ .ant-table-thead > tr > th {
  534. text-align: center;
  535. // font-weight: 700;
  536. }
  537. /deep/ .ant-table-tbody {
  538. text-align: center;
  539. }
  540. // /deep/ th.replacecolor {
  541. // background-color: #ccc;
  542. // }
  543. </style>