timeDetailsWeight.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. // 计费详单
  2. <template>
  3. <div class="steel_inbound">
  4. <div class="sache">
  5. <span>详单时间:</span>
  6. <el-date-picker
  7. v-model="startTime"
  8. type="datetime"
  9. placeholder="选择日期"
  10. >
  11. </el-date-picker>
  12. <span>至</span>
  13. <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
  14. </el-date-picker>
  15. <el-button type="primary" class="btn" @click="onclick">
  16. <i class="el-icon-search"></i>查询
  17. </el-button>
  18. <el-button type="primary" @click="exportData()"
  19. ><i class="el-icon-download"></i>导出(Excel)</el-button
  20. >
  21. <span style="margin-left: 1rem;">合计时间:</span>
  22. <el-input
  23. v-model="totalTime"
  24. :disabled="true"
  25. style="width: 140px;"
  26. ></el-input>
  27. <span style="margin-left: 1rem;">合计金额:</span>
  28. <el-input
  29. v-model="totalMoney"
  30. :disabled="true"
  31. style="width: 100px;"
  32. ></el-input>
  33. </div>
  34. <div class="table">
  35. <el-tabs v-model="activeName">
  36. <!-- 未结算 -->
  37. <el-tab-pane label="未结算" name="first">
  38. <dilTable v-bind.sync="options1" ref="excelDom" @func="func">
  39. </dilTable>
  40. </el-tab-pane>
  41. <!-- 已结算 -->
  42. <el-tab-pane label="已结算" name="second">
  43. <dilTable v-bind.sync="options2"> </dilTable>
  44. </el-tab-pane>
  45. </el-tabs>
  46. </div>
  47. </div>
  48. </template>
  49. <script>
  50. import { sjTime } from "@/utils/sharedJsFile";
  51. import { getCookie } from "@/utils/util.js";
  52. export default {
  53. data() {
  54. return {
  55. startTime: null,
  56. endTime: null,
  57. totalMoney: null,
  58. totalTime: null,
  59. //单价
  60. Fee: null,
  61. //加载
  62. selectLineLoading: false,
  63. input: "",
  64. activeName: "first",
  65. ssoId: null,
  66. //详单Id
  67. detailsId: null,
  68. options1: {
  69. // first请求数据的地址
  70. requestUrl: ""
  71. },
  72. options2: {
  73. // second请求数据的地址
  74. requestUrl: ""
  75. },
  76. //是否打开修改详单地址弹出框
  77. dialogFormVisible: false,
  78. //原详单单价
  79. originalPriceValue: null,
  80. //新详单单价
  81. newPriceValue: null,
  82. //原详单地址
  83. originalAddress: null,
  84. //新详单地址
  85. newAddress: null,
  86. //新单价Id
  87. priceId: null,
  88. //是否打开运输单价的模态框
  89. addressDrawer: false,
  90. //运输单价的表格
  91. Address: {
  92. requestUrl: "/api/v1/ams/getAddressDeliveryAddress?apiId=255",
  93. selectionType: "radio"
  94. },
  95. // addressText:null,
  96. //缓存当前选中的运输单价
  97. priceMap: {},
  98. formLabelWidth: "125px",
  99. tableTitle: "内转计时计费详单"
  100. };
  101. },
  102. created() {
  103. this.options1GetRequestUrl();
  104. this.options2GetRequestUrl();
  105. },
  106. methods: {
  107. //未结算数据
  108. options1GetRequestUrl() {
  109. if (getCookie("orgCode") == "chengyunshang") {
  110. this.ssoId = getCookie("userId");
  111. this.options1.requestUrl =
  112. "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=0&carrierSsoId=" +
  113. getCookie("userId");
  114. } else if (
  115. getCookie("orgCode") == "dagangadmin" ||
  116. getCookie("orgCode") == "zidonghuabu" ||
  117. getCookie("orgCode") == "wuliuchuyunzhongxin"
  118. ) {
  119. this.options1.requestUrl =
  120. "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=0";
  121. } else {
  122. this.options1.requestUrl =
  123. "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=0&userId=" +
  124. getCookie("orgCode");
  125. }
  126. },
  127. //已结算数据
  128. options2GetRequestUrl() {
  129. if (getCookie("orgCode") == "chengyunshang") {
  130. this.ssoId = getCookie("userId");
  131. this.options2.requestUrl =
  132. "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=1&carrierSsoId=" +
  133. getCookie("userId");
  134. } else if (
  135. getCookie("orgCode") == "dagangadmin" ||
  136. getCookie("orgCode") == "zidonghuabu" ||
  137. getCookie("orgCode") == "wuliuchuyunzhongxin"
  138. ) {
  139. this.options2.requestUrl =
  140. "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=1";
  141. } else {
  142. this.options2.requestUrl =
  143. "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=1&userId=" +
  144. getCookie("orgCode");
  145. }
  146. },
  147. toInsert() {
  148. this.$router.push("/insertCheckInventory");
  149. },
  150. func(res) {
  151. console.log(res);
  152. var totalAllTime = 0;
  153. var totalAllMoney = 0;
  154. res.list.forEach(e => {
  155. totalAllTime = totalAllTime + e.resultTime;
  156. totalAllMoney = totalAllMoney + e.detailsAmount;
  157. });
  158. this.totalMoney = totalAllMoney;
  159. this.totalTime = totalAllTime;
  160. },
  161. onclick() {
  162. let startTime = null;
  163. let endTime = null;
  164. if (this.startTime) {
  165. startTime = sjTime(this.startTime);
  166. }
  167. if (this.endTime) {
  168. endTime = sjTime(this.endTime);
  169. }
  170. if (startTime && endTime) {
  171. if (startTime < endTime) {
  172. if (
  173. getCookie("orgCode") == "dagangadmin" ||
  174. getCookie("orgCode") == "zidonghuabu" ||
  175. getCookie("orgCode") == "wuliuchuyunzhongxin"
  176. ) {
  177. this.options1.requestUrl =
  178. "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=0" +
  179. "&startTime=" +
  180. startTime +
  181. "&endTime=" +
  182. endTime +
  183. "&i" +
  184. new Date();
  185. this.options2.requestUrl =
  186. "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=1" +
  187. "&startTime=" +
  188. startTime +
  189. "&endTime=" +
  190. endTime +
  191. "&i" +
  192. new Date();
  193. } else if (getCookie("orgCode") == "chengyunshang") {
  194. this.options1.requestUrl =
  195. "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=0&carrierSsoId=" +
  196. getCookie("userId") +
  197. "&startTime=" +
  198. startTime +
  199. "&endTime=" +
  200. endTime +
  201. "&i" +
  202. new Date();
  203. this.options2.requestUrl =
  204. "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=1&carrierSsoId=" +
  205. getCookie("userId") +
  206. "&startTime=" +
  207. startTime +
  208. "&endTime=" +
  209. endTime +
  210. "&i" +
  211. new Date();
  212. } else {
  213. this.options1.requestUrl =
  214. "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=0&userId=" +
  215. getCookie("orgCode") +
  216. "&startTime=" +
  217. startTime +
  218. "&endTime=" +
  219. endTime +
  220. "&i" +
  221. new Date();
  222. this.options2.requestUrl =
  223. "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=1&userId=" +
  224. getCookie("orgCode") +
  225. "&startTime=" +
  226. startTime +
  227. "&endTime=" +
  228. endTime +
  229. "&i" +
  230. new Date();
  231. }
  232. } else {
  233. this.startTime = null;
  234. this.endTime = null;
  235. this.$message.warning("开始时间要比结束时间早");
  236. }
  237. } else {
  238. }
  239. },
  240. //运输订单点击浏览的事件
  241. select() {
  242. this.addressDrawer = true;
  243. },
  244. //运输单价模态窗口的框计算
  245. selectAddressClick() {
  246. this.Price.requestUrl =
  247. "/api/v1/ams/getAddressDeliveryAddress?apiId=255&con=" +
  248. this.addressText;
  249. }
  250. }
  251. };
  252. </script>
  253. <style lang="scss" scode>
  254. .steel_inbound {
  255. .sache {
  256. margin-left: 20px;
  257. margin-top: 20px;
  258. .el-input {
  259. width: 20%;
  260. margin-right: 1.25rem;
  261. }
  262. }
  263. .table {
  264. margin-left: 20px;
  265. margin-top: 20px;
  266. }
  267. }
  268. </style>