You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

384 lines
12 KiB

4 years ago
  1. <template>
  2. <div class="customer-css">
  3. <el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners"
  4. width="800px" style="height: 560px;" class="customer-dialog">
  5. <el-container cus style="height: 355px;">
  6. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -5px;">
  7. <el-form-item :label="'工厂编号:'">
  8. <el-input v-model="pageData.site" style="width: 130px"></el-input>
  9. </el-form-item>
  10. <el-form-item :label="'日历编码:'">
  11. <el-input v-model="pageData.calendarId" style="width: 130px"></el-input>
  12. </el-form-item>
  13. <el-form-item :label="'日历描述:'">
  14. <el-input v-model="pageData.calendarDesc" style="width: 130px"></el-input>
  15. </el-form-item>
  16. <el-table
  17. height="300"
  18. :data="calendarList"
  19. border
  20. style="width: 765px;">
  21. <!-- <el-table-column
  22. header-align="center"
  23. align="center"
  24. width="50"
  25. label="操作">
  26. <template slot-scope="scope">
  27. <a type="text" size="small" @click="shiftModal(scope.row)">班次</a>
  28. </template>
  29. </el-table-column>-->
  30. <el-table-column
  31. v-for="(item,index) in columnCalendarOutArray" :key="index"
  32. :sortable="item.columnSortable"
  33. :prop="item.columnProp"
  34. :header-align="item.headerAlign"
  35. :show-overflow-tooltip="item.showOverflowTooltip"
  36. :align="item.align"
  37. :fixed="item.fixed"
  38. :width="item.columnWidth"
  39. :label="item.columnLabel">
  40. <template slot-scope="scope">
  41. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  42. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  43. style="width: 100px; height: 80px"/></span>
  44. </template>
  45. </el-table-column>
  46. </el-table>
  47. </el-form>
  48. </el-container>
  49. <span slot="footer" class="dialog-footer">
  50. <el-button type="primary" @click="closeDialog">关闭</el-button>
  51. </span>
  52. </el-dialog>
  53. </div>
  54. </template>
  55. <script>
  56. import {
  57. getCalendarExceptionData,
  58. }from "@/api/base.js"
  59. export default {
  60. data() {
  61. return {
  62. titleCon: '工作日历外',
  63. calendarList: [],
  64. columnCalendarOutArray: [
  65. {
  66. userId: this.$store.state.user.name,
  67. functionId: 6038,
  68. serialNumber: '6038Table2Scheduledate',
  69. tableId: "6038Table2",
  70. tableName: "工作日历表2",
  71. columnProp: "scheduledate",
  72. headerAlign: "center",
  73. align: "left",
  74. columnLabel: "日期",
  75. columnHidden: false,
  76. columnImage: false,
  77. columnSortable: false,
  78. sortLv: 0,
  79. status: true,
  80. fixed: false,
  81. columnWidth: 100
  82. },
  83. {
  84. userId: this.$store.state.user.name,
  85. functionId: 6038,
  86. serialNumber: '6038Table2Datetype',
  87. tableId: "6038Table2",
  88. tableName: "工作日历表2",
  89. columnProp: "datetype",
  90. headerAlign: "center",
  91. align: "left",
  92. columnLabel: "工作日类型",
  93. columnHidden: false,
  94. columnImage: false,
  95. columnSortable: false,
  96. sortLv: 0,
  97. status: true,
  98. fixed: false,
  99. columnWidth: 100
  100. },
  101. {
  102. userId: this.$store.state.user.name,
  103. functionId: 6038,
  104. serialNumber: '6038Table2Worktime',
  105. tableId: "6038Table2",
  106. tableName: "工作日历表2",
  107. columnProp: "worktime",
  108. headerAlign: "center",
  109. align: "right",
  110. columnLabel: "累计工作时间",
  111. columnHidden: false,
  112. columnImage: false,
  113. columnSortable: false,
  114. sortLv: 0,
  115. status: true,
  116. fixed: false,
  117. columnWidth: 100
  118. },
  119. {
  120. userId: this.$store.state.user.name,
  121. functionId: 6038,
  122. serialNumber: '6038Table2Exceptexacttime1',
  123. tableId: "6038Table2",
  124. tableName: "工作日历表2",
  125. columnProp: "exceptexacttime1",
  126. headerAlign: "center",
  127. align: "left",
  128. columnLabel: "休息时间点1",
  129. columnHidden: false,
  130. columnImage: false,
  131. columnSortable: false,
  132. sortLv: 0,
  133. status: true,
  134. fixed: false,
  135. columnWidth: 100
  136. },
  137. {
  138. userId: this.$store.state.user.name,
  139. functionId: 6038,
  140. serialNumber: '6038Table2Exceptduration1',
  141. tableId: "6038Table2",
  142. tableName: "工作日历表2",
  143. columnProp: "exceptduration1",
  144. headerAlign: "center",
  145. align: "right",
  146. columnLabel: "休息时长1",
  147. columnHidden: false,
  148. columnImage: false,
  149. columnSortable: false,
  150. sortLv: 0,
  151. status: true,
  152. fixed: false,
  153. columnWidth: 100
  154. },
  155. {
  156. userId: this.$store.state.user.name,
  157. functionId: 6038,
  158. serialNumber: '6038Table2Exceptexacttime2',
  159. tableId: "6038Table2",
  160. tableName: "工作日历表2",
  161. columnProp: "exceptexacttime2",
  162. headerAlign: "center",
  163. align: "left",
  164. columnLabel: "休息时间点2",
  165. columnHidden: false,
  166. columnImage: false,
  167. columnSortable: false,
  168. sortLv: 0,
  169. status: true,
  170. fixed: false,
  171. columnWidth: 100
  172. },
  173. {
  174. userId: this.$store.state.user.name,
  175. functionId: 6038,
  176. serialNumber: '6038Table2Exceptduration2',
  177. tableId: "6038Table2",
  178. tableName: "工作日历表2",
  179. columnProp: "exceptduration2",
  180. headerAlign: "center",
  181. align: "right",
  182. columnLabel: "休息时长2",
  183. columnHidden: false,
  184. columnImage: false,
  185. columnSortable: false,
  186. sortLv: 0,
  187. status: true,
  188. fixed: false,
  189. columnWidth: 100
  190. },
  191. {
  192. userId: this.$store.state.user.name,
  193. functionId: 6038,
  194. serialNumber: '6038Table2Exceptexacttime3',
  195. tableId: "6038Table2",
  196. tableName: "工作日历表2",
  197. columnProp: "exceptexacttime3",
  198. headerAlign: "center",
  199. align: "left",
  200. columnLabel: "休息时间点3",
  201. columnHidden: false,
  202. columnImage: false,
  203. columnSortable: false,
  204. sortLv: 0,
  205. status: true,
  206. fixed: false,
  207. columnWidth: 100
  208. },
  209. {
  210. userId: this.$store.state.user.name,
  211. functionId: 6038,
  212. serialNumber: '6038Table2Exceptduration3',
  213. tableId: "6038Table2",
  214. tableName: "工作日历表2",
  215. columnProp: "exceptduration3",
  216. headerAlign: "center",
  217. align: "right",
  218. columnLabel: "休息时长3",
  219. columnHidden: false,
  220. columnImage: false,
  221. columnSortable: false,
  222. sortLv: 0,
  223. status: true,
  224. fixed: false,
  225. columnWidth: 100
  226. },
  227. {
  228. userId: this.$store.state.user.name,
  229. functionId: 6038,
  230. serialNumber: '6038Table2Exceptexacttime4',
  231. tableId: "6038Table2",
  232. tableName: "工作日历表2",
  233. columnProp: "exceptexacttime4",
  234. headerAlign: "center",
  235. align: "left",
  236. columnLabel: "休息时间点4",
  237. columnHidden: false,
  238. columnImage: false,
  239. columnSortable: false,
  240. sortLv: 0,
  241. status: true,
  242. fixed: false,
  243. columnWidth: 100
  244. },
  245. {
  246. userId: this.$store.state.user.name,
  247. functionId: 6038,
  248. serialNumber: '6038Table2Exceptduration4',
  249. tableId: "6038Table2",
  250. tableName: "工作日历表2",
  251. columnProp: "exceptduration4",
  252. headerAlign: "center",
  253. align: "right",
  254. columnLabel: "休息时长4",
  255. columnHidden: false,
  256. columnImage: false,
  257. columnSortable: false,
  258. sortLv: 0,
  259. status: true,
  260. fixed: false,
  261. columnWidth: 100
  262. },
  263. {
  264. userId: this.$store.state.user.name,
  265. functionId: 6038,
  266. serialNumber: '6038Table2Exceptexacttime5',
  267. tableId: "6038Table2",
  268. tableName: "工作日历表2",
  269. columnProp: "exceptexacttime5",
  270. headerAlign: "center",
  271. align: "left",
  272. columnLabel: "休息时间点5",
  273. columnHidden: false,
  274. columnImage: false,
  275. columnSortable: false,
  276. sortLv: 0,
  277. status: true,
  278. fixed: false,
  279. columnWidth: 100
  280. },
  281. {
  282. userId: this.$store.state.user.name,
  283. functionId: 6038,
  284. serialNumber: '6038Table2Exceptduration5',
  285. tableId: "6038Table2",
  286. tableName: "工作日历表2",
  287. columnProp: "exceptduration5",
  288. headerAlign: "center",
  289. align: "right",
  290. columnLabel: "休息时长5",
  291. columnHidden: false,
  292. columnImage: false,
  293. columnSortable: false,
  294. sortLv: 0,
  295. status: true,
  296. fixed: false,
  297. columnWidth: 100
  298. },
  299. {
  300. userId: this.$store.state.user.name,
  301. functionId: 6038,
  302. serialNumber: '6038Table2Exceptexacttime6',
  303. tableId: "6038Table2",
  304. tableName: "工作日历表2",
  305. columnProp: "exceptexacttime6",
  306. headerAlign: "center",
  307. align: "left",
  308. columnLabel: "休息时间点6",
  309. columnHidden: false,
  310. columnImage: false,
  311. columnSortable: false,
  312. sortLv: 0,
  313. status: true,
  314. fixed: false,
  315. columnWidth: 100
  316. },
  317. {
  318. userId: this.$store.state.user.name,
  319. functionId: 6038,
  320. serialNumber: '6038Table2Exceptduration6',
  321. tableId: "6038Table2",
  322. tableName: "工作日历表2",
  323. columnProp: "exceptduration6",
  324. headerAlign: "center",
  325. align: "right",
  326. columnLabel: "休息时长6",
  327. columnHidden: false,
  328. columnImage: false,
  329. columnSortable: false,
  330. sortLv: 0,
  331. status: true,
  332. fixed: false,
  333. columnWidth: 100
  334. }
  335. ],
  336. pageData: {
  337. site: this.$store.state.user.site,
  338. username: this.$store.state.user.name,
  339. calendarId: '',
  340. calendarDesc: '',
  341. scheduleDate: '',
  342. },
  343. dataListLoading: false,
  344. }
  345. },
  346. methods: {
  347. //初始化页面的参数
  348. init(requestData) {
  349. //初始化参数
  350. this.pageData.calendarId = requestData.calendarId;
  351. this.pageData.calendarDesc = requestData.calendarDesc;
  352. this.pageData.scheduledDate = requestData.scheduledDate;
  353. //刷新页面的表格数据
  354. this.refreshPageTable();
  355. },
  356. /*关闭modal*/
  357. closeDialog(){
  358. this.$emit('update:visible', false);
  359. },
  360. /*刷新页面的参数*/
  361. refreshPageTable(){
  362. getCalendarExceptionData(this.pageData).then(({data}) => {
  363. this.calendarList = data.rows
  364. })
  365. },
  366. },
  367. created() {
  368. }
  369. }
  370. </script>
  371. <style scoped lang="scss">
  372. .customer-css /deep/ .el-table__header th.is-leaf{
  373. line-height: 16px;
  374. }
  375. </style>