index.vue 8.8 KB

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