fabricLossesSummary.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  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.makingPeople"></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.approvalMan"></a-input>
  17. </a-form-item>
  18. </a-col>
  19. <a-col :md="6" :sm="8">
  20. <a-form-item label="计划单号">
  21. <a-input placeholder="请输入" v-model="queryParam.cCode"></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="保存日期" has-feedback>
  27. <a-range-picker
  28. :placeholder="['开始时间', '结束时间']"
  29. format="YYYY-MM-DD"
  30. style="width: 100%"
  31. v-model="createTime"
  32. @change="changeCreateTime"
  33. />
  34. <!-- <a-date-picker style="width: 100%" v-model="queryParam.createTime" @change="onChange" :format="dateFormat"> </a-date-picker> -->
  35. </a-form-item>
  36. </a-col>
  37. <a-col :md="6" :sm="8">
  38. <a-form-item label="审核日期" has-feedback>
  39. <a-range-picker
  40. :placeholder="['开始时间', '结束时间']"
  41. format="YYYY-MM-DD"
  42. style="width: 100%"
  43. v-model="approvalDate"
  44. @change="changeApprovalDate"
  45. />
  46. <!-- <a-date-picker style="width: 100%" v-model="queryParam.approvalDate" @change="onChange" :format="dateFormat"> </a-date-picker> -->
  47. </a-form-item>
  48. </a-col>
  49. <a-col :md="6" :sm="8">
  50. <a-form-item label="款号">
  51. <a-input placeholder="请输入" v-model="queryParam.cDefine22"></a-input>
  52. </a-form-item>
  53. </a-col>
  54. <a-col :md="6" :sm="8">
  55. <a-form-item label="计划员">
  56. <a-input placeholder="请输入" v-model="queryParam.planner"></a-input>
  57. </a-form-item>
  58. </a-col>
  59. <a-col :md="6" :sm="8">
  60. <a-form-item label="成衣合同号">
  61. <a-input placeholder="请输入" v-model="queryParam.contractNo"></a-input>
  62. </a-form-item>
  63. </a-col>
  64. <a-col :md="6" :sm="8">
  65. <a-form-item label="业务员">
  66. <a-input placeholder="请输入" v-model="queryParam.cPersonName"></a-input>
  67. </a-form-item>
  68. </a-col>
  69. </template>
  70. <a-col :md="6" :sm="8">
  71. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  72. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  73. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  74. <a @click="handleToggleSearch" style="margin-left: 8px">
  75. {{ toggleSearchStatus ? '收起' : '展开' }}
  76. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  77. </a>
  78. </span>
  79. </a-col>
  80. </a-row>
  81. </a-form>
  82. </div>
  83. </a-card>
  84. <!-- table区域 -->
  85. <a-card :bordered="false" style=" marginTop:10px;">
  86. <a-table
  87. bordered
  88. rowKey="id"
  89. :columns="fabricLossesColumns"
  90. :data-source="fabricLossesData"
  91. :loading="loading"
  92. :pagination="pagination"
  93. :scroll="{ x: 1200 }"
  94. @change="handleTableChange"
  95. >
  96. <span slot="action" slot-scope="text, record">
  97. <!-- <a @click="handleApply(record)" v-if="apply == 1 && (record.status=='保存' ||record.status=='完成'|| record.status=='' || record.status==undefined)">发起申请</a>
  98. <a-divider type="vertical" v-if="apply == 1 && (record.status=='保存' ||record.status=='完成'|| record.status=='' || record.status==undefined)"/> -->
  99. <a @click="openAppendixList(record)" v-if="record.attachs!==''&&record.attachs">附件</a>
  100. <a-divider v-if="record.attachs!==''&&record.attachs"/>
  101. <a-dropdown>
  102. <a class="ant-dropdown-link">更多<a-icon type="down"/></a>
  103. <a-menu slot="overlay" >
  104. <a-menu-item><a @click="cancelSumit(record)">取消提交</a></a-menu-item>
  105. <a-menu-item><a @click="details(record)">详情</a></a-menu-item>
  106. <a-menu-item><a @click="approvalHistory(record)">审批历史</a></a-menu-item>
  107. </a-menu>
  108. </a-dropdown>
  109. </span>
  110. </a-table>
  111. </a-card>
  112. <!-- 详情 大抽屉 -->
  113. <!-- <costDetail-drawer ref="costDetailDrawer" :fatherList="getCostList" @ok="modalFormOk"></costDetail-drawer> -->
  114. <attachment ref="attachment"></attachment>
  115. <history-modal ref="historyModal"></history-modal>
  116. <detail-fabric-loss-table ref="detailFabricLossTable" @close="getCostList"></detail-fabric-loss-table>
  117. </div>
  118. </template>
  119. <script>
  120. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  121. import JEllipsis from '@/components/jeecg/JEllipsis'
  122. import moment from 'moment'
  123. import costDetailDrawer from '@views/cost-allocation-total/costDetailDrawer.vue'
  124. import attachment from '@views/cost-allocation-total/modal/attachment.vue'
  125. import historyModal from '@views/cost-allocation-total/modal/historyModal.vue'
  126. import detailFabricLossTable from '@views/cost-allocation-total/modal/detailFabricLossTable.vue'
  127. import { checkList,historyApproval,cancelSubmit } from '@api/document/fabricLossesSummary.js'
  128. export default {
  129. name: 'fabricLossesSummary',
  130. mixins: [JeecgListMixin],
  131. components: { JEllipsis, moment, costDetailDrawer,attachment,historyModal,detailFabricLossTable },
  132. data() {
  133. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
  134. return {
  135. createTime:[],
  136. approvalDate:[],
  137. fabricLossesColumns: [
  138. {
  139. title: '保存日期',
  140. width: 120,
  141. dataIndex: 'createTime',
  142. customRender: text => {
  143. return moment(text).format('YYYY-MM-DD')
  144. },
  145. ellipsis: true,
  146. className: 'replacecolor'
  147. },
  148. {
  149. title: '审核人',
  150. width: 120,
  151. dataIndex: 'approvalMan',
  152. ellipsis: true,
  153. className: 'replacecolor'
  154. },
  155. {
  156. title: '审核日期',
  157. width: 120,
  158. dataIndex: 'approvalDate',
  159. customRender: text => {
  160. if(text!==''&&text){
  161. return moment(text).format('YYYY-MM-DD')
  162. }else{
  163. return ''
  164. }
  165. },
  166. ellipsis: true,
  167. className: 'replacecolor'
  168. },
  169. {
  170. title: '计划单号',
  171. width: 120,
  172. dataIndex: 'ccode',
  173. ellipsis: true,
  174. className: 'replacecolor'
  175. },
  176. { title: '款号', width: 90, dataIndex: 'cdefine22',ellipsis: true, className: 'replacecolor' },
  177. {
  178. title: '计划员',
  179. width: 120,
  180. dataIndex: 'planner',
  181. className: 'replacecolor',
  182. ellipsis: true,
  183. },
  184. {
  185. title: '成衣合同号',
  186. width: 120,
  187. dataIndex: 'contractNo',
  188. ellipsis: true,
  189. className: 'replacecolor'
  190. },
  191. {
  192. title: '排单数量',
  193. width: 120,
  194. dataIndex: 'number',
  195. ellipsis: true,
  196. className: 'replacecolor'
  197. },
  198. { title: '业务员', width: 120, dataIndex: 'cpersonName',ellipsis: true, className: 'replacecolor' },
  199. {
  200. title: '实际出库数量',
  201. width: 180,
  202. dataIndex: 'outboundNumber',
  203. ellipsis: true,
  204. // customRender: t => ellipsis(t),
  205. className: 'replacecolor',
  206. },
  207. { title: '制单人', width: 120, dataIndex: 'makingPeople', ellipsis: true,className: 'replacecolor' },
  208. { title: '状态', width: 130, dataIndex: 'status', ellipsis: true,className: 'replacecolor',fixed: 'right' },
  209. {
  210. title: '操作',
  211. dataIndex: 'action',
  212. scopedSlots: { customRender: 'action' },
  213. align: 'center',
  214. fixed: 'right',
  215. width: 130
  216. },
  217. ],
  218. fabricLossesData: [],
  219. // 查询条件
  220. queryParam: {
  221. // index: '',
  222. // planNum: '',
  223. // customerShortame: '',
  224. pageNo: '' // 点击的页数
  225. },
  226. // 分页
  227. pagination: {
  228. },
  229. dateFormat: 'YYYY-MM-DD',
  230. loading: false, // 表格加载
  231. apply:"",
  232. }
  233. },
  234. created() {
  235. this.apply = this.$route.query.apply;
  236. this.getCostList()
  237. },
  238. methods: {
  239. // 分页查询
  240. getCostList() {
  241. this.$nextTick(() => {
  242. checkList(this.queryParam).then(res => {
  243. if (res.success) {
  244. this.fabricLossesData = res.result.records
  245. this.pagination = {
  246. total: res.result.total,
  247. current: res.result.current,
  248. pageSize: res.result.size
  249. }
  250. }
  251. })
  252. })
  253. },
  254. cancelSumit(record){
  255. var syApprovalHistory={
  256. stuta:'取消提交',
  257. planNo:record.ccode,
  258. processingOpinion:'',
  259. processedBy:this.$store.getters.userInfo.realname,
  260. processingTime:moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
  261. assignedBy:''
  262. }
  263. cancelSubmit({planNum:record.ccode,status:record.status,currentState:'取消提交',syApprovalHistory:syApprovalHistory}).then(res => {
  264. if (res.success) {
  265. this.getCostList()
  266. this.$message.success('取消提交成功')
  267. }else{
  268. this.$message.error(res.message);
  269. }
  270. })
  271. },
  272. approvalHistory(record){
  273. this.$refs.historyModal.histiryModVis = true
  274. this.$refs.historyModal.getHistoryList(record.ccode)
  275. // historyApproval({code:record.ccode}).then(res => {
  276. // if (res.success) {
  277. // }else{
  278. // this.$message.error(res.message);
  279. // }
  280. // })
  281. },
  282. details(record){
  283. this.$refs.detailFabricLossTable.detailModVis = true
  284. this.$refs.detailFabricLossTable.status = record.status
  285. this.$refs.detailFabricLossTable.onSearch(record.ccode,'0')
  286. },
  287. searchQuery() {
  288. this.getCostList()
  289. },
  290. searchReset() {
  291. this.queryParam.pageNo = ''
  292. this.queryParam = {}
  293. this.getCostList()
  294. },
  295. onChange(){
  296. this.queryParam.createTime = (this.queryParam.createTime&&this.queryParam.createTime!=='')?this.queryParam.createTime.format('YYYY-MM-DD'):''
  297. this.queryParam.approvalDate = (this.queryParam.approvalDate&&this.queryParam.approvalDate!=='')?this.queryParam.approvalDate.format('YYYY-MM-DD'):''
  298. },
  299. handleTableChange(pagination, filters, sorter) {
  300. this.queryParam.pageNo = pagination.current
  301. this.getCostList()
  302. },
  303. changeCreateTime(){
  304. this.queryParam.createTimeE=this.createTime[1].format('YYYY-MM-DD')
  305. this.queryParam.createTimeB=this.createTime[0].format('YYYY-MM-DD')
  306. },
  307. changeApprovalDate(){
  308. this.queryParam.approvalDateE=this.approvalDate[0].format('YYYY-MM-DD')
  309. this.queryParam.approvalDateB=this.approvalDate[1].format('YYYY-MM-DD')
  310. },
  311. handleApply(record){
  312. var data = {
  313. type:"面损表",
  314. ccode:record.ccode,
  315. };
  316. window.parent.postMessage({msg:"startApply", data:data}, "*");
  317. },
  318. openAppendixList(record){
  319. this.$refs.attachment.AttachmentModVis = true
  320. var attachmentArr = record.attachs.split(',')
  321. var attachList = [];
  322. attachmentArr.forEach(item=>{
  323. var attach = {};
  324. attach.name = item;
  325. attach.src=item;
  326. attachList.push(attach);
  327. })
  328. this.$refs.attachment.attachmentData = attachList;
  329. },
  330. },
  331. computed: {},
  332. mounted() {}
  333. }
  334. </script>
  335. <style lang="less" scoped>
  336. @import '~@assets/less/common.less';
  337. @import '~@assets/less/overwriter.less';
  338. /deep/ .ant-table-thead > tr > th {
  339. text-align: center;
  340. // font-weight: 700;
  341. }
  342. /deep/ .ant-table-tbody {
  343. text-align: center;
  344. }
  345. // /deep/ th.replacecolor {
  346. // background-color: #ccc;
  347. // }
  348. </style>