purInwardDetailsOrder.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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
  14. v-model="endTime"
  15. type="datetime"
  16. placeholder="选择日期"
  17. >
  18. </el-date-picker>
  19.       <el-button type="primary" class="btn" @click="onclick">
  20.         <i class="el-icon-search"></i>查询
  21.       </el-button>
  22. <el-button type="primary" @click="exportData()"><i class="el-icon-download"></i>导出(Excel)</el-button>
  23. <span style="margin-left: 1rem;">合计净重:</span>
  24. <el-input v-model="totalNetWeight" :disabled="true" style="width: 140px;"></el-input>
  25. <span style="margin-left: 1rem;">合计金额:</span>
  26. <el-input v-model="totalMoney" :disabled="true" style="width: 100px;"></el-input>
  27. </div>
  28. <div class="table">
  29. <el-tabs v-model="activeName">
  30. <!-- 未结算 -->
  31. <el-tab-pane label="未结算" name="first">
  32. <dilTable v-bind.sync="options1" ref="excelDom" @func="func">
  33. </dilTable>
  34. </el-tab-pane>
  35. <!-- 已结算 -->
  36. <el-tab-pane label="已结算" name="second">
  37. <dilTable v-bind.sync="options2">
  38. </dilTable>
  39. </el-tab-pane>
  40. </el-tabs>
  41. </div>
  42. </div>
  43. </template>
  44. <script>
  45. import { getCookie } from "@/utils/util.js";
  46. import { sjTime } from '@/utils/sharedJsFile';
  47. export default {
  48. data(){
  49. return{
  50. startTime: null,
  51. endTime: null,
  52. totalNetWeight:null,
  53. totalMoney:null,
  54. //单价
  55. Fee:null,
  56. //加载
  57. selectLineLoading:false,
  58. input:"",
  59. activeName:"first",
  60. ssoId:null,
  61. //详单Id
  62. detailsId:null,
  63. options1:{
  64. // first请求数据的地址
  65. requestUrl: "",
  66. },
  67. options2:{
  68. // second请求数据的地址
  69. requestUrl: "",
  70. },
  71. //是否打开修改详单地址弹出框
  72. dialogFormVisible:false,
  73. //原详单单价
  74. originalPriceValue:null,
  75. //新详单单价
  76. newPriceValue:null,
  77. //原详单地址
  78. originalAddress:null,
  79. //新详单地址
  80. newAddress:null,
  81. //新单价Id
  82. priceId:null,
  83. //是否打开运输单价的模态框
  84. addressDrawer:false,
  85. //运输单价的表格
  86. Address: {
  87. requestUrl: "/api/v1/ams/getAddressDeliveryAddress?apiId=255",
  88. selectionType: "radio",
  89. },
  90. // addressText:null,
  91. //缓存当前选中的运输单价
  92. priceMap:{},
  93. formLabelWidth: '125px'
  94. }
  95. },
  96. created(){
  97. this.options1GetRequestUrl();
  98. this.options2GetRequestUrl();
  99. },
  100. methods:{
  101. func(res){
  102. console.log(res.list);
  103. var totalWeight = 0;
  104. var totalAllMoney = 0;
  105. res.list.forEach(e => {
  106. totalWeight = totalWeight + e.netWeightSecond
  107. totalAllMoney = totalAllMoney + e.secondAmount
  108. });
  109. this.totalNetWeight = totalWeight.toFixed(2) + 't';
  110. this.totalMoney = totalAllMoney.toFixed(2) + '元'
  111. },
  112. //未结算数据
  113. options1GetRequestUrl(){
  114. if(getCookie("orgCode") == "chengyunshang"){
  115. this.ssoId=getCookie('userId');
  116. this.options1.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=462&orderType=10&detailStatus=0&carrierSsoId="+ getCookie('userId');
  117. }else if(getCookie("orgCode") == "dagangadmin"||getCookie("orgCode")=="zidonghuabu"||getCookie("orgCode")=="wuliuchuyunzhongxin"){
  118. this.options1.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=462&orderType=10&detailStatus=0"
  119. }else{
  120. this.options1.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=462&orderType=10&detailStatus=0&userId=" + getCookie("orgCode");
  121. }
  122. },
  123. //已结算数据
  124. options2GetRequestUrl(){
  125. if(getCookie("orgCode") == "chengyunshang"){
  126. this.ssoId=getCookie('userId');
  127. this.options2.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=462&orderType=10&detailStatus=1&carrierSsoId="+ getCookie('userId');
  128. }else if(getCookie("orgCode") == "dagangadmin"||getCookie("orgCode")=="zidonghuabu"||getCookie("orgCode")=="wuliuchuyunzhongxin"){
  129. this.options2.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=462&orderType=10&detailStatus=1"
  130. }else{
  131. this.options2.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=462&orderType=10&detailStatus=1&userId=" + getCookie("orgCode");
  132. }
  133. },
  134. toInsert() {
  135. this.$router.push("/insertCheckInventory");
  136. },
  137. onclick(){
  138. let startTime = null;
  139. let endTime = null;
  140. if(this.startTime){
  141. startTime = sjTime(this.startTime);
  142. }
  143. if(this.endTime){
  144. endTime = sjTime(this.endTime);
  145. }
  146. if(startTime && endTime){
  147. if(startTime < endTime){
  148. if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu"||getCookie("orgCode")=="wuliuchuyunzhongxin"){
  149. this.options1.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=462&orderType=10&detailStatus=0" + "&startTime=" + startTime + "&endTime=" + endTime + "&i" +new Date();
  150. this.options2.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=462&orderType=10&detailStatus=1" + "&startTime=" + startTime + "&endTime=" + endTime + "&i" +new Date();
  151. }else if(getCookie("orgCode") == "chengyunshang"){
  152. this.options1.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=462&orderType=10&detailStatus=0&carrierSsoId="+ getCookie('userId') + "&startTime=" + startTime + "&endTime=" + endTime + "&i" +new Date();
  153. this.options2.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=462&orderType=10&detailStatus=1&carrierSsoId="+ getCookie('userId') + "&startTime=" + startTime + "&endTime=" + endTime + "&i" +new Date();
  154. }else{
  155. this.options1.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=462&orderType=10&detailStatus=0&userId=" + getCookie("orgCode") + "&startTime=" + startTime + "&endTime=" + endTime + "&i" +new Date();
  156. this.options2.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=462&orderType=10&detailStatus=1&userId=" + getCookie("orgCode") + "&startTime=" + startTime + "&endTime=" + endTime + "&i" +new Date();
  157. }
  158. }else{
  159. this.startTime = null;
  160. this.endTime = null;
  161. this.$message.warning('开始时间要比结束时间早')
  162. }
  163. }else{
  164. }
  165. },
  166. //运输订单点击浏览的事件
  167. select(){
  168. this.addressDrawer = true;
  169. },
  170. //运输单价模态窗口的框计算
  171. selectAddressClick(){
  172. this.Price.requestUrl = '/api/v1/ams/getAddressDeliveryAddress?apiId=255&con='+this.addressText;
  173. },
  174. }
  175. }
  176. </script>
  177. <style lang="scss" scode>
  178. .steel_inbound{
  179. .sache{
  180. padding: 1.25rem 0.375rem;
  181. .el-input {
  182. width: 20%;
  183. margin-right: 1.25rem;
  184. }
  185. }
  186. }
  187. </style>