index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="query"
  5. ref="queryForm"
  6. v-show="showSearch"
  7. :inline="true"
  8. >
  9. <el-row>
  10. <el-form-item label="提单号" prop="fMblno">
  11. <el-input
  12. v-model="query.fMblno"
  13. placeholder="请输入提单号"
  14. clearable
  15. size="small"
  16. @change="fMblnoChange"
  17. />
  18. </el-form-item>
  19. <el-form-item label="货主" prop="fCorpid">
  20. <el-select
  21. v-model="query.fCorpid"
  22. filterable
  23. clearable
  24. remote
  25. style="width: 80%"
  26. :remote-method="corpsRemoteMethod"
  27. placeholder="请输入模糊查找"
  28. >
  29. <el-option
  30. v-for="(dict, index) in fMblnoOptions"
  31. :key="index.fId"
  32. :label="dict.fName"
  33. :value="dict.fId"
  34. ></el-option>
  35. </el-select>
  36. </el-form-item>
  37. <el-form-item label="日期" prop="bsdateList">
  38. <el-date-picker
  39. v-model="query.bsdateList"
  40. type="daterange"
  41. range-separator="至"
  42. start-placeholder="开始日期"
  43. value-format="yyyy-MM-dd HH:mm:ss"
  44. :default-time="['00:00:00', '23:59:59']"
  45. end-placeholder="结束日期"
  46. :picker-options="pickerOptions"
  47. unlink-panels>
  48. </el-date-picker>
  49. </el-form-item>
  50. </el-row>
  51. </el-form>
  52. <el-row :gutter="10" class="mb8">
  53. <el-col :span="1.5">
  54. <el-button
  55. type="primary"
  56. icon="el-icon-plus"
  57. size="mini"
  58. @click="getList"
  59. v-hasPermi="['warehouseBusiness:containerPort:add']"
  60. >查询
  61. </el-button>
  62. </el-col>
  63. <el-col :span="1.5">
  64. <el-button
  65. type="warning"
  66. icon="el-icon-download"
  67. size="mini"
  68. @click="exportOne"
  69. >导出
  70. </el-button>
  71. </el-col>
  72. <!-- <el-col :span="1.5">-->
  73. <!-- <el-button-->
  74. <!-- type="danger"-->
  75. <!-- icon="el-icon-delete"-->
  76. <!-- size="mini"-->
  77. <!-- :disabled="multiple"-->
  78. <!-- @click="handleDelete"-->
  79. <!-- v-hasPermi="['agreement:agreementTask:remove']"-->
  80. <!-- >删除-->
  81. <!-- </el-button>-->
  82. <!-- </el-col>-->
  83. <!-- <el-col :span="1.5">-->
  84. <!-- <el-button-->
  85. <!-- type="info"-->
  86. <!-- icon="el-icon-download"-->
  87. <!-- size="mini"-->
  88. <!-- :disabled="single"-->
  89. <!-- @click="handleUpdate(null, 2)"-->
  90. <!-- v-hasPermi="['agreement:agreementStorage:export']"-->
  91. <!-- >复制新增-->
  92. <!-- </el-button>-->
  93. <!-- </el-col>-->
  94. <right-toolbar
  95. :showSearch.sync="showSearch"
  96. @queryTable="getList"
  97. ></right-toolbar>
  98. </el-row>
  99. <el-form :inline="true" :model="formInline" class="demo-form-inline">
  100. <el-form-item label="提单号">
  101. <el-input v-model="query.fMblno" placeholder="提单号" disabled></el-input>
  102. </el-form-item>
  103. <el-form-item label="货主">
  104. <el-select
  105. v-model="query.fCorpid"
  106. filterable
  107. remote
  108. style="width: 80%"
  109. :remote-method="corpsRemoteMethod"
  110. placeholder="请输入模糊查找"
  111. disabled
  112. >
  113. <el-option
  114. v-for="(dict, index) in fMblnoOptions"
  115. :key="index.fId"
  116. :label="dict.fName"
  117. :value="dict.fId"
  118. ></el-option>
  119. </el-select>
  120. </el-form-item>
  121. <el-form-item label="品名">
  122. <el-input v-model="formInline.goodsName" placeholder="请输入品名" disabled></el-input>
  123. </el-form-item>
  124. </el-form>
  125. <el-table
  126. :data="tableData"
  127. style="width: 100%"
  128. ref="table1"
  129. :height="tableHeight1"
  130. >
  131. <el-table-column type="selection" width="60" align="center" />
  132. <el-table-column type="index" label="行号" align="center"/>
  133. <el-table-column prop="goodsName" label="品名" width="180" align="center"/>
  134. <el-table-column prop="fBusinessTypes" label="货物属性" width="180" align="center"/>
  135. <el-table-column prop="fMarks" label="属性详情" width="180" align="center"/>
  136. <el-table-column prop="fWName" label="库区" width="180" align="center"/>
  137. <el-table-column prop="fBusinessType" label="作业类型" width="180" align="center"/>
  138. <el-table-column prop="fCntval" label="箱型箱量" width="180" align="center"/>
  139. <el-table-column prop="inBsdate" label="入库日期" width="180" align="center"/>
  140. <el-table-column prop="inQty" label="入库件数" width="180" align="center"/>
  141. <el-table-column prop="inGrossweight" label="入库毛重" width="180" align="center"/>
  142. <el-table-column prop="outBsdate" label="出库日期" width="180" align="center"/>
  143. <el-table-column prop="outQty" label="出库件数" width="180" align="center"/>
  144. <el-table-column prop="outGrossweight" label="出库毛重" width="180" align="center"/>
  145. <el-table-column prop="fQtyblc" label="结余件数" width="180" align="center"/>
  146. <el-table-column prop="fGrossweightblc" label="结余毛重" width="180" align="center"/>
  147. <el-table-column prop="fBilltype" label="业务类型" width="180" align="center"/>
  148. <el-table-column prop="fTruckno" label="车号" width="180" align="center"/>
  149. <el-table-column prop="fBillingDays" label="堆存天数" width="180" align="center"/>
  150. <el-table-column prop="fAmt" label="出库堆存费" width="180" align="center"/>
  151. <el-table-column prop="remark" label="备注" width="180" align="center"/>
  152. </el-table>
  153. <h3>
  154. <i class="el-icon-coin"></i>费用明细
  155. <el-button
  156. type="warning"
  157. icon="el-icon-download"
  158. size="mini"
  159. @click="exportTwo"
  160. >导出
  161. </el-button>
  162. </h3>
  163. <el-table
  164. :data="costData"
  165. style="width: 100%"
  166. ref="table2"
  167. :height="tableHeight2"
  168. >
  169. <el-table-column type="selection" width="60" align="center" />
  170. <el-table-column type="index" label="行号" align="center"/>
  171. <el-table-column prop="createTime" label="日期" width="180" align="center"/>
  172. <el-table-column prop="fBusinessType" label="作业类型" width="180" align="center"/>
  173. <el-table-column prop="fFeeid" label="费用" width="180" align="center"/>
  174. <el-table-column prop="fDc" label="收/付" width="180" align="center"/>
  175. <el-table-column prop="fCName" label="结算单位" width="200" align="center"/>
  176. <el-table-column prop="fQty" label="数量" align="center"/>
  177. <el-table-column prop="fUnitprice" label="单价" align="center"/>
  178. <el-table-column prop="fAmount" label="金额" align="center"/>
  179. <el-table-column prop="remark" label="备注" align="center"/>
  180. </el-table>
  181. </div>
  182. </template>
  183. <script>
  184. import { listpayable , exportOne , exportTwo, getCorps} from '@/api/singleTicket'
  185. import {listCorps} from "@/api/basicdata/corps";
  186. export default {
  187. name: "index",
  188. data(){
  189. return{
  190. pickerOptions: {
  191. shortcuts: [{
  192. text: '最近一周',
  193. onClick(picker) {
  194. const end = new Date();
  195. const start = new Date();
  196. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  197. picker.$emit('pick', [start, end]);
  198. }
  199. }, {
  200. text: '最近一个月',
  201. onClick(picker) {
  202. const end = new Date();
  203. const start = new Date();
  204. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  205. picker.$emit('pick', [start, end]);
  206. }
  207. }, {
  208. text: '最近三个月',
  209. onClick(picker) {
  210. const end = new Date();
  211. const start = new Date();
  212. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  213. picker.$emit('pick', [start, end]);
  214. }
  215. }]
  216. },
  217. tableHeight1: '0',
  218. tableHeight2: '0',
  219. query:{},
  220. costData:[],
  221. formInline:{},
  222. tableData:[],
  223. showSearch: true,
  224. fMblnoOptions:[]
  225. }
  226. },
  227. created() {
  228. // let date = new Date();
  229. // let year = parseInt(date.getFullYear())
  230. // let month = parseInt(date.getMonth() + 1)
  231. // let currentMonth = date.getMonth()
  232. // let nextMonth = ++currentMonth
  233. // let nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1) // 下个月的第一天
  234. // let oneDay = 1000*60*60*24
  235. // let lastTime = new Date(nextMonthFirstDay - oneDay) // 下个月的第一天减去一天,就是上个月的最后一天
  236. // let day = lastTime.getDate()
  237. // if (day < 10) {
  238. // day = '0' + day
  239. // }
  240. // this.$set(this.query,'bsdateList', [year + '-' + month + '-' + '01 00:00:00', year + '-' + month + '-' + day + ' 23:59:59'])
  241. },
  242. mounted() {
  243. this.$nextTick(() => {
  244. // 根据浏览器高度设置初始高度
  245. this.tableHeight1 = (window.innerHeight - this.$refs.table1.$el.offsetTop - 160) / 2
  246. // 监听浏览器高度变化,改变表格高度
  247. window.onresize = () => {
  248. this.tableHeight1 = (window.innerHeight - this.$refs.table1.$el.offsetTop - 70) /2
  249. }
  250. });
  251. this.$nextTick(() => {
  252. // 根据浏览器高度设置初始高度
  253. this.tableHeight2 = (window.innerHeight - this.$refs.table1.$el.offsetTop - 160) / 2
  254. // 监听浏览器高度变化,改变表格高度
  255. window.onresize = () => {
  256. this.tableHeight2 = (window.innerHeight - this.$refs.table1.$el.offsetTop - 70) /2
  257. }
  258. })
  259. },
  260. methods:{
  261. getList(){
  262. listpayable(this.query).then(res=>{
  263. this.costData = res.data.feeList
  264. this.tableData = res.data.singleAnalysis
  265. for (let item in this.tableData){
  266. if (this.tableData[item].inQty == 0){
  267. this.tableData[item].inQty = ''
  268. }
  269. if (this.tableData[item].inGrossweight == 0){
  270. this.tableData[item].inGrossweight = ''
  271. }
  272. if (this.tableData[item].outGrossweight == 0){
  273. this.tableData[item].outGrossweight = ''
  274. }
  275. if (this.tableData[item].fQtyblc == 0){
  276. this.tableData[item].fQtyblc = ''
  277. }
  278. if (this.tableData[item].fGrossweightblc == 0){
  279. this.tableData[item].fGrossweightblc = ''
  280. }
  281. if (this.tableData[item].outQty == 0){
  282. this.tableData[item].outQty = ''
  283. }
  284. }
  285. this.formInline.goodsName = res.data.goodsName
  286. })
  287. },
  288. exportOne(){
  289. let query = this.query
  290. this.$confirm("是否确认导出", "警告", {
  291. confirmButtonText: "确定",
  292. cancelButtonText: "取消",
  293. type: "warning",
  294. }).then(function () {
  295. return exportOne(query);
  296. }).then((response) => {
  297. this.download(response.msg);
  298. });
  299. },
  300. exportTwo(){
  301. let query = this.query
  302. this.$confirm("是否确认导出", "警告", {
  303. confirmButtonText: "确定",
  304. cancelButtonText: "取消",
  305. type: "warning",
  306. }).then(function () {
  307. return exportTwo(query);
  308. }).then((response) => {
  309. this.download(response.msg);
  310. });
  311. },
  312. corpsRemoteMethod(name) {
  313. if (this.query.fMblno) return
  314. if (name == null || name === "") {
  315. return false;
  316. }
  317. let queryParams = { pageNum: 1, fName: name, type: 1 };
  318. listCorps(queryParams).then((response) => {
  319. this.fMblnoOptions = response.rows;
  320. });
  321. },
  322. resetQuery(){},
  323. // 提单号变化触发
  324. fMblnoChange() {
  325. this.$set(this.query, 'fCorpid', '')
  326. if (this.query.fMblno) {
  327. getCorps({fMblno: this.query.fMblno}).then(res => {
  328. this.fMblnoOptions = res.data;
  329. if (this.fMblnoOptions.length > 0) this.query.fCorpid = this.fMblnoOptions[0].fId
  330. })
  331. } else {
  332. listCorps({type: 1}).then((response) => {
  333. this.fMblnoOptions = response.rows;
  334. });
  335. }
  336. },
  337. }
  338. }
  339. </script>
  340. <style scoped>
  341. </style>