inwardAllDetailsOrder.vue 8.7 KB

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