DayReport.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <template>
  2. <div class="container">
  3. <div class="title">
  4. <div class="time">
  5. <a-space>
  6. <a-date-picker v-model="queryParams.dateStart" :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN" @change="onDateChange">
  7. <span class="date">
  8. <a-icon type="calendar" theme="filled" /> {{ BaseTool.Date.formatter(queryParams.dateStart,BaseTool.Date.PICKER_NORM_DATE_PATTERN) }}
  9. </span>
  10. </a-date-picker>
  11. ~
  12. <a-date-picker v-model="queryParams.dateEnd" :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN" @change="onDateChange">
  13. <span class="date">
  14. <a-icon type="calendar" theme="filled" /> {{ BaseTool.Date.formatter(queryParams.dateEnd,BaseTool.Date.PICKER_NORM_DATE_PATTERN) }}
  15. </span>
  16. </a-date-picker>
  17. </a-space>
  18. </div>
  19. <div>时代思康新材料有限公司 用存日报表填报</div>
  20. <a-button
  21. style="margin-left: 8px"
  22. v-if="$auth('produce-reports-export')"
  23. type="primary"
  24. icon="download"
  25. @click="doExport">导出
  26. </a-button>
  27. </div>
  28. <a-table size="small" bordered :columns="columns" :data-source="data">
  29. <template #yjh902="text,record">
  30. <div @dblclick="handleEdit(record, 'yjh902')"> {{ text }} </div>
  31. </template>
  32. <template #yjh977="text,record">
  33. <div @dblclick="handleEdit(record, 'yjh977')"> {{ text }} </div>
  34. </template>
  35. <template #yjh977Xl="text,record">
  36. <div @dblclick="handleEdit(record, 'yjh977Xl')"> {{ text }} </div>
  37. </template>
  38. <template #lhn="text,record">
  39. <div @dblclick="handleEdit(record, 'lhn')"> {{ text }} </div>
  40. </template>
  41. <template #lhnYjh="text,record">
  42. <div @dblclick="handleEdit(record, 'lhnYjh')"> {{ text }} </div>
  43. </template>
  44. <template #lz="text,record">
  45. <div @dblclick="handleEdit(record, 'lz')"> {{ text }} </div>
  46. </template>
  47. <template #lzYjh="text,record">
  48. <div @dblclick="handleEdit(record, 'lzYjh')"> {{ text }} </div>
  49. </template>
  50. <template #fhnYjh="text,record">
  51. <div @dblclick="handleEdit(record, 'fhnYjh')"> {{ text }} </div>
  52. </template>
  53. <template #stockLhn="text,record">
  54. <div @dblclick="handleEdit(record, 'stockLhn')"> {{ text }} </div>
  55. </template>
  56. <template #stockLz="text,record">
  57. <div @dblclick="handleEdit(record, 'stockLz')"> {{ text }} </div>
  58. </template>
  59. <template #gas="text,record">
  60. <div @dblclick="handleEdit(record, 'gas')"> {{ text }} </div>
  61. </template>
  62. <template #steam="text,record">
  63. <div @dblclick="handleEdit(record, 'steam')"> {{ text }} </div>
  64. </template>
  65. <template #riverWater="text,record">
  66. <div @dblclick="handleEdit(record, 'riverWater')"> {{ text }} </div>
  67. </template>
  68. <template #sewage="text,record">
  69. <div @dblclick="handleEdit(record, 'sewage')"> {{ text }} </div>
  70. </template>
  71. </a-table>
  72. <BaseForm ref="baseForm" @ok="handleOk" />
  73. </div>
  74. </template>
  75. <script>
  76. import { exportTianProduceReport, queryTian, updateTian } from '@/api/produce/report'
  77. import BaseForm from './modules/BaseForm'
  78. export default {
  79. components: { BaseForm },
  80. data () {
  81. return {
  82. queryParams: {
  83. // dateStart: this.BaseTool.Moment().startOf('month'),
  84. dateStart: this.BaseTool.Moment().subtract(1, 'month'),
  85. dateEnd: this.BaseTool.Moment().subtract(1, 'days')
  86. },
  87. data: [],
  88. columns: [
  89. {
  90. title: '时间',
  91. dataIndex: 'date',
  92. key: 'date',
  93. align: 'center',
  94. width: 50
  95. },
  96. {
  97. title: '902(月计划产量)',
  98. dataIndex: 'yjh902',
  99. key: 'yjh902',
  100. align: 'center',
  101. width: 100,
  102. scopedSlots: { customRender: 'yjh902' }
  103. },
  104. {
  105. title: 'CS-977(月计划产量)',
  106. dataIndex: 'yjh977',
  107. key: 'yjh977',
  108. align: 'center',
  109. width: 100,
  110. scopedSlots: { customRender: 'yjh977' }
  111. },
  112. {
  113. title: 'CS-977(月计划销售)',
  114. dataIndex: 'yjh977Xl',
  115. key: 'yjh977Xl',
  116. align: 'center',
  117. width: 100,
  118. scopedSlots: { customRender: 'yjh977Xl' }
  119. },
  120. {
  121. title: '氯化钠(当日销售)',
  122. dataIndex: 'lhn',
  123. key: 'lhn',
  124. align: 'center',
  125. width: 100,
  126. scopedSlots: { customRender: 'lhn' }
  127. },
  128. {
  129. title: '氯化钠(月计划销售)',
  130. dataIndex: 'lhnYjh',
  131. key: 'lhnYjh',
  132. align: 'center',
  133. width: 100,
  134. scopedSlots: { customRender: 'lhnYjh' }
  135. },
  136. {
  137. title: '锂渣(当日销售)',
  138. dataIndex: 'lz',
  139. key: 'lz',
  140. align: 'center',
  141. width: 100,
  142. scopedSlots: { customRender: 'lz' }
  143. },
  144. {
  145. title: '锂渣(月计划销售)',
  146. dataIndex: 'lzYjh',
  147. key: 'lzYjh',
  148. align: 'center',
  149. width: 100,
  150. scopedSlots: { customRender: 'lzYjh' }
  151. },
  152. {
  153. title: '氟化钠(月计划销售)',
  154. dataIndex: 'fhnYjh',
  155. key: 'fhnYjh',
  156. align: 'center',
  157. width: 100,
  158. scopedSlots: { customRender: 'fhnYjh' }
  159. },
  160. {
  161. title: '氯化钠(库存)',
  162. dataIndex: 'stockLhn',
  163. key: 'stockLhn',
  164. align: 'center',
  165. width: 100,
  166. scopedSlots: { customRender: 'stockLhn' }
  167. },
  168. {
  169. title: '锂渣(库存)',
  170. dataIndex: 'stockLz',
  171. key: 'stockLz',
  172. align: 'center',
  173. width: 100,
  174. scopedSlots: { customRender: 'stockLz' }
  175. },
  176. {
  177. title: '天然气',
  178. dataIndex: 'gas',
  179. key: 'gas',
  180. align: 'center',
  181. width: 100,
  182. scopedSlots: { customRender: 'gas' }
  183. },
  184. {
  185. title: '蒸汽',
  186. dataIndex: 'steam',
  187. key: 'steam',
  188. align: 'center',
  189. width: 100,
  190. scopedSlots: { customRender: 'steam' }
  191. },
  192. {
  193. title: '河水',
  194. dataIndex: 'riverWater',
  195. key: 'riverWater',
  196. align: 'center',
  197. width: 100,
  198. scopedSlots: { customRender: 'riverWater' }
  199. },
  200. {
  201. title: '污水',
  202. dataIndex: 'sewage',
  203. key: 'sewage',
  204. align: 'center',
  205. width: 100,
  206. scopedSlots: { customRender: 'sewage' }
  207. }
  208. ]
  209. }
  210. },
  211. mounted () {
  212. this.getData()
  213. },
  214. methods: {
  215. getData () {
  216. this.queryParams = {
  217. dateStart: this.BaseTool.Date.formatter(this.queryParams.dateStart, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN),
  218. dateEnd: this.BaseTool.Date.formatter(this.queryParams.dateEnd, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  219. }
  220. queryTian(this.queryParams).then((res) => {
  221. this.data = res.data
  222. // console.log(this.inProductList)
  223. })
  224. },
  225. onDateChange (value) {
  226. this.getData()
  227. },
  228. handleEdit (record, key) {
  229. this.$refs.baseForm.base(record, key)
  230. },
  231. doExport () {
  232. const parameter = {
  233. ...this.queryParams
  234. }
  235. exportTianProduceReport(parameter).then(file => {
  236. this.BaseTool.Util.downLoadExportExcel(file)
  237. })
  238. },
  239. handleOk (record) {
  240. updateTian(record).then((res) => {
  241. this.getData()
  242. })
  243. }
  244. }
  245. }
  246. </script>
  247. <style lang="less" scoped>
  248. .container {
  249. background-color: #fff;
  250. border-radius: 10px;
  251. width: 100%;
  252. height: 100%;
  253. padding: 20px;
  254. .title {
  255. text-align: center;
  256. font-size: 24px;
  257. font-weight: bold;
  258. position: relative;
  259. margin-bottom: 20px;
  260. .time {
  261. position: absolute;
  262. left: 20px;
  263. top: 0px;
  264. .date {
  265. font-size: 16px;
  266. }
  267. }
  268. }
  269. }
  270. </style>