historyRecord.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <!-- 历史记录 -->
  2. <template>
  3. <view id="gasCylinderHistoryRecord">
  4. <view class="top-input-max-box">
  5. <view class="input-box">
  6. <uni-icons type="search" class="icon-box" color="#7C7C7C" size="25"></uni-icons>
  7. <input class="uni-input input-min" confirm-type="search" @confirm="getList()"
  8. v-model="inputData" maxlength="20" placeholder="搜索气瓶" />
  9. <view class="button-p" @click="resetButton()">重置</view>
  10. </view>
  11. <view class="picker-box">
  12. <picker @change="bindPickerChangeA" :value="indexA" :range="arrayA">
  13. <view class="picker-min-box">
  14. <view>{{indexA==null?'状态':arrayA[indexA]}}</view>
  15. <uni-icons type="down" class="icon-box" size="15"></uni-icons>
  16. </view>
  17. </picker>
  18. <picker @change="bindPickerChangeB" :value="indexB" :range="arrayB">
  19. <view class="picker-min-box">
  20. <view>{{indexB==null?'气体':arrayB[indexB]}}</view>
  21. <uni-icons type="down" class="icon-box" size="15"></uni-icons>
  22. </view>
  23. </picker>
  24. </view>
  25. </view>
  26. <scroll-view scroll-y @scrolltolower="scrollGet" class="content-box">
  27. <view class="null-p" v-if="!dataList[0]">暂无数据</view>
  28. <view class="for-max-big-box" @click="checkButton(item)"
  29. v-for="(item,index) in dataList" :key="index">
  30. <view class="for-title-box" v-if="item.specialGases">
  31. <view>气瓶编码:{{item.bottleCode}}</view>
  32. <view :class="item.state==1?'colorA':(item.state==2?'colorB':'')">{{item.state==0?'待入库':(item.state==1?'已入库':'已出库')}}</view>
  33. </view>
  34. <view class="for-title-box" v-if="!item.specialGases">
  35. <view>气体:{{item.gasName}}</view>
  36. <view :class="item.state==1?'colorA':(item.state==2?'colorB':'')">{{item.state==0?'待入库':(item.state==1?'已入库':'已出库')}}</view>
  37. </view>
  38. <view class="for-text-box" v-if="item.specialGases">
  39. <view>气体:</view>
  40. <view>{{item.gasName}}</view>
  41. </view>
  42. <view class="for-text-box">
  43. <view>纯度:</view>
  44. <view>{{item.purity}}</view>
  45. </view>
  46. <view class="for-text-box">
  47. <view>实验室名称:</view>
  48. <view>{{item.subName}}</view>
  49. </view>
  50. <view class="for-text-box">
  51. <view>{{item.recordType ==1 ?'入库时间':'出库时间'}}:</view>
  52. <view>{{item.storageTime}}</view>
  53. </view>
  54. <view class="for-text-box">
  55. <view>{{item.recordType ==1 ?'入库人':'出库人'}}:</view>
  56. <view>{{item.operator}}</view>
  57. </view>
  58. </view>
  59. </scroll-view>
  60. </view>
  61. </template>
  62. <script>
  63. import {
  64. parseTime
  65. } from '@/component/public.js'
  66. import {
  67. airBottleNewQpAppletBottleHistoryPage,airBottleNewQpDictList,
  68. } from '@/pages_supplierCylinderManagement/api/index.js'
  69. export default {
  70. data() {
  71. return {
  72. inputData:'',
  73. arrayA:['已入库','已出库'],
  74. indexA:0,
  75. arrayB:[],
  76. indexB:null,
  77. dataList:[],
  78. // 查询参数
  79. getDataType: false,
  80. queryParams: {
  81. page: 1,
  82. pageSize: 10,
  83. },
  84. total:0,
  85. }
  86. },
  87. onLoad(option) {
  88. },
  89. onShow() {
  90. this.airBottleNewQpDictList1();
  91. this.getList();
  92. },
  93. methods: {
  94. bindPickerChangeA(e) {
  95. this.indexA = e.detail.value
  96. this.$set(this.queryParams,'page',1);
  97. this.getList();
  98. },
  99. bindPickerChangeB(e) {
  100. this.indexB = e.detail.value
  101. this.$set(this.queryParams,'page',1);
  102. this.getList();
  103. },
  104. //滚动加载事件
  105. scrollGet() {
  106. let self = this;
  107. if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
  108. this.$set(this, 'getDataType', true);
  109. } else {
  110. this.queryParams.page += 1;
  111. this.$nextTick(() => {
  112. this.getList();
  113. })
  114. }
  115. },
  116. //搜索
  117. async getList() {
  118. let self = this;
  119. let obj = {
  120. page:this.queryParams.page,
  121. pageSize:this.queryParams.pageSize,
  122. searchValue:this.inputData,
  123. state:this.indexA==null?'':(this.indexA==0?1:(this.indexA==1?2:0)),
  124. gasName:this.indexB==null?'':this.arrayB[this.indexB],
  125. };
  126. const {
  127. data
  128. } = await airBottleNewQpAppletBottleHistoryPage(obj);
  129. if (data.code == 200) {
  130. for(let i=0;i<data.data.records.length;i++){
  131. data.data.records[i].storageTime = parseTime(data.data.records[i].storageTime, "{y}-{m}-{d} {h}:{i}");
  132. }
  133. if(self.queryParams.page == 1){
  134. this.dataList = data.data.records;
  135. this.total = data.data.total;
  136. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  137. this.$set(this, 'getDataType', true);
  138. }
  139. }else{
  140. this.dataList = [...this.dataList, ...data.data.records]
  141. this.total = data.data.total;
  142. if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
  143. this.$set(this, 'getDataType', true);
  144. }
  145. }
  146. }
  147. },
  148. async airBottleNewQpDictList1() {
  149. const {
  150. data
  151. } = await airBottleNewQpDictList({"typeCode":'gas'});
  152. if (data.code == 200) {
  153. let list = [];
  154. for(let i=0;i<data.data.length;i++){
  155. list.push(data.data[i].name);
  156. }
  157. this.$set(this,'arrayB',list);
  158. }
  159. },
  160. //重置
  161. resetButton(){
  162. this.$set(this,'inputData','');
  163. this.$set(this,'indexA',0);
  164. this.$set(this,'indexB',null);
  165. this.$set(this,'dataList',[]);
  166. this.$set(this,'getDataType',false);
  167. this.$set(this,'queryParams',{
  168. page: 1,
  169. pageSize: 10,
  170. });
  171. this.$set(this,'total',0);
  172. this.getList();
  173. },
  174. //跳转详情
  175. checkButton(item){
  176. uni.navigateTo({
  177. url: "/pages_supplierCylinderManagement/views/gasCylinderManagement/cylinderDetails?id="+item.id,
  178. });
  179. },
  180. }
  181. }
  182. </script>
  183. <style lang="stylus" scoped>
  184. #gasCylinderHistoryRecord {
  185. height: 100%;
  186. width: 100%;
  187. display flex ;
  188. flex-direction column;
  189. overflow: hidden;
  190. .top-input-max-box{
  191. background-color: #fff;
  192. .input-box{
  193. display: flex;
  194. border-radius:40rpx;
  195. background-color: #eeeeee;
  196. margin:20rpx 20rpx 0 20rpx;
  197. color:#7C7C7C;
  198. .icon-box{
  199. margin:15rpx;
  200. }
  201. .input-min{
  202. height:80rpx;
  203. line-height:80rpx;
  204. flex:1;
  205. }
  206. .button-p{
  207. line-height:80rpx;
  208. width:120rpx;
  209. text-align: center;
  210. color:#333;
  211. font-size:28rpx;
  212. background-color: #D4D4D4;
  213. border-top-right-radius:40rpx;
  214. border-bottom-right-radius:40rpx;
  215. }
  216. }
  217. .picker-box{
  218. display: flex;
  219. .picker-min-box{
  220. height:80rpx;
  221. line-height:80rpx;
  222. display: flex;
  223. padding:0 30rpx;
  224. .icon-box{
  225. margin-left:10rpx;
  226. }
  227. }
  228. }
  229. }
  230. .content-box{
  231. flex:1;
  232. display flex ;
  233. flex-direction column;
  234. overflow: scroll;
  235. padding-bottom:40rpx;
  236. .null-p{
  237. text-align: center;
  238. line-height:300rpx;
  239. color:#999;
  240. }
  241. .for-max-big-box{
  242. padding:20rpx 30rpx;
  243. background-color: #fff;
  244. border-radius:10rpx;
  245. margin:25rpx 25rpx 0;
  246. .for-title-box{
  247. display: flex;
  248. margin-bottom:20rpx;
  249. view{
  250. padding-bottom:20rpx;
  251. line-height: 60rpx;
  252. border-bottom:1rpx solid #dedede;
  253. font-weight:700;
  254. }
  255. view:nth-child(1){
  256. }
  257. view:nth-child(2){
  258. flex:1;
  259. text-align: right;
  260. }
  261. .colorA{
  262. color:#FF6B00;
  263. }
  264. .colorB{
  265. color:#0075FF;
  266. }
  267. }
  268. .for-text-box{
  269. display: flex;
  270. view{
  271. line-height: 60rpx
  272. }
  273. view:nth-child(1){
  274. }
  275. view:nth-child(2){
  276. flex:1;
  277. text-align: right;
  278. }
  279. }
  280. }
  281. }
  282. }
  283. </style>