index.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. <template>
  2. <view class="query-wrap">
  3. <view class="title-cont">
  4. <view class="search-view">
  5. <uni-easyinput prefixIcon="search" :value="value" placeholder="请输入耗材名称" @input="input">
  6. </uni-easyinput>
  7. </view>
  8. <!-- <v-tabs v-model="index" :tabs="tabList" @change="changeTab" :scroll="false"></v-tabs> -->
  9. </view>
  10. <z-paging ref="paging" @query="queryList" v-model="dataList" :use-page-scroll="true">
  11. <view class="inner-item" v-for="(item,index) in dataList" :key="index" @click.stop="itemDetails(item)">
  12. <view class="item-stats">
  13. {{item.stas}}
  14. </view>
  15. <view class="inventory-item">
  16. <view class="shuo-item-name">
  17. <view class="shuo-label-podnme">
  18. {{item.prodName}}
  19. </view>
  20. <view class="shuo-unit">
  21. <span>{{ item.unt }} ({{ item.pacCnt
  22. }}{{ item.prcUnt }}/{{ item.unt }})</span>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="inventory-item">
  27. <view class="shuo-item">
  28. <view class="shuo-label">
  29. 规格:
  30. </view>
  31. <view class="shuo-cont">
  32. {{item.spec}}
  33. </view>
  34. </view>
  35. <view class="shuo-item">
  36. <view class="shuo-label">
  37. 型号:
  38. </view>
  39. <view class="shuo-cont">
  40. {{item.mol}}
  41. </view>
  42. </view>
  43. </view>
  44. <view class="inventory-item">
  45. <view class="shuo-item">
  46. <view class="shuo-label">
  47. 耗材类别:
  48. </view>
  49. <view class="shuo-cont-blue">
  50. <span v-if="item.mcsType == '0'"> 普通耗材 </span>
  51. <span v-if="item.mcsType == '1'"> 高值耗材 </span>
  52. <span v-if="item.mcsType == '2'"> 试剂 </span>
  53. <span v-if="item.mcsType == '3'"> 总务耗材 </span>
  54. </view>
  55. </view>
  56. <view class="shuo-item">
  57. <view class="shuo-label">
  58. 生产来源:
  59. </view>
  60. <view class="shuo-cont-blue">
  61. <span v-if="item.prodSouc == '1'" type="success"> 国产 </span>
  62. <span v-if="item.prodSouc == '2'" type="danger"> 进口 </span>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="inventory-item">
  67. <view class="shuo-item-name">
  68. <view class="shuo-label">
  69. 生产企业:
  70. </view>
  71. <view class="shuo-cont">
  72. {{item.prodEntp}}
  73. </view>
  74. </view>
  75. </view>
  76. <view class="inventory-item">
  77. <view class="shuo-item">
  78. <view class="shuo-label">
  79. 所在库房:
  80. </view>
  81. <view class="shuo-cont">
  82. {{stromName}}
  83. </view>
  84. </view>
  85. <view class="shuo-item">
  86. <view class="shuo-label">
  87. 所在货位:
  88. </view>
  89. <view class="shuo-cont">
  90. {{item.cgoLocName}}
  91. </view>
  92. </view>
  93. </view>
  94. <view class="inventory-item">
  95. <view class="shuo-item">
  96. <view class="shuo-label">
  97. 应在库:
  98. </view>
  99. <view class="shuo-label-green">
  100. {{item.invCnt}}
  101. </view>
  102. </view>
  103. <view class="shuo-item">
  104. <view class="shuo-label">
  105. 盘点数:
  106. </view>
  107. <view class="shuo-label-green" v-if="formData.type=='暗盘'">
  108. <view class="addInvent" @click.stop="adIenty(item,index)">
  109. {{item.intrCnt}}
  110. </view>
  111. </view>
  112. <view class="shuo-label-green" v-else>
  113. {{item.intrCnt}}
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. </z-paging>
  119. <uni-popup ref="popup">
  120. <uni-popup-dialog type="warn" :before-close="true" cancelText="取消" confirmText="确定" content="你确定结束盘点吗?"
  121. @confirm="dialogConfirm" @close="dialogClose"></uni-popup-dialog>
  122. </uni-popup>
  123. <uni-popup ref="addInvent" type="dialog">
  124. <uni-popup-dialog :before-close="true" cancelText="取消" confirmText="确定" @confirm="inventConfirm"
  125. @close="inventClose" title="增加盘点数">
  126. <uni-number-box v-model="innub" />
  127. </uni-popup-dialog>
  128. </uni-popup>
  129. <view class="botm-btn">
  130. <button type="default" plain="true" style="width:240rpx;line-height: 70rpx;background: #01A992;color:#fff"
  131. @click.stop="orderAcept()"> 结束盘点</button>
  132. </view>
  133. </view>
  134. </template>
  135. <script>
  136. import {
  137. mapState,
  138. mapMutations,
  139. mapActions
  140. } from 'vuex';
  141. import {
  142. debounce
  143. } from 'lodash';
  144. import moment from "moment";
  145. import ZPMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin.js';
  146. export default {
  147. mixins: [ZPMixin],
  148. data() {
  149. return {
  150. index: 0,
  151. value: "",
  152. dataList: [],
  153. changeVal: "",
  154. listData: [],
  155. stroomId: "",
  156. stromName: "",
  157. formData: {},
  158. itemData: {},
  159. innub: 0, //弹窗盘点数
  160. }
  161. },
  162. computed: {
  163. ...mapState(['inventData'])
  164. },
  165. onShow() {
  166. if (this.$refs.paging) {
  167. this.$refs.paging.reload();
  168. }
  169. let that = this;
  170. uni.getStorage({
  171. key: 'Inventorydetails',
  172. success: function(res) {
  173. that.formData = res.data;
  174. that.stroomId = res.data.stroomId;
  175. that.intrNo = res.data.intrNo;
  176. that.stromName = res.data.stroomName
  177. }
  178. });
  179. },
  180. mounted() {
  181. },
  182. methods: {
  183. ...mapActions(['getInvenDetailData']),
  184. ...mapMutations(['setInventData']),
  185. async queryList(pageNo, pageSize) {
  186. await this.getInvenDetailData({
  187. pam: {
  188. current: pageNo,
  189. size: pageSize,
  190. "stroomId": this.stroomId,
  191. "intrNo": this.intrNo,
  192. prodName: this.value
  193. },
  194. that: this
  195. });
  196. },
  197. //确认结束盘点
  198. dialogConfirm() {
  199. this.brightFinsh();
  200. },
  201. //盘点提交
  202. brightFinsh() {
  203. this.$http('inventory.brightFinish', {
  204. intrNo: this.intrNo,
  205. }, '加载中', true).then((res) => {
  206. if (res.success == true) {
  207. this.$refs.popup.close();
  208. uni.redirectTo({
  209. url: '/pages/Inventory/index',
  210. success: function(res) {
  211. console.log(res, "res")
  212. }
  213. });
  214. } else {
  215. this.$refs.popup.close();
  216. }
  217. })
  218. },
  219. //日期格式化
  220. forMatTime(time) {
  221. return moment(time).format("YYYY-MM-DD");
  222. },
  223. //明盘盘点数增加弹窗
  224. adIenty(int, index) {
  225. this.index = index;
  226. this.innub = int.intrCnt ? int.intrCnt : 0;
  227. this.itemData = int;
  228. this.$refs.addInvent.open();
  229. },
  230. //盘点提交按钮
  231. orderAcept(type) {
  232. this.$refs.popup.open();
  233. },
  234. dialogClose() {
  235. this.$refs.popup.close();
  236. },
  237. inventClose() {
  238. this.$refs.addInvent.close();
  239. },
  240. //明盘盘点数点击确认
  241. inventConfirm() {
  242. this.$http('inventory.subMitDarkData', {
  243. intrNo: this.intrNo,
  244. prodCode: this.itemData.prodCode,
  245. unt: this.itemData.unt,
  246. pacCnt: this.itemData.pacCnt,
  247. intrCnt: this.innub,
  248. invCnt: this.itemData.invCnt
  249. }, '加载中', true).then((res) => {
  250. if (res.success == true) {
  251. this.$refs.addInvent.close();
  252. this.dataList[this.index].intrCnt= this.innub;
  253. console.log(this.dataList,'3232323');
  254. // this.$refs.paging.reload();
  255. } else {
  256. this.$refs.addInvent.close();
  257. }
  258. })
  259. },
  260. //跳转配送详情
  261. itemDetails(item) {
  262. if (this.formData.type == '暗盘') {
  263. return;
  264. }
  265. this.setInventData(this.dataList);
  266. uni.setStorage({
  267. key: 'darkintdetail',
  268. data: {
  269. ...item,
  270. intrNo: this.intrNo,
  271. stroomId: this.stroomId,
  272. }
  273. });
  274. uni.navigateTo({
  275. url: '/pages/inventbright/index',
  276. success: function(res) {
  277. }
  278. });
  279. console.log(item,this.intrNo,this.stroomId,'盘点')
  280. },
  281. input: debounce(function(e) {
  282. this.value = e;
  283. this.getInvenDetailData({
  284. pam: {
  285. prodName: this.value,
  286. "stroomId": this.stroomId,
  287. "intrNo": this.intrNo,
  288. },
  289. that: this
  290. });
  291. }, 500),
  292. changeTab(index) {
  293. this.index = index;
  294. this.$refs.paging.reload();
  295. },
  296. },
  297. watch: {
  298. }
  299. }
  300. </script>
  301. <style lang="scss" scoped>
  302. .query-wrap {
  303. width: 100%;
  304. padding: 20rpx;
  305. box-sizing: border-box;
  306. background-color: #F1F1F1;
  307. overflow-x: hidden;
  308. padding-bottom: 200rpx;
  309. .botm-btn {
  310. width: 100%;
  311. height: 120rpx;
  312. background-color: #fff;
  313. position: fixed;
  314. left: 0;
  315. bottom: 0;
  316. padding-top: 40rpx;
  317. z-index: 22;
  318. }
  319. .time-view {
  320. height: 350rpx;
  321. background-color: #fff;
  322. padding: 50rpx 50rpx 0 50rpx;
  323. box-sizing: border-box;
  324. .btn-view {
  325. width: 100%;
  326. height: 100rpx;
  327. margin-top: 100rpx;
  328. display: flex;
  329. justify-content: space-around;
  330. }
  331. }
  332. .title-cont {
  333. padding-top: 10rpx;
  334. width: 100%;
  335. background-color: #fff;
  336. .search-view {
  337. width: 100%;
  338. height: 100rpx;
  339. display: flex;
  340. align-items: center;
  341. padding: 0rpx 20rpx 0rpx 20rpx;
  342. box-sizing: border-box;
  343. .filter-text {
  344. width: 72rpx;
  345. height: 50rpx;
  346. line-height: 50rpx;
  347. color: rgba(1, 169, 146, 1);
  348. font-size: 36rpx;
  349. font-family: PingFangSC-bold;
  350. padding-left: 20rpx;
  351. }
  352. }
  353. }
  354. }
  355. uni-page-body {
  356. width: 100%;
  357. height: 100%;
  358. background-color: #F1F1F1;
  359. }
  360. </style>