timeTaskResult.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  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="detailclick1(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. <!-- 运输进程详情 -->
  37. <el-table-column type="expand" width="1">
  38. <template slot-scope="props">
  39. <el-form label-position="center" inline class="demo-table-expand">
  40. <div v-if="false">{{ props }}</div>
  41. <div>
  42. <el-table :data="tableData1" border>
  43. <el-table-column
  44. v-for="(item, i) in tableHead"
  45. :key="i"
  46. :prop="item.prop"
  47. :label="item.label"
  48. :width="item.width"
  49. ></el-table-column>
  50. </el-table>
  51. </div>
  52. </el-form>
  53. </template>
  54. </el-table-column>
  55. </dilTable>
  56. </div>
  57. <!-- 运输进程详情 -->
  58. <!-- <el-drawer
  59. :visible.sync="drawer"
  60. :direction="direction"> -->
  61. <!-- 步骤条显示 -->
  62. <!-- <div style="height: 200px;content-align:center" >
  63. <el-table
  64. :data="stepList"
  65. style="width: 100%">
  66. <el-table-column
  67. prop="linkName"
  68. label="计时状态"
  69. width="180">
  70. </el-table-column>
  71. <el-table-column
  72. prop="pointDate"
  73. label="时间"
  74. width="180">
  75. </el-table-column>
  76. </el-table>
  77. </div>
  78. </el-drawer> -->
  79. </div>
  80. </template>
  81. <script>
  82. import { getCookie } from "@/utils/util.js";
  83. import { sjTime } from "@/utils/sharedJsFile";
  84. export default {
  85. data(){
  86. return{
  87. inputText:'',
  88. option: {
  89. // 表格请求数据的地址
  90. requestUrl: "",
  91. },
  92. tableHead: [
  93. {
  94. prop: "linkName",
  95. label: "计时状态",
  96. width: 150,
  97. },
  98. {
  99. prop: "pointDate",
  100. label: "时间",
  101. width: 150,
  102. }
  103. ],
  104. tableData1: [],
  105. tableData: [],
  106. startTime: null,
  107. endTime: null,
  108. oldRow1: "",
  109. oldRowCount1: 1,
  110. drawer: false,
  111. direction: 'rtl',
  112. orderId: 0,
  113. stepList:[],
  114. tableTitle:'计时统计'
  115. }
  116. },
  117. created(){
  118. if(getCookie("orgCode") == "dagangadmin"||getCookie("orgCode") == "zidonghuabu"||getCookie("orgCode") == "wuliuchuyunzhongxin"){
  119. this.option.requestUrl = "/api/v1/tms/getAllTimeTaskResult?apiId=458"
  120. }else{
  121. console.log("cookier"+getCookie("userId"))
  122. this.option.requestUrl = "/api/v1/tms/getAllTimeTaskResult?apiId=458&orgCode="+getCookie("userId");
  123. }
  124. },
  125. methods:{
  126. // -------查看物资详情(已拒绝)
  127. detailclick1(row) {
  128. // 记录重复点击次数
  129. if (this.oldRow1 === row) {
  130. this.oldRowCount1 += 1;
  131. }
  132. this.orderId = row.orderId
  133. let map = {
  134. orderId : this.orderId
  135. }
  136. // 切换当前详情表
  137. this.$refs.excelDom.toggleRowExpansion(row);
  138. // 打开前关闭上一个详情表
  139. if (this.oldRow1 != "") {
  140. if (this.oldRow1 != row) {
  141. if (this.oldRowCount1 % 2 === 1) {
  142. this.$refs.excelDom.toggleRowExpansion(this.oldRow1);
  143. } else {
  144. this.oldRowCount1 = 1;
  145. }
  146. } else {
  147. this.oldRow1 = null;
  148. return;
  149. }
  150. }
  151. // 重置上一个点击对象
  152. this.oldRow1 = row;
  153. // 根据销售订单物资中间表id查询物资信息
  154. this.axios
  155. .post("/api/v1/oms/getOrderResult?orderId=",map)
  156. .then((res) => {
  157. console.log("res",res)
  158. this.tableData1 = res.data;
  159. });
  160. },
  161. getStepsList(row){
  162. console.log(row.orderId)
  163. this.orderId = row.orderId
  164. this.drawer = true
  165. let map = {
  166. orderId : this.orderId
  167. }
  168. this.axios.post("/api/v1/oms/getOrderResult",map)
  169. .then((res) => {
  170. console.log(res)
  171. if (res.status == 200) {
  172. this.stepList = res.data
  173. } else {
  174. this.$message.error("展示失败!");
  175. }
  176. });
  177. console.log(this.stepList)
  178. },
  179. getRequirementMaterial1(row) {
  180. // 记录重复点击次数
  181. if (this.oldRow1 === row) {
  182. this.oldRowCount1 += 1;
  183. }
  184. // 切换当前详情表
  185. this.$refs.excelDom.toggleRowExpansion(row);
  186. // 打开前关闭上一个详情表
  187. if (this.oldRow1 != "") {
  188. if (this.oldRow1 != row) {
  189. if (this.oldRowCount1 % 2 === 1) {
  190. this.$refs.excelDom.toggleRowExpansion(this.oldRow1);
  191. } else {
  192. this.oldRowCount1 = 1;
  193. }
  194. } else {
  195. this.oldRow1 = null;
  196. return;
  197. }
  198. }
  199. // 重置上一个点击对象
  200. this.oldRow1 = row;
  201. this.getMaterial(row.orderId);
  202. },
  203. onclick(){
  204. let startTime = null;
  205. let endTime = null;
  206. if (this.startTime) {
  207. startTime = sjTime(this.startTime);
  208. }
  209. if (this.endTime) {
  210. endTime = sjTime(this.endTime);
  211. }
  212. if (startTime && endTime) {
  213. if (startTime < endTime) {
  214. console.log(startTime)
  215. console.log(endTime)
  216. if(getCookie("orgCode") == "dagangadmin"||getCookie("orgCode") == "zidonghuabu"||getCookie("orgCode") == "wuliuchuyunzhongxin"){
  217. this.option.requestUrl = "/api/v1/tms/getAllTimeTaskResult?apiId=458&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
  218. }else{
  219. this.option.requestUrl = "/api/v1/tms/getAllTimeTaskResult?apiId=458&orgCode="+getCookie("userId")+"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
  220. }
  221. } else {
  222. this.startTime = null;
  223. this.endTime = null;
  224. this.$message.warning("开始时间要比结束时间早");
  225. }
  226. } else {
  227. }
  228. },
  229. getMaterial(orderId){
  230. console.log(orderId)
  231. this.axios.post("/api/v1/oms/getPauseTimeTaskDetail/" + orderId).then((res) => {
  232. console.log(res)
  233. this.tableData = res.data.data
  234. })
  235. },
  236. }
  237. }
  238. </script>
  239. <style lang="scss">
  240. .sale{
  241. .top {
  242. padding: 1.25rem 1.875rem;
  243. .el-input{
  244. width: 20%;
  245. }
  246. }
  247. }
  248. .el-table th.el-table__cell>.cell {
  249. display: inline-block;
  250. -webkit-box-sizing: border-box;
  251. box-sizing: border-box;
  252. position: relative;
  253. vertical-align: middle;
  254. padding-left: 10px;
  255. padding-right: 10px;
  256. width: 100%;
  257. text-align: center;
  258. }
  259. .step {
  260. text-align: center;
  261. }
  262. </style>