pro-progress-report.vue 13 KB

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