list.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  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.preparedBy"></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.planNum"></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-input placeholder="请输入" v-model="queryParam.poStyleNum"></a-input>
  22. </a-form-item>
  23. </a-col>
  24. <template v-if="toggleSearchStatus">
  25. <a-col :md="6" :sm="8">
  26. <a-form-item label="外销员">
  27. <a-input placeholder="请输入" v-model="queryParam.exportSales"></a-input>
  28. </a-form-item>
  29. </a-col>
  30. <a-col :md="6" :sm="8">
  31. <a-form-item label="成衣合同号">
  32. <a-input placeholder="请输入" v-model="queryParam.garmentContractno"></a-input>
  33. </a-form-item>
  34. </a-col>
  35. <a-col :md="6" :sm="8">
  36. <a-form-item label="部门">
  37. <a-input placeholder="请输入" v-model="queryParam.department"></a-input>
  38. </a-form-item>
  39. </a-col>
  40. <a-col :md="6" :sm="8">
  41. <a-form-item label="客户简称">
  42. <a-input placeholder="请输入" v-model="queryParam.customerShortame"></a-input>
  43. </a-form-item>
  44. </a-col>
  45. <a-col :md="6" :sm="8">
  46. <a-form-item label="加工单位">
  47. <a-input placeholder="请输入" v-model="queryParam.processUnit"></a-input>
  48. </a-form-item>
  49. </a-col>
  50. <!-- <a-col :md="6" :sm="8">
  51. <a-form-item label="出运日期">
  52. <a-date-picker style="width: 100%" v-model="outdata" @change="changeData" :format="dateFormat"> </a-date-picker>
  53. </a-form-item>
  54. </a-col>
  55. <a-col :md="6" :sm="8">
  56. <a-form-item label="计划数量">
  57. <a-input placeholder="请输入" v-model="queryParam.planQuantity"></a-input>
  58. </a-form-item>
  59. </a-col>
  60. <a-col :md="6" :sm="8">
  61. <a-form-item label="实际出货数量">
  62. <a-input placeholder="请输入" v-model="queryParam.actualShipquantity"></a-input>
  63. </a-form-item>
  64. </a-col>
  65. <a-col :md="6" :sm="8">
  66. <a-form-item label="短出数">
  67. <a-input placeholder="请输入" v-model="queryParam.shortseveral"></a-input>
  68. </a-form-item>
  69. </a-col> -->
  70. <a-col :md="6" :sm="8">
  71. <a-form-item label="是否有驳回">
  72. <a-select v-model="queryParam.rejectDate">
  73. <a-select-option value="">请选择</a-select-option>
  74. <a-select-option value="1">是</a-select-option>
  75. <a-select-option value="0">所有</a-select-option>
  76. </a-select>
  77. </a-form-item>
  78. </a-col>
  79. <a-col :md="6" :sm="8">
  80. <a-form-item label="审核人">
  81. <a-input placeholder="请输入" v-model="queryParam.approvalMan"></a-input>
  82. </a-form-item>
  83. </a-col>
  84. <a-col :md="6" :sm="8">
  85. <a-form-item label="单据状态">
  86. <a-select mode="multiple" @change="handleChange">
  87. <!-- <a-select-option value="">请选择</a-select-option> -->
  88. <a-select-option value="保存">保存</a-select-option>
  89. <a-select-option value="提交">提交</a-select-option>
  90. <a-select-option value="已指派">已指派</a-select-option>
  91. <a-select-option value="返单">返单</a-select-option>
  92. <a-select-option value="完成">完成</a-select-option>
  93. </a-select>
  94. </a-form-item>
  95. </a-col>
  96. </template>
  97. <a-col :md="6" :sm="8">
  98. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  99. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  100. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  101. <a @click="handleToggleSearch" style="margin-left: 8px">
  102. {{ toggleSearchStatus ? '收起' : '展开' }}
  103. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  104. </a>
  105. </span>
  106. </a-col>
  107. </a-row>
  108. </a-form>
  109. </div>
  110. </a-card>
  111. <!-- table区域 -->
  112. <a-spin :spinning="loading">
  113. <a-card :bordered="false" style=" marginTop:10px;">
  114. <div class="table-operator">
  115. <a-button type="primary" @click="exportList('成本分配列表')" icon="plus">导出</a-button>
  116. </div>
  117. <a-table
  118. bordered
  119. rowKey="id"
  120. :columns="costAllocationColumns"
  121. :data-source="costAllocationData"
  122. :loading="loading"
  123. :pagination="pagination"
  124. :scroll="{ x: 1000 }"
  125. @change="handleTableChange"
  126. >
  127. <!-- 操作 -->
  128. <!-- <span slot="option" slot-scope="text, record" >
  129. <a href="javascript:void(0);" @click="detail(record)">详情</a>
  130. </span> -->
  131. <span slot="action" slot-scope="text, record">
  132. <!-- <a @click="handleApply(record)" v-if="apply == 1 && (record.status=='保存' || record.status=='' || !record.status)">发起申请</a> -->
  133. <a @click="openAppendixList(record)">附件</a>
  134. <a-divider type="vertical" />
  135. <a-dropdown>
  136. <a class="ant-dropdown-link">更多<a-icon type="down"/></a>
  137. <a-menu slot="overlay" >
  138. <a-menu-item><a @click="detail(record)">详情</a></a-menu-item>
  139. <a-menu-item><a @click="cancelSumit(record)">取消提交</a></a-menu-item>
  140. <a-menu-item><a @click="approvalHistory(record)">审批历史</a></a-menu-item>
  141. </a-menu>
  142. </a-dropdown>
  143. </span>
  144. </a-table>
  145. </a-card>
  146. </a-spin>
  147. <ChistoryModal ref="ChistoryModal"></ChistoryModal>
  148. <attachment ref="attachment"></attachment>
  149. <!-- 详情 大抽屉 -->
  150. <costDetail-drawer ref="costDetailDrawer" @close="getCostList"></costDetail-drawer>
  151. </div>
  152. </template>
  153. <script>
  154. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  155. import JEllipsis from '@/components/jeecg/JEllipsis'
  156. import moment from 'moment'
  157. import { downFile } from '@/api/manage'
  158. import costDetailDrawer from '@views/cost-allocation-total/costDetailDrawer.vue'
  159. import attachment from '@views/cost-allocation-total/modal/attachment.vue'
  160. import ChistoryModal from '@views/cost-allocation-total/modal/ChistoryModal'
  161. import { costList, itemCheck, cancelItemCheck,cancelSubmit } from '@api/document/cost-allocation-total.js'
  162. export default {
  163. name: 'CostAllocationTotal', // 成本分配汇总 单证
  164. mixins: [JeecgListMixin],
  165. components: { JEllipsis, moment,attachment, costDetailDrawer,ChistoryModal },
  166. data() {
  167. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
  168. return {
  169. // 成本分配汇总 表头
  170. costAllocationColumns: [
  171. {
  172. title: '计划单号',
  173. width: 90,
  174. dataIndex: 'planNum',
  175. // customRender: (text, record, index) => `${index + 1}`,
  176. // fixed: 'left',
  177. className: 'replacecolor',
  178. ellipsis: true
  179. },
  180. { title: '制单人', width: 120, dataIndex: 'preparedBy', ellipsis: true, className: 'replacecolor' },
  181. { title: '保存日期', width: 120, dataIndex: 'createTime', ellipsis: true, className: 'replacecolor' },
  182. { title: '审核人', width: 120, dataIndex: 'approvalMan', ellipsis: true, className: 'replacecolor' },
  183. { title: '审核日期', width: 120, dataIndex: 'approvalDate', ellipsis: true, className: 'replacecolor' },
  184. { title: '返单日期', width: 120, dataIndex: 'rejectDate', ellipsis: true, className: 'replacecolor' },
  185. { title: '结束日期', width: 120, dataIndex: 'finalApproveDate', ellipsis: true, className: 'replacecolor' },
  186. { title: '产品款号', width: 120, dataIndex: 'poStyleNum', ellipsis: true, className: 'replacecolor' },
  187. { title: '外销员', width: 120, dataIndex: 'exportSales', ellipsis: true,className: 'replacecolor' },
  188. {
  189. title: '部门',
  190. width: 120,
  191. dataIndex: 'department',
  192. ellipsis: true,
  193. className: 'replacecolor'
  194. },
  195. { title: '成衣合同号', width: 140, dataIndex: 'garmentContractno', ellipsis: true, className: 'replacecolor' },
  196. { title: '客户简称', width: 150, dataIndex: 'customerShortame', ellipsis: true, className: 'replacecolor' },
  197. { title: '加工单位', width: 220, dataIndex: 'processUnit', ellipsis: true, align: 'left', className: 'replacecolor' },
  198. {
  199. title: '出运日期',
  200. width: 120,
  201. dataIndex: 'outdata',
  202. customRender: text => {
  203. if(text!==''&&text){
  204. return moment(parseInt(text)).format('YYYY-MM-DD')
  205. }else{
  206. return ''
  207. }
  208. },
  209. className: 'replacecolor'
  210. },
  211. { title: '计划数量', width: 90, dataIndex: 'planQuantity', ellipsis: true, className: 'replacecolor' },
  212. { title: '实际出货数量', width: 120, dataIndex: 'actualShipquantity', ellipsis: true, className: 'replacecolor' },
  213. { title: '短出数', width: 100, dataIndex: 'shortseveral', ellipsis: true, className: 'replacecolor' },
  214. { title: '外销总价($)', width: 120, dataIndex: 'usdTotalexportprice', ellipsis: true, className: 'replacecolor' },
  215. { title: '外销金额(¥)', width: 120, dataIndex: 'rmbExportamount', ellipsis: true, className: 'replacecolor' },
  216. { title: '面料不含税金额(¥)', width: 160, dataIndex: 'fabriccostNotincludestax', ellipsis: true, className: 'replacecolor' },
  217. { title: '辅料不含税金额(¥)', width: 160, dataIndex: 'excipiencostNotincludestax', ellipsis: true, className: 'replacecolor' },
  218. { title: '加工费(¥)', width: 100, dataIndex: 'rmbProcesscost', ellipsis: true, className: 'replacecolor' },
  219. { title: '加工费($)', width: 100, dataIndex: 'usdProcesscost', ellipsis: true, className: 'replacecolor' },
  220. { title: '不含税运杂费(¥)', width: 145, dataIndex: 'rmbExpense', ellipsis: true, className: 'replacecolor' },
  221. { title: '运杂费($)', width: 100, dataIndex: 'usdExpense', ellipsis: true, className: 'replacecolor' },
  222. { title: '责任单位事故金额(¥)', width: 170, dataIndex: 'accidentcnyAmount', ellipsis: true, className: 'replacecolor' },
  223. { title: '责任单位事故金额($)', width: 170, dataIndex: 'accidentUsdamount', ellipsis: true, className: 'replacecolor' },
  224. { title: '公司承担事故金额(¥)', width: 170, dataIndex: 'pkorgAmountrmb', ellipsis: true, className: 'replacecolor' },
  225. { title: '公司承担事故金额($)', width: 170, dataIndex: 'pkorgAmount', ellipsis: true, className: 'replacecolor' },
  226. { title: '备注', width: 120, dataIndex: 'remarks', ellipsis: true, className: 'replacecolor' },
  227. { title: '状态', width: 120,fixed: 'right', dataIndex: 'status', ellipsis: true, className: 'replacecolor' },
  228. { title: '操作', width: 120 ,fixed: 'right', dataIndex: 'option', ellipsis: true, className: 'replacecolor', scopedSlots: { customRender: 'action' } },
  229. ],
  230. costAllocationData: [],
  231. outdata:'',
  232. dateFormat: 'YYYY-MM-DD',
  233. // 查询条件
  234. queryParam: {
  235. },
  236. // 分页
  237. pagination: {
  238. // total: '',
  239. // current: 0,
  240. // pageSize: 0
  241. },
  242. apply:"",
  243. dateFormat: 'YYYY-MM-DD',
  244. loading: false // 表格加载
  245. }
  246. },
  247. created() {
  248. this.apply = this.$route.query.apply;
  249. console.log(this.$route.query)
  250. this.getCostList()
  251. document.title = '成本分配列表'+ ' · ' + '马菲羊'
  252. },
  253. methods: {
  254. // 分页查询
  255. getCostList() {
  256. this.$nextTick(() => {
  257. costList(this.queryParam).then(res => {
  258. if (res.success) {
  259. this.costAllocationData = res.result.records
  260. this.pagination = {
  261. total: res.result.total,
  262. current: res.result.current,
  263. pageSize: res.result.size
  264. }
  265. }else{
  266. this.$message.error(res.message);
  267. }
  268. })
  269. })
  270. },
  271. cancelSumit(record){
  272. var syApprovalHistory={
  273. stuta:'取消提交',
  274. planNo:record.planNum,
  275. processingOpinion:'',
  276. processedBy:this.$store.getters.userInfo.realname,
  277. processingTime:moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
  278. assignedBy:''
  279. }
  280. cancelSubmit({planNum:record.planNum,status:record.status,currentState:'取消提交',syApprovalHistory:syApprovalHistory}).then(res => {
  281. if (res.success) {
  282. this.getCostList()
  283. this.$message.success('取消提交成功')
  284. }else{
  285. this.$message.error(res.message);
  286. }
  287. })
  288. },
  289. // 详情
  290. detail(record) {
  291. this.$refs.costDetailDrawer.detailModVis = true
  292. this.$refs.costDetailDrawer.planNo = record.planNum
  293. this.$refs.costDetailDrawer.status = record.status
  294. // console.log('参数record', this.$refs.costDetailDrawer.record.planNum)
  295. this.$refs.costDetailDrawer.onSearch(record.planNum)
  296. },
  297. openAppendixList(record){
  298. this.$refs.attachment.AttachmentModVis = true
  299. var attachmentArr = record.attachs.split(',')
  300. var attachList = [];
  301. attachmentArr.forEach(item=>{
  302. var attach = {};
  303. attach.name = item;
  304. attach.src=item;
  305. attachList.push(attach);
  306. })
  307. this.$refs.attachment.attachmentData = attachList;
  308. },
  309. // 审核
  310. check(record) {
  311. this.$nextTick(() => {
  312. itemCheck({ plannum: record.planNum }).then(res => {
  313. if (res.success) {
  314. console.log('提交成功,单据状态改为【已审核】')
  315. this.costAllocationData.billstatus == '2'
  316. this.getCostList()
  317. this.$message.success('审核成功')
  318. }
  319. })
  320. })
  321. },
  322. // 取消审核
  323. cancelCheck(record) {
  324. this.$nextTick(() => {
  325. cancelItemCheck({ plannum: record.planNum }).then(res => {
  326. if (res.success) {
  327. console.log('提交成功,单据状态改为【仅保存】')
  328. this.costAllocationData.billstatus == '1'
  329. this.getCostList()
  330. this.$message.success('取消审核成功')
  331. }
  332. })
  333. })
  334. },
  335. approvalHistory(record){
  336. this.$refs.ChistoryModal.histiryModVis = true
  337. this.$refs.ChistoryModal.getHistoryList(record.planNum)
  338. },
  339. searchQuery() {
  340. this.queryParam.pageNo=''
  341. this.getCostList()
  342. },
  343. changeData(){
  344. var dd =moment(this.outdata).format('YYYY-MM-DD')
  345. dd = dd+' '+'00:00:00'
  346. this.queryParam.outdata = moment(dd).valueOf()
  347. },
  348. searchReset() {
  349. this.queryParam.pageNo = ''
  350. this.queryParam = {}
  351. this.getCostList()
  352. },
  353. handleChange(value){
  354. this.queryParam.status = value.toString()
  355. },
  356. handleApply(record){
  357. var data = {
  358. type:"成本表",
  359. ccode:record.planNum,
  360. };
  361. window.parent.postMessage({msg:"startApply", data:data}, "*");
  362. },
  363. //导出
  364. exportList(fileName){
  365. var params = this.queryParam
  366. this.loading = true
  367. downFile('/orderData/syCostLossReview/exportXls', params).then(data => {
  368. this.loading = false
  369. console.log('888')
  370. if (!data) {
  371. this.$message.warning('文件下载失败')
  372. return
  373. }
  374. if (typeof window.navigator.msSaveBlob !== 'undefined') {
  375. window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xlsx')
  376. } else {
  377. let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  378. let link = document.createElement('a')
  379. link.style.display = 'none'
  380. link.href = url
  381. link.setAttribute('download', fileName + '.xlsx')
  382. document.body.appendChild(link)
  383. link.click()
  384. document.body.removeChild(link) // 下载完成移除元素
  385. window.URL.revokeObjectURL(url) // 释放掉blob对象
  386. }
  387. })
  388. },
  389. handleTableChange(pagination, filters, sorter) {
  390. this.queryParam.pageNo = pagination.current
  391. this.getCostList()
  392. },
  393. // father 抽屉方法
  394. aa() {}
  395. },
  396. computed: {},
  397. mounted() {}
  398. }
  399. </script>
  400. <style lang="less" scoped>
  401. @import '~@assets/less/common.less';
  402. @import '~@assets/less/overwriter.less';
  403. /deep/ .ant-table-thead > tr > th {
  404. text-align: center;
  405. // font-weight: 700;
  406. }
  407. /deep/ .ant-table-tbody {
  408. text-align: center;
  409. }
  410. // /deep/ th.replacecolor {
  411. // background-color: #ccc;
  412. // }
  413. </style>