pro-progress-report.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. <template>
  2. <!-- 生产进度报表 -->
  3. <div id="proProgressReport">
  4. <a-card :bordered="false">
  5. <!-- 查询区域 -->
  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.cSOCode"></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.CDepName"></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.cInvName"></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.cDefine12"></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.cPersonName"></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.planCode"></a-input>
  38. </a-form-item>
  39. </a-col>
  40. <!-- <a-col :md="6" :sm="8">
  41. <a-form-item label="订单日期" has-feedback>
  42. <a-date-picker
  43. style="width: 100%"
  44. format="YYYY-MM-DD"
  45. placeholder="请选择订单日期"
  46. v-model="queryParam.DDate"
  47. @change="onDateChange"
  48. ></a-date-picker>
  49. </a-form-item>
  50. </a-col> -->
  51. <a-col :md="6" :sm="8">
  52. <a-form-item label="订单日期">
  53. <a-range-picker
  54. :placeholder="['开始时间', '结束时间']"
  55. format="YYYY-MM-DD"
  56. style="width: 100%"
  57. v-model="cSOCode"
  58. @change="dDateChange"
  59. />
  60. </a-form-item>
  61. </a-col>
  62. <a-col :md="6" :sm="8">
  63. <a-form-item label="款号">
  64. <a-input placeholder="请输入款号" v-model="queryParam.itemNumber"></a-input>
  65. </a-form-item>
  66. </a-col>
  67. <a-col :md="6" :sm="8">
  68. <a-form-item label="交期">
  69. <a-range-picker
  70. :placeholder="['开始时间', '结束时间']"
  71. format="YYYY-MM-DD"
  72. style="width: 100%"
  73. v-model="preDeliveryDate"
  74. @change="deliveryDateChange"
  75. />
  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.accId"></a-input>
  81. </a-form-item>
  82. </a-col> -->
  83. </template>
  84. <!-- 重置 -->
  85. <a-col :md="6" :sm="8">
  86. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  87. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  88. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  89. <a @click="handleToggleSearch" style="margin-left: 8px">
  90. {{ toggleSearchStatus ? '收起' : '展开' }}
  91. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  92. </a>
  93. </span>
  94. </a-col>
  95. </a-row>
  96. </a-form>
  97. </div>
  98. </a-card>
  99. <!-- table区域 -->
  100. <a-card :bordered="false" style="marginTop:10px;">
  101. <a-table
  102. bordered
  103. rowKey="id"
  104. :columns="proProgressColumns"
  105. :data-source="proProgressData"
  106. :loading="loading"
  107. :pagination="pagination"
  108. :scroll="{ x: 1500 }"
  109. @change="handleTableChange"
  110. >
  111. <!-- 销售订单号 链接-->
  112. <span slot="csocode" slot-scope="text">
  113. <a>{{ text }}</a>
  114. </span>
  115. <!-- 图片 弹框-->
  116. <span slot="imageslot">
  117. <a>查看</a>
  118. </span>
  119. <!--附件-->
  120. <span slot="accessory" slot-scope="text, record">
  121. <a-button type="primary" @click="openItemOnclosure(record)" >附件</a-button>
  122. </span>
  123. </a-table>
  124. </a-card>
  125. <!-- 单个订单报表 抽屉 -->
  126. <salesOrderDetails-drawer ref="salesOrderDetailsDrawer" @ok="modalFormOk"></salesOrderDetails-drawer>
  127. <imgModal ref="imgdetal"></imgModal>
  128. <!-- 附件 -->
  129. <attachment-display ref="attachmentDisplay"></attachment-display>
  130. </div>
  131. </template>
  132. <script>
  133. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  134. import JEllipsis from '@/components/jeecg/JEllipsis'
  135. import moment from 'moment'
  136. import AttachmentDisplay from '@views/reportForms/pro-progress-report/attachment-display.vue'
  137. import salesOrderDetailsDrawer from '@views/reportForms/pro-progress-report/salesOrderDetailsDrawer.vue'
  138. import imgModal from '@views/reportForms/full-rate-table/progtressImg.vue'
  139. import { proProgressList, getImg } from '@api/reportForms/pro-progress-report.js'
  140. export default {
  141. name: 'ProProgressReport', // 生产进度报表
  142. mixins: [JeecgListMixin],
  143. components: { JEllipsis, moment, salesOrderDetailsDrawer,imgModal,AttachmentDisplay },
  144. data() {
  145. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
  146. return {
  147. description: '生产进度报表',
  148. // 表头
  149. proProgressColumns: [
  150. { title: '账套', width: 90, fixed: 'left', dataIndex: 'account', className: 'replacecolor' },
  151. {
  152. title: '销售订单号',
  153. width: 280,
  154. fixed: 'left',
  155. // align: 'left',
  156. dataIndex: 'csocode',
  157. className: 'replacecolor',
  158. customCell: this.showDrawer,
  159. scopedSlots: { customRender: 'csocode' }
  160. },
  161. { title: '款号', width: 100, dataIndex: 'itemNumber', className: 'replacecolor' },
  162. { title: '计划单号', width: 100, dataIndex: 'planCode', className: 'replacecolor' },
  163. {
  164. title: '成衣加工厂',
  165. width: 220,
  166. dataIndex: 'cdefine12',
  167. className: 'replacecolor'
  168. },
  169. {
  170. title: '物料名称',
  171. width: 280,
  172. dataIndex: 'cinvName',
  173. customRender: t => ellipsis(t),
  174. className: 'replacecolor'
  175. },
  176. {
  177. title: '颜色',
  178. width: 120,
  179. dataIndex: 'color',
  180. customRender: t => ellipsis(t),
  181. className: 'replacecolor'
  182. },
  183. { title: '单价', width: 80, dataIndex: 'itaxUnitPrice', className: 'replacecolor' },
  184. { title: '订单数量', width: 100, dataIndex: 'iquantity', className: 'replacecolor' },
  185. { title: '入库数量', width: 100, dataIndex: 'finquantity', className: 'replacecolor' },
  186. { title: '出库数量', width: 100, dataIndex: 'foutquantity', className: 'replacecolor' },
  187. { title: '开票数量', width: 100, dataIndex: 'ikpquantity', className: 'replacecolor' },
  188. {
  189. title: '部门',
  190. width: 80,
  191. dataIndex: 'cdepName',
  192. //fixed: 'left',
  193. className: 'replacecolor'
  194. },
  195. { title: '业务员', width: 80, dataIndex: 'cpersonName', className: 'replacecolor' },
  196. {
  197. title: '交期',
  198. width: 100,
  199. dataIndex: 'dpreDateBT',
  200. customRender: text => {
  201. return moment(text).format('YYYY-MM-DD')
  202. },
  203. className: 'replacecolor'
  204. },
  205. // { title: '物料编码', width: 220, dataIndex: 'cinvCode', className: 'replacecolor' },
  206. // {
  207. // title: '创建时间',
  208. // dataIndex: 'createTime',
  209. // align: 'center',
  210. // sorter: true,
  211. // customRender: text => {
  212. // return moment(text).format('YYYY-MM-DD')
  213. // }
  214. // },
  215. // { title: '总额(原币)', width: 140, dataIndex: 'totalSum', className: 'replacecolor' },
  216. // { title: '单价(本币)', width: 180, dataIndex: 'bbPrice', className: 'replacecolor' },
  217. // { title: '总额(本币)', width: 140, dataIndex: 'inatSum', className: 'replacecolor' },
  218. // { title: '实际发票成本', width: 160, dataIndex: 'icostsum', className: 'replacecolor' },
  219. {
  220. title: '图片',
  221. width: 70,
  222. dataIndex: 'image',
  223. customCell: this.picShow,
  224. className: 'replacecolor',
  225. scopedSlots: { customRender: 'imageslot' }
  226. },
  227. { title: '附件', width: 100, dataIndex: 'accessory', className: 'replacecolor',scopedSlots: { customRender: 'accessory' } }
  228. ],
  229. proProgressData: [], //生产进度数据
  230. loading: false, // 表格加载
  231. pagination: {
  232. // total: '',
  233. // current: 0,
  234. // pageSize: 0
  235. },
  236. preDeliveryDate:[],
  237. cSOCode:[],
  238. // 查询条件
  239. queryParam: {
  240. // pageNo: '',
  241. // csocode: '', // 销售订单号
  242. // cdepName: '', // 部门
  243. // cinvName: '',
  244. // cdefine12: '', // 成衣加工厂
  245. // cpersonName: '',
  246. // planCode: '', // 计划单号
  247. // dDate: '',
  248. // color: '',
  249. // dPreDateBT: '' // 交期
  250. // accId:'903'
  251. }
  252. }
  253. },
  254. created() {
  255. document.title = '生产进度报表'+ ' · ' + '马菲羊'
  256. // this.getproProgressList()
  257. },
  258. methods: {
  259. // 分页查询 生产进度列表
  260. getproProgressList() {
  261. this.$nextTick(() => {
  262. this.loading = true
  263. proProgressList(this.queryParam).then(res => {
  264. this.loading = false
  265. if (res.success) {
  266. this.proProgressData = res.result.records
  267. console.log('生产进度列表页', this.proProgressData)
  268. this.pagination = {
  269. total: res.result.total,
  270. current: res.result.current,
  271. pageSize: res.result.size
  272. }
  273. }
  274. })
  275. })
  276. },
  277. // 【销售订单号】 抽屉
  278. showDrawer(record) {
  279. return {
  280. on: {
  281. click: event => {
  282. this.$refs.salesOrderDetailsDrawer.visible = true
  283. this.$refs.salesOrderDetailsDrawer.record = record //接口参数,获取(主表 + 所有页签信息)
  284. this.$refs.salesOrderDetailsDrawer.getDetails()
  285. // console.log('【列表页 点击的销售订单对象】', this.$refs.salesOrderDetailsDrawer.record)
  286. }
  287. }
  288. }
  289. },
  290. // 图片 查看
  291. picShow(record) {
  292. return {
  293. on: {
  294. click: event => {
  295. // console.log('【查看】的图片ID', record.pictureId)
  296. if( record.pictureId == null || record.pictureId=='undefined' || record.pictureId == ""){
  297. this.$message.error("没有找到图片!");
  298. return;
  299. }
  300. this.$nextTick(() => {
  301. getImg({ pictureId: record.pictureId }).then(res => {
  302. // console.log('数据:', res[0].picture)
  303. this.$refs.imgdetal.visible = true
  304. this.$refs.imgdetal.dd = res[0].picture
  305. })
  306. })
  307. // this.$refs.salesOrderDetails.visible = true
  308. }
  309. }
  310. }
  311. },
  312. // 查询
  313. searchQuery() {
  314. this.queryParam.pageNo = ''
  315. if(this.preDeliveryDate.length==0){
  316. this.$message.error('请选择交期!');
  317. }else if(this.preDeliveryDate.length ==2){
  318. var separator = "-"; //日期分隔符
  319. var startDates = this.queryParam.dPreDateB.split(separator);
  320. var endDates = this.queryParam.dPreDateE.split(separator);
  321. var startDate = new Date(startDates[0], startDates[1]-1, startDates[2]);
  322. var endDate = new Date(endDates[0], endDates[1]-1, endDates[2]);
  323. var timeInterval= parseInt(Math.abs(endDate - startDate ) / 1000 / 60 / 60 /24) + 1;
  324. if(timeInterval > 31){
  325. this.$message.error('交期区间超过31天,请重新选择!');
  326. }else {
  327. this.getproProgressList()
  328. }
  329. }else{
  330. this.getproProgressList()
  331. }
  332. },
  333. searchReset() {
  334. this.queryParam = {}
  335. // this.queryParam.accId='903'
  336. this.preDeliveryDate = []
  337. this.proProgressData =[]
  338. this.cSOCode = []
  339. // this.getproProgressList()
  340. },
  341. // 附件
  342. openItemOnclosure(record){
  343. var attachList = [];
  344. record.accessorItemList.forEach(e=>{
  345. var attach = {};
  346. attach.name = e.filename;
  347. attach.src=e.fileurl;
  348. attachList.push(attach);
  349. });
  350. this.$refs.attachmentDisplay.AttachmentModVis = true
  351. this.$refs.attachmentDisplay.attachmentData = attachList;
  352. },
  353. // 分页变化时触发
  354. handleTableChange(pagination, filters, sorter) {
  355. this.queryParam.pageNo = pagination.current
  356. this.getproProgressList()
  357. },
  358. // 查询条件 订单日期转换成字符串并赋值
  359. onDateChange(value, dateString) {
  360. this.queryParam.DDate = dateString
  361. this.queryParam.DPreDateBT = dateString
  362. },
  363. deliveryDateChange(value, dateString) {
  364. this.queryParam.dPreDateB = dateString[0]
  365. this.queryParam.dPreDateE = dateString[1]
  366. },
  367. dDateChange(value, dateString) {
  368. this.queryParam.dDateB = dateString[0]
  369. this.queryParam.dDateE = dateString[1]
  370. },
  371. }
  372. }
  373. </script>
  374. <style lang="less" scoped>
  375. @import '~@assets/less/common.less';
  376. @import '~@assets/less/overwriter.less';
  377. /deep/ .ant-table-thead > tr > th {
  378. text-align: center;
  379. // font-weight: 700;
  380. }
  381. /deep/ .ant-table-tbody {
  382. text-align: center;
  383. }
  384. // /deep/ th.replacecolor {
  385. // background-color: #ccc;
  386. // }
  387. </style>