inancialReconciliation.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  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 mode="multiple" @change="handleChange">
  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 mode="multiple" @change="handleChangeCstatus">
  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="readyEndDate" slot-scope="text, record">
  151. <a-date-picker style="width: 100%" v-model="record.readyEndDate" :format="dateFormat" v-if="record.enter=='1'" @change="changeReadyEndData()"> </a-date-picker>
  152. <span v-if="record.enter=='0'">{{text}}</span>
  153. </span>
  154. <span slot="option" slot-scope="text, record">
  155. <a :disabled="record.enter=='0'" @click="sava(record)"> 保存</a>
  156. <a-divider type="vertical" />
  157. <a :disabled="record.enter=='0'" @click="cancel(record)"> 取消</a>
  158. </span>
  159. </a-table>
  160. </a-card>
  161. </a-spin>
  162. <!-- 详情 大抽屉 -->
  163. <!-- <costDetail-drawer ref="costDetailDrawer" :fatherList="getCostList" @ok="modalFormOk"></costDetail-drawer> -->
  164. </div>
  165. </template>
  166. <script>
  167. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  168. import JEllipsis from '@/components/jeecg/JEllipsis'
  169. import moment from 'moment'
  170. import { downFile } from '@/api/manage'
  171. import costDetailDrawer from '@views/cost-allocation-total/costDetailDrawer.vue'
  172. import { checkList,savaList,savaList1 } from '@api/document/inancialReconciliation.js'
  173. export default {
  174. name: 'inancialReconciliation', // 成本分配汇总 单证
  175. mixins: [JeecgListMixin],
  176. components: { JEllipsis, moment, costDetailDrawer },
  177. data() {
  178. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
  179. return {
  180. dverifyDate:[],
  181. ffirstApproveDate:[],
  182. costAllocationColumns: [
  183. { title: '计划单号', width: 120, dataIndex: 'planNo', fixed: 'left', className: 'replacecolor' },
  184. { title: '日期', width: 120, dataIndex: 'dverifyDate', className: 'replacecolor' },
  185. { title: '部门', width: 120, dataIndex: 'department', className: 'replacecolor',
  186. sorter:(a,b)=> {
  187. let temp1="";
  188. let temp2="";
  189. if(a.department!=null){
  190. temp1=a.department;
  191. }
  192. if(b.department!=null){
  193. temp2=b.department;
  194. }
  195. return temp1.localeCompare(temp2);
  196. },
  197. },
  198. { title: '业务员', width: 120, dataIndex: 'salesman', className: 'replacecolor' },
  199. { title: '计划师傅/制单人', width: 150, dataIndex: 'maker', className: 'replacecolor'},
  200. { title: '对单人(手输人)', width: 220, dataIndex: 'planMan', align: 'left', className: 'replacecolor',
  201. scopedSlots: { customRender: 'planMan' },
  202. sorter:(a,b)=> {
  203. let temp1="";
  204. let temp2="";
  205. if(a.planMan!=null){
  206. temp1=a.planMan;
  207. }
  208. if(b.planMan!=null){
  209. temp2=b.planMan;
  210. }
  211. return temp1.localeCompare(temp2);
  212. },
  213. },
  214. // {
  215. // title: '创建时间',
  216. // dataIndex: 'createTime',
  217. // align: 'center',
  218. // sorter: true,
  219. // customRender: text => {
  220. // return moment(text).format('YYYY-MM-DD')
  221. // }
  222. // },
  223. {
  224. title: '交单日期',
  225. width: 120,
  226. dataIndex: 'fsubmitDate',
  227. customRender: text => {
  228. if(text!==''&&text){
  229. return moment(text).format('YYYY-MM-DD')
  230. }else{
  231. return ''
  232. }
  233. },
  234. className: 'replacecolor',
  235. sorter: (a, b) => {
  236. return new Date(a.fsubmitDate) > new Date(b.fsubmitDate) ? 1 : -1;
  237. },
  238. },
  239. {
  240. title: '返单日期',
  241. width: 120,
  242. dataIndex: 'frejectDate',
  243. customRender: text => {
  244. if(text!==''&&text){
  245. return moment(text).format('YYYY-MM-DD')
  246. }else{
  247. return ''
  248. }
  249. },
  250. className: 'replacecolor',
  251. sorter: (a, b) => {
  252. return new Date(a.frejectDate) > new Date(b.frejectDate) ? 1 : -1;
  253. },
  254. },
  255. {
  256. title: '审核结束日期',
  257. width: 120,
  258. dataIndex: 'ffirstApproveDate',
  259. customRender: text => {
  260. if(text!=='' && text){
  261. return moment(text).format('YYYY-MM-DD')
  262. }else{
  263. return ''
  264. }
  265. },
  266. className: 'replacecolor',
  267. sorter: (a, b) => {
  268. return new Date(a.ffirstApproveDate) > new Date(b.ffirstApproveDate) ? 1 : -1;
  269. },
  270. },
  271. {
  272. title: '核纱结束日期',
  273. width: 150,
  274. dataIndex: 'ffinalApproveDate',
  275. scopedSlots: { customRender: 'ffinalApproveDate' },
  276. // customRender: text => {
  277. // if(text!==''&&text){
  278. // return moment(text).format('YYYY-MM-DD')
  279. // }else{
  280. // return ''
  281. // }
  282. // },
  283. className: 'replacecolor',
  284. sorter: (a, b) => {
  285. return new Date(a.ffinalApproveDate) > new Date(b.ffinalApproveDate) ? 1 : -1;
  286. },
  287. },
  288. { title: '面损表单据状态', width: 120, dataIndex: 'fstatus', className: 'replacecolor',
  289. sorter:(a,b)=> {
  290. let temp1="";
  291. let temp2="";
  292. if(a.fstatus!=null){
  293. temp1=a.fstatus;
  294. }
  295. if(b.fstatus!=null){
  296. temp2=b.fstatus;
  297. }
  298. return temp1.localeCompare(temp2);
  299. },
  300. },
  301. {
  302. title: '交单日期',
  303. width: 120,
  304. dataIndex: 'csubmitDate',
  305. customRender: text => {
  306. if(text!==''&&text){
  307. return moment(text).format('YYYY-MM-DD')
  308. }else{
  309. return ''
  310. }
  311. },
  312. className: 'replacecolor',
  313. sorter: (a, b) => {
  314. return new Date(a.csubmitDate) > new Date(b.csubmitDate) ? 1 : -1;
  315. },
  316. },
  317. {
  318. title: '刷成衣结束日期',
  319. width: 170,
  320. dataIndex: 'readyEndDate',
  321. scopedSlots: { customRender: 'readyEndDate' },
  322. className: 'replacecolor',
  323. sorter: (a, b) => {
  324. return new Date(a.readyEndDate) > new Date(b.readyEndDate) ? 1 : -1;
  325. },
  326. },
  327. {
  328. title: '返单日期',
  329. width: 120,
  330. dataIndex: 'crejectDate',
  331. customRender: text => {
  332. if(text!==''&&text){
  333. return moment(text).format('YYYY-MM-DD')
  334. }else{
  335. return ''
  336. }
  337. },
  338. className: 'replacecolor',
  339. sorter: (a, b) => {
  340. return new Date(a.crejectDate) > new Date(b.crejectDate) ? 1 : -1;
  341. },
  342. },
  343. {
  344. title: '结束日期',
  345. width: 120,
  346. dataIndex: 'cfirstApproveDate',
  347. customRender: text => {
  348. if(text!==''&&text){
  349. return moment(text).format('YYYY-MM-DD')
  350. }else{
  351. return ''
  352. }
  353. },
  354. className: 'replacecolor',
  355. sorter: (a, b) => {
  356. return new Date(a.cfirstApproveDate) > new Date(b.cfirstApproveDate) ? 1 : -1;
  357. },
  358. },
  359. { title: '分配表单据状态', width: 120, dataIndex: 'cstatus', className: 'replacecolor',
  360. sorter:(a,b)=> {
  361. let temp1="";
  362. let temp2="";
  363. if(a.cstatus!=null){
  364. temp1=a.cstatus;
  365. }
  366. if(b.cstatus!=null){
  367. temp2=b.cstatus;
  368. }
  369. return temp1.localeCompare(temp2);
  370. },
  371. },
  372. {
  373. title: '备注',
  374. width: 180,
  375. dataIndex: 'remarks',
  376. className: 'replacecolor',
  377. scopedSlots: { customRender: 'remarks' },
  378. },
  379. {
  380. title: '操作',
  381. width: 180,
  382. dataIndex: 'option',
  383. className: 'replacecolor',
  384. fixed: 'right',
  385. scopedSlots: { customRender: 'option' },
  386. },
  387. ],
  388. costAllocationData: [],
  389. // 查询条件
  390. queryParam: {
  391. // index: '',
  392. // planNum: '',
  393. // customerShortame: '',
  394. pageSize:50,
  395. pageNo: '' // 点击的页数
  396. },
  397. // 分页
  398. pagination: {
  399. pageSizeOptions: ["50","100","150", "500"],
  400. showSizeChanger: true,
  401. pageSize:50
  402. },
  403. dateFormat: 'YYYY-MM-DD',
  404. loading: false // 表格加载
  405. }
  406. },
  407. async created() {
  408. await this.defaultData()
  409. await this.getCostList()
  410. document.title = '计划单统计表'+ ' · ' + '马菲羊'
  411. },
  412. methods: {
  413. // 分页查询
  414. getCostList() {
  415. this.$nextTick(() => {
  416. this.loading = true
  417. checkList(this.queryParam).then(res => {
  418. this.loading = false
  419. if (res.success) {
  420. this.costAllocationData = res.result.records
  421. this.costAllocationData.map(item=>{
  422. item.enter = '0'
  423. item.ffinalApproveDate = item.ffinalApproveDate!==''&&item.ffinalApproveDate ? moment(item.ffinalApproveDate).format('YYYY-MM-DD'):''
  424. item.readyEndDate = item.readyEndDate!==''&&item.readyEndDate ? moment(item.readyEndDate).format('YYYY-MM-DD'):''
  425. })
  426. this.pagination = {
  427. total: res.result.total,
  428. current: res.result.current,
  429. pageSize: res.result.size,
  430. pageSizeOptions: ["50","100","150", "500"],
  431. showSizeChanger: true,
  432. }
  433. }else{
  434. this.$message.error(res.message);
  435. }
  436. })
  437. })
  438. },
  439. defaultData(){
  440. var tYear = new Date().getFullYear()
  441. var startTime = new Date(tYear, 0, 1)
  442. this.dverifyDate=[moment(startTime),moment(new Date())]
  443. this.queryParam.dverifyDateE=this.dverifyDate[1].format('YYYY-MM-DD')
  444. this.queryParam.dverifyDateB=this.dverifyDate[0].format('YYYY-MM-DD')
  445. },
  446. searchQuery() {
  447. this.getCostList()
  448. },
  449. changeReadyEndData(){
  450. this.$forceUpdate()
  451. },
  452. handleChange(value){
  453. this.queryParam.fstatus = value.toString()
  454. },
  455. handleChangeCstatus(value){
  456. this.queryParam.cstatus = value.toString()
  457. },
  458. changeCreateTime(){
  459. this.queryParam.dverifyDateE=( this.dverifyDate.length==2)?this.dverifyDate[1].format('YYYY-MM-DD'):''
  460. this.queryParam.dverifyDateB=( this.dverifyDate.length==2)?this.dverifyDate[0].format('YYYY-MM-DD'):''
  461. },
  462. searchReset() {
  463. this.queryParam.pageNo = ''
  464. this.queryParam = {}
  465. this.defaultData()
  466. this.getCostList()
  467. },
  468. changeFfirstApproveDate(){
  469. this.queryParam.ffirstApproveDateE=( this.ffirstApproveDate.length==2)?this.ffirstApproveDate[1].format('YYYY-MM-DD'):''
  470. this.queryParam.ffirstApproveDateB=( this.ffirstApproveDate.length==2)?this.ffirstApproveDate[0].format('YYYY-MM-DD'):''
  471. },
  472. rowClick(record) {
  473. return {
  474. on: {
  475. dblclick: () => {
  476. record.enter ='1'
  477. this.$forceUpdate()
  478. }
  479. }
  480. }
  481. },
  482. cancel(record){
  483. record.enter = '0'
  484. this.getCostList()
  485. this.$forceUpdate()
  486. },
  487. sava(record){
  488. this.loading = true
  489. var obj={
  490. planNum : record.planNo,
  491. planMan:record.planMan,
  492. remarks:record.remarks,
  493. id:record.id,
  494. readyEndDate: record.readyEndDate!==''&&record.readyEndDate ? moment(record.readyEndDate).format('YYYY-MM-DD HH:mm:ss'):''
  495. }
  496. var newObj ={
  497. ccode:record.planNo,
  498. final_date: record.ffinalApproveDate!==''&&record.ffinalApproveDate ? moment(record.ffinalApproveDate).format('YYYY-MM-DD HH:mm:ss'):''
  499. }
  500. savaList(obj).then(res => {
  501. this.loading = false
  502. if (res.success) {
  503. this.$message.success('保存成功')
  504. this.getCostList()
  505. }else{
  506. this.$message.error(res.message);
  507. }
  508. })
  509. savaList1(newObj).then(res => {
  510. this.loading = false
  511. if (res.success) {
  512. this.$message.success('保存成功')
  513. this.getCostList()
  514. }else{
  515. this.$message.error(res.message);
  516. }
  517. })
  518. },
  519. //导出
  520. exportList(fileName){
  521. var params = this.queryParam
  522. this.loading = true
  523. downFile('/orderData/syCostLossReview/planExportXls', params).then(data => {
  524. console.log('888')
  525. this.loading = false
  526. if (!data) {
  527. this.$message.warning('文件下载失败')
  528. return
  529. }
  530. if (typeof window.navigator.msSaveBlob !== 'undefined') {
  531. window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xlsx')
  532. } else {
  533. let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  534. let link = document.createElement('a')
  535. link.style.display = 'none'
  536. link.href = url
  537. link.setAttribute('download', fileName + '.xlsx')
  538. document.body.appendChild(link)
  539. link.click()
  540. document.body.removeChild(link) // 下载完成移除元素
  541. window.URL.revokeObjectURL(url) // 释放掉blob对象
  542. }
  543. })
  544. },
  545. handleTableChange(pagination, filters, sorter) {
  546. this.queryParam.pageNo = pagination.current
  547. this.queryParam.pageSize = pagination.pageSize
  548. this.getCostList()
  549. },
  550. },
  551. computed: {},
  552. mounted() {}
  553. }
  554. </script>
  555. <style lang="less" scoped>
  556. @import '~@assets/less/common.less';
  557. @import '~@assets/less/overwriter.less';
  558. /deep/ .ant-table-thead > tr > th {
  559. text-align: center;
  560. // font-weight: 700;
  561. }
  562. /deep/ .ant-table-tbody {
  563. text-align: center;
  564. }
  565. // /deep/ th.replacecolor {
  566. // background-color: #ccc;
  567. // }
  568. </style>