timeTaskResult.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. // 计时作业
  2. <template>
  3. <div class="sale">
  4. <div class="top">
  5. <!-- 框计算 -->
  6. <span class="text">计时时间:</span>
  7. <el-date-picker v-model="startTime" type="datetime" placeholder="选择日期">
  8. </el-date-picker>
  9. <span class="text">至</span>
  10. <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
  11. </el-date-picker>
  12. <el-button type="primary" class="btn" @click="onclick">
  13. <i class="el-icon-search"></i>查询
  14. </el-button>
  15. <!-- excel导出 -->
  16. <el-button type="primary" @click="exportData()">
  17. <i class="el-icon-download"></i>导出(Excel)
  18. </el-button>
  19. </div>
  20. <div class="tab">
  21. <dilTable v-bind.sync="option" ref="excelDom">
  22. <el-table-column fixed="right" label="操作" width="180">
  23. <template slot-scope="scope">
  24. <div class="step">
  25. <el-button
  26. @click="getStepsList(scope.row)"
  27. type="text"
  28. size="small"
  29. >运输详情</el-button>
  30. </div>
  31. <!-- <el-button @click="" type="primary" style="margin-left: 16px;">
  32. 运输详情
  33. </el-button> -->
  34. </template>
  35. </el-table-column>
  36. </dilTable>
  37. </div>
  38. <!-- 运输进程详情 -->
  39. <el-drawer
  40. :visible.sync="drawer"
  41. :direction="direction">
  42. <!-- 步骤条显示 -->
  43. <div style="height: 200px;content-align:center" >
  44. <el-table
  45. :data="stepList"
  46. style="width: 100%">
  47. <el-table-column
  48. prop="linkName"
  49. label="计时状态"
  50. width="180">
  51. </el-table-column>
  52. <el-table-column
  53. prop="pointDate"
  54. label="时间"
  55. width="180">
  56. </el-table-column>
  57. </el-table>
  58. </div>
  59. </el-drawer>
  60. </div>
  61. </template>
  62. <script>
  63. import { getCookie } from "@/utils/util.js";
  64. import { sjTime } from "@/utils/sharedJsFile";
  65. export default {
  66. data(){
  67. return{
  68. inputText:'',
  69. option: {
  70. // 表格请求数据的地址
  71. requestUrl: "",
  72. },
  73. tableData: [],
  74. startTime: null,
  75. endTime: null,
  76. oldRow1: "",
  77. oldRowCount1: 1,
  78. drawer: false,
  79. direction: 'rtl',
  80. orderId: 0,
  81. stepList:[],
  82. tableTitle:'计时统计'
  83. }
  84. },
  85. created(){
  86. if(getCookie("orgCode") == "dagangadmin"||getCookie("orgCode") == "zidonghuabu"||getCookie("orgCode") == "wuliuchuyunzhongxin"){
  87. this.option.requestUrl = "/api/v1/tms/getAllTimeTaskResult?apiId=458"
  88. }else{
  89. console.log("cookier"+getCookie("userId"))
  90. this.option.requestUrl = "/api/v1/tms/getAllTimeTaskResult?apiId=458&orgCode="+getCookie("userId");
  91. }
  92. },
  93. methods:{
  94. getStepsList(row){
  95. console.log(row.orderId)
  96. this.orderId = row.orderId
  97. this.drawer = true
  98. let map = {
  99. orderId : this.orderId
  100. }
  101. this.axios.post("/api/v1/oms/getOrderResult",map)
  102. .then((res) => {
  103. console.log(res)
  104. if (res.status == 200) {
  105. this.stepList = res.data
  106. } else {
  107. this.$message.error("展示失败!");
  108. }
  109. });
  110. console.log(this.stepList)
  111. },
  112. getRequirementMaterial1(row) {
  113. // 记录重复点击次数
  114. if (this.oldRow1 === row) {
  115. this.oldRowCount1 += 1;
  116. }
  117. // 切换当前详情表
  118. this.$refs.excelDom.toggleRowExpansion(row);
  119. // 打开前关闭上一个详情表
  120. if (this.oldRow1 != "") {
  121. if (this.oldRow1 != row) {
  122. if (this.oldRowCount1 % 2 === 1) {
  123. this.$refs.excelDom.toggleRowExpansion(this.oldRow1);
  124. } else {
  125. this.oldRowCount1 = 1;
  126. }
  127. } else {
  128. this.oldRow1 = null;
  129. return;
  130. }
  131. }
  132. // 重置上一个点击对象
  133. this.oldRow1 = row;
  134. this.getMaterial(row.orderId);
  135. },
  136. onclick(){
  137. let startTime = null;
  138. let endTime = null;
  139. if (this.startTime) {
  140. startTime = sjTime(this.startTime);
  141. }
  142. if (this.endTime) {
  143. endTime = sjTime(this.endTime);
  144. }
  145. if (startTime && endTime) {
  146. if (startTime < endTime) {
  147. console.log(startTime)
  148. console.log(endTime)
  149. if(getCookie("orgCode") == "dagangadmin"||getCookie("orgCode") == "zidonghuabu"||getCookie("orgCode") == "wuliuchuyunzhongxin"){
  150. this.option.requestUrl = "/api/v1/tms/getAllTimeTaskResult?apiId=458&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
  151. }else{
  152. this.option.requestUrl = "/api/v1/tms/getAllTimeTaskResult?apiId=458&orgCode="+getCookie("userId")+"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
  153. }
  154. } else {
  155. this.startTime = null;
  156. this.endTime = null;
  157. this.$message.warning("开始时间要比结束时间早");
  158. }
  159. } else {
  160. }
  161. },
  162. getMaterial(orderId){
  163. console.log(orderId)
  164. this.axios.post("/api/v1/oms/getPauseTimeTaskDetail/" + orderId).then((res) => {
  165. console.log(res)
  166. this.tableData = res.data.data
  167. })
  168. },
  169. }
  170. }
  171. </script>
  172. <style lang="scss">
  173. .sale{
  174. .top {
  175. padding: 1.25rem 1.875rem;
  176. .el-input{
  177. width: 20%;
  178. }
  179. }
  180. }
  181. .el-table th.el-table__cell>.cell {
  182. display: inline-block;
  183. -webkit-box-sizing: border-box;
  184. box-sizing: border-box;
  185. position: relative;
  186. vertical-align: middle;
  187. padding-left: 10px;
  188. padding-right: 10px;
  189. width: 100%;
  190. text-align: center;
  191. }
  192. .step {
  193. text-align: center;
  194. }
  195. </style>