list.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  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="detail(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="cancelSumit(record)">取消提交</a></a-menu-item>
  139. <a-menu-item><a @click="approvalHistory(record)">审批历史</a></a-menu-item>
  140. </a-menu>
  141. </a-dropdown>
  142. </span>
  143. </a-table>
  144. </a-card>
  145. </a-spin>
  146. <ChistoryModal ref="ChistoryModal"></ChistoryModal>
  147. <!-- 详情 大抽屉 -->
  148. <costDetail-drawer ref="costDetailDrawer" @close="getCostList"></costDetail-drawer>
  149. </div>
  150. </template>
  151. <script>
  152. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  153. import JEllipsis from '@/components/jeecg/JEllipsis'
  154. import moment from 'moment'
  155. import { downFile } from '@/api/manage'
  156. import costDetailDrawer from '@views/cost-allocation-total/costDetailDrawer.vue'
  157. import ChistoryModal from '@views/cost-allocation-total/modal/ChistoryModal'
  158. import { costList, itemCheck, cancelItemCheck,cancelSubmit } from '@api/document/cost-allocation-total.js'
  159. export default {
  160. name: 'CostAllocationTotal', // 成本分配汇总 单证
  161. mixins: [JeecgListMixin],
  162. components: { JEllipsis, moment, costDetailDrawer,ChistoryModal },
  163. data() {
  164. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
  165. return {
  166. // 成本分配汇总 表头
  167. costAllocationColumns: [
  168. {
  169. title: '计划单号',
  170. width: 90,
  171. dataIndex: 'planNum',
  172. // customRender: (text, record, index) => `${index + 1}`,
  173. // fixed: 'left',
  174. className: 'replacecolor',
  175. ellipsis: true
  176. },
  177. { title: '制单人', width: 120, dataIndex: 'preparedBy', ellipsis: true, className: 'replacecolor' },
  178. { title: '保存日期', width: 120, dataIndex: 'createTime', ellipsis: true, className: 'replacecolor' },
  179. { title: '审核人', width: 120, dataIndex: 'approvalMan', ellipsis: true, className: 'replacecolor' },
  180. { title: '审核日期', width: 120, dataIndex: 'approvalDate', ellipsis: true, className: 'replacecolor' },
  181. { title: '返单日期', width: 120, dataIndex: 'rejectDate', ellipsis: true, className: 'replacecolor' },
  182. { title: '结束日期', width: 120, dataIndex: 'finalApproveDate', ellipsis: true, className: 'replacecolor' },
  183. { title: '产品款号', width: 120, dataIndex: 'poStyleNum', ellipsis: true, className: 'replacecolor' },
  184. { title: '外销员', width: 120, dataIndex: 'exportSales', ellipsis: true,className: 'replacecolor' },
  185. {
  186. title: '部门',
  187. width: 120,
  188. dataIndex: 'department',
  189. ellipsis: true,
  190. className: 'replacecolor'
  191. },
  192. { title: '成衣合同号', width: 140, dataIndex: 'garmentContractno', ellipsis: true, className: 'replacecolor' },
  193. { title: '客户简称', width: 150, dataIndex: 'customerShortame', ellipsis: true, className: 'replacecolor' },
  194. { title: '加工单位', width: 220, dataIndex: 'processUnit', ellipsis: true, align: 'left', className: 'replacecolor' },
  195. {
  196. title: '出运日期',
  197. width: 120,
  198. dataIndex: 'outdata',
  199. customRender: text => {
  200. if(text!==''&&text){
  201. return moment(parseInt(text)).format('YYYY-MM-DD')
  202. }else{
  203. return ''
  204. }
  205. },
  206. className: 'replacecolor'
  207. },
  208. { title: '计划数量', width: 90, dataIndex: 'planQuantity', ellipsis: true, className: 'replacecolor' },
  209. { title: '实际出货数量', width: 120, dataIndex: 'actualShipquantity', ellipsis: true, className: 'replacecolor' },
  210. { title: '短出数', width: 100, dataIndex: 'shortseveral', ellipsis: true, className: 'replacecolor' },
  211. { title: '外销总价($)', width: 120, dataIndex: 'usdTotalexportprice', ellipsis: true, className: 'replacecolor' },
  212. { title: '外销金额(¥)', width: 120, dataIndex: 'rmbExportamount', ellipsis: true, className: 'replacecolor' },
  213. { title: '面料不含税金额(¥)', width: 160, dataIndex: 'fabriccostNotincludestax', ellipsis: true, className: 'replacecolor' },
  214. { title: '辅料不含税金额(¥)', width: 160, dataIndex: 'excipiencostNotincludestax', ellipsis: true, className: 'replacecolor' },
  215. { title: '加工费(¥)', width: 100, dataIndex: 'rmbProcesscost', ellipsis: true, className: 'replacecolor' },
  216. { title: '加工费($)', width: 100, dataIndex: 'usdProcesscost', ellipsis: true, className: 'replacecolor' },
  217. { title: '不含税运杂费(¥)', width: 145, dataIndex: 'rmbExpense', ellipsis: true, className: 'replacecolor' },
  218. { title: '运杂费($)', width: 100, dataIndex: 'usdExpense', ellipsis: true, className: 'replacecolor' },
  219. { title: '责任单位事故金额(¥)', width: 170, dataIndex: 'accidentcnyAmount', ellipsis: true, className: 'replacecolor' },
  220. { title: '责任单位事故金额($)', width: 170, dataIndex: 'accidentUsdamount', ellipsis: true, className: 'replacecolor' },
  221. { title: '公司承担事故金额(¥)', width: 170, dataIndex: 'pkorgAmountrmb', ellipsis: true, className: 'replacecolor' },
  222. { title: '公司承担事故金额($)', width: 170, dataIndex: 'pkorgAmount', ellipsis: true, className: 'replacecolor' },
  223. { title: '备注', width: 120, dataIndex: 'remarks', ellipsis: true, className: 'replacecolor' },
  224. { title: '状态', width: 120,fixed: 'right', dataIndex: 'status', ellipsis: true, className: 'replacecolor' },
  225. { title: '操作', width: 120 ,fixed: 'right', dataIndex: 'option', ellipsis: true, className: 'replacecolor', scopedSlots: { customRender: 'action' } },
  226. ],
  227. costAllocationData: [],
  228. outdata:'',
  229. dateFormat: 'YYYY-MM-DD',
  230. // 查询条件
  231. queryParam: {
  232. },
  233. // 分页
  234. pagination: {
  235. // total: '',
  236. // current: 0,
  237. // pageSize: 0
  238. },
  239. apply:"",
  240. dateFormat: 'YYYY-MM-DD',
  241. loading: false // 表格加载
  242. }
  243. },
  244. created() {
  245. this.apply = this.$route.query.apply;
  246. console.log(this.$route.query)
  247. this.getCostList()
  248. document.title = '成本分配列表'+ ' · ' + '森语'
  249. },
  250. methods: {
  251. // 分页查询
  252. getCostList() {
  253. this.$nextTick(() => {
  254. costList(this.queryParam).then(res => {
  255. if (res.success) {
  256. this.costAllocationData = res.result.records
  257. this.pagination = {
  258. total: res.result.total,
  259. current: res.result.current,
  260. pageSize: res.result.size
  261. }
  262. }else{
  263. this.$message.error(res.message);
  264. }
  265. })
  266. })
  267. },
  268. cancelSumit(record){
  269. var syApprovalHistory={
  270. stuta:'取消提交',
  271. planNo:record.planNum,
  272. processingOpinion:'',
  273. processedBy:this.$store.getters.userInfo.realname,
  274. processingTime:moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
  275. assignedBy:''
  276. }
  277. cancelSubmit({planNum:record.planNum,status:record.status,currentState:'取消提交',syApprovalHistory:syApprovalHistory}).then(res => {
  278. if (res.success) {
  279. this.getCostList()
  280. this.$message.success('取消提交成功')
  281. }else{
  282. this.$message.error(res.message);
  283. }
  284. })
  285. },
  286. // 详情
  287. detail(record) {
  288. this.$refs.costDetailDrawer.detailModVis = true
  289. this.$refs.costDetailDrawer.planNo = record.planNum
  290. this.$refs.costDetailDrawer.status = record.status
  291. // console.log('参数record', this.$refs.costDetailDrawer.record.planNum)
  292. this.$refs.costDetailDrawer.onSearch(record.planNum)
  293. },
  294. // 审核
  295. check(record) {
  296. this.$nextTick(() => {
  297. itemCheck({ plannum: record.planNum }).then(res => {
  298. if (res.success) {
  299. console.log('提交成功,单据状态改为【已审核】')
  300. this.costAllocationData.billstatus == '2'
  301. this.getCostList()
  302. this.$message.success('审核成功')
  303. }
  304. })
  305. })
  306. },
  307. // 取消审核
  308. cancelCheck(record) {
  309. this.$nextTick(() => {
  310. cancelItemCheck({ plannum: record.planNum }).then(res => {
  311. if (res.success) {
  312. console.log('提交成功,单据状态改为【仅保存】')
  313. this.costAllocationData.billstatus == '1'
  314. this.getCostList()
  315. this.$message.success('取消审核成功')
  316. }
  317. })
  318. })
  319. },
  320. approvalHistory(record){
  321. this.$refs.ChistoryModal.histiryModVis = true
  322. this.$refs.ChistoryModal.getHistoryList(record.planNum)
  323. },
  324. searchQuery() {
  325. this.queryParam.pageNo=''
  326. this.getCostList()
  327. },
  328. changeData(){
  329. var dd =moment(this.outdata).format('YYYY-MM-DD')
  330. dd = dd+' '+'00:00:00'
  331. this.queryParam.outdata = moment(dd).valueOf()
  332. },
  333. searchReset() {
  334. this.queryParam.pageNo = ''
  335. this.queryParam = {}
  336. this.getCostList()
  337. },
  338. handleChange(value){
  339. this.queryParam.status = value.toString()
  340. },
  341. handleApply(record){
  342. var data = {
  343. type:"成本表",
  344. ccode:record.planNum,
  345. };
  346. window.parent.postMessage({msg:"startApply", data:data}, "*");
  347. },
  348. //导出
  349. exportList(fileName){
  350. var params = this.queryParam
  351. this.loading = true
  352. downFile('/orderData/syCostLossReview/exportXls', params).then(data => {
  353. this.loading = false
  354. console.log('888')
  355. if (!data) {
  356. this.$message.warning('文件下载失败')
  357. return
  358. }
  359. if (typeof window.navigator.msSaveBlob !== 'undefined') {
  360. window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xlsx')
  361. } else {
  362. let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  363. let link = document.createElement('a')
  364. link.style.display = 'none'
  365. link.href = url
  366. link.setAttribute('download', fileName + '.xlsx')
  367. document.body.appendChild(link)
  368. link.click()
  369. document.body.removeChild(link) // 下载完成移除元素
  370. window.URL.revokeObjectURL(url) // 释放掉blob对象
  371. }
  372. })
  373. },
  374. handleTableChange(pagination, filters, sorter) {
  375. this.queryParam.pageNo = pagination.current
  376. this.getCostList()
  377. },
  378. // father 抽屉方法
  379. aa() {}
  380. },
  381. computed: {},
  382. mounted() {}
  383. }
  384. </script>
  385. <style lang="less" scoped>
  386. @import '~@assets/less/common.less';
  387. @import '~@assets/less/overwriter.less';
  388. /deep/ .ant-table-thead > tr > th {
  389. text-align: center;
  390. // font-weight: 700;
  391. }
  392. /deep/ .ant-table-tbody {
  393. text-align: center;
  394. }
  395. // /deep/ th.replacecolor {
  396. // background-color: #ccc;
  397. // }
  398. </style>