fabricLossesSummary.vue 15 KB

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