index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. <template>
  2. <view class="query-wrap">
  3. <view class="inner-item">
  4. <view class="inventory-item">
  5. <view class="shuo-item-name">
  6. <view class="shuo-label-podnme">
  7. {{refusaData.data.prodName||"" }}
  8. </view>
  9. <view class="shuo-unit">
  10. <span>{{ refusaData.data.purcUnt }} ({{ refusaData.data.convrat
  11. }}{{refusaData.data.prcUnt}}/{{ refusaData.data.purcUnt }})</span>
  12. <span>【{{refusaData.data.purcPric }}元/{{refusaData.data.prcUnt}}】</span>
  13. </view>
  14. </view>
  15. </view>
  16. <view class="inventory-item" v-if="acceptDetaData.purcType == 'B'">
  17. <view class="shuo-item-name">
  18. <view class="shuo-label">
  19. UDI码:
  20. </view>
  21. <view class="shuo-unit" @click.stop="queryUni(refusaData.data)">
  22. {{refusaData.data.udi}} (查看UDI)
  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. {{refusaData.data.cnt}}
  33. </view>
  34. </view>
  35. <view class="shuo-item">
  36. <view class="shuo-label">
  37. 采购总金额:
  38. </view>
  39. <view class="shuo-cont">
  40. {{refusaData.data.ordAmt}}
  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">
  50. {{refusaData.data.shppCnt}}
  51. </view>
  52. </view>
  53. <view class="shuo-item">
  54. <view class="shuo-label">
  55. 验收总金额:
  56. </view>
  57. <view class="shuo-cont">
  58. {{shppAmtNub(refusaData.data)}}
  59. </view>
  60. </view>
  61. </view>
  62. <view class="inventory-item">
  63. <view class="shuo-item">
  64. <view class="shuo-label">
  65. 拒收数量:
  66. </view>
  67. <view class="shuo-cont">
  68. {{refusaData.data.retCnt||0}}
  69. </view>
  70. </view>
  71. <view class="shuo-item">
  72. <view class="shuo-label">
  73. 拒收总金额:
  74. </view>
  75. <view class="shuo-cont">
  76. {{rejAmtNub(refusaData.data)}}
  77. </view>
  78. </view>
  79. </view>
  80. <view class="inventory-item">
  81. <view class="shuo-item-tcl">
  82. <view class="shuo-label">
  83. 拒收原因:
  84. </view>
  85. <view class="shuo-break">
  86. {{refusaData.data.rejRea}}
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. <view class="inner-item">
  92. <view class="text-title">
  93. <view class="title-circ">
  94. </view>
  95. <span>耗材信息</span>
  96. </view>
  97. <view class="inventory-item">
  98. <view class="shuo-item-name">
  99. <view class="shuo-label">
  100. 规格:
  101. </view>
  102. <view class="shuo-cont">
  103. {{refusaData.data.spec}}
  104. </view>
  105. </view>
  106. </view>
  107. <view class="inventory-item">
  108. <view class="shuo-item-name">
  109. <view class="shuo-label">
  110. 型号:
  111. </view>
  112. <view class="shuo-cont">
  113. {{refusaData.data.mol}}
  114. </view>
  115. </view>
  116. </view>
  117. <view class="inventory-item">
  118. <view class="shuo-item-name">
  119. <view class="shuo-label">
  120. 生产批次:
  121. </view>
  122. <view class="shuo-cont">
  123. {{refusaData.data.lotNum}}
  124. </view>
  125. </view>
  126. </view>
  127. <view class="inventory-item">
  128. <view class="shuo-item-name">
  129. <view class="shuo-label">
  130. 生产日期:
  131. </view>
  132. <view class="shuo-cont">
  133. {{refusaData.data.manuDate?forMatTime(refusaData.data.manuDate):""}}
  134. </view>
  135. </view>
  136. </view>
  137. <view class="inventory-item">
  138. <view class="shuo-item-name">
  139. <view class="shuo-label">
  140. 有效期至:
  141. </view>
  142. <view class="shuo-cont">
  143. {{refusaData.data.prodExpy?forMatTime(refusaData.data.prodExpy):""}}
  144. </view>
  145. </view>
  146. </view>
  147. <view class="inventory-item">
  148. <view class="shuo-item-name">
  149. <view class="shuo-label">
  150. 注册证号:
  151. </view>
  152. <view class="shuo-cont">
  153. {{refusaData.data.regcertno}}
  154. </view>
  155. </view>
  156. </view>
  157. <view class="inventory-item">
  158. <view class="shuo-item-name">
  159. <view class="shuo-label">
  160. 耗材类别:
  161. </view>
  162. <view class="shuo-cont">
  163. <span v-if="refusaData.data.mcsType == '0'"> 普通耗材 </span>
  164. <span v-if="refusaData.data.mcsType == '1'"> 高值耗材 </span>
  165. <span v-if="refusaData.data.mcsType == '2'"> 试剂 </span>
  166. <span v-if="refusaData.data.mcsType == '3'"> 总务耗材 </span>
  167. </view>
  168. </view>
  169. </view>
  170. <view class="inventory-item">
  171. <view class="shuo-item">
  172. <view class="shuo-label">
  173. 生产来源:
  174. </view>
  175. <view class="shuo-cont">
  176. <span v-if="refusaData.data.prodSouc == '1'" type="success"> 国产 </span>
  177. <span v-if="refusaData.data.prodSouc == '2'" type="danger"> 进口 </span>
  178. </view>
  179. </view>
  180. </view>
  181. <view class="inventory-item">
  182. <view class="shuo-item-name">
  183. <view class="shuo-label">
  184. 生产企业:
  185. </view>
  186. <view class="shuo-cont">
  187. {{refusaData.data.prodEntp}}
  188. </view>
  189. </view>
  190. </view>
  191. <view class="inventory-item">
  192. <view class="shuo-item-name">
  193. <view class="shuo-label">
  194. 报关单:
  195. </view>
  196. <view class="shuo-cont" @click="queryFiled(refusaData.data.invoFileId)"
  197. v-if="refusaData.data.invoFileId">
  198. 查看报关单
  199. <!-- {{refusaData.data.invoFileId}} -->
  200. </view>
  201. </view>
  202. </view>
  203. <view class="inventory-item">
  204. <view class="shuo-item-name">
  205. <view class="shuo-label">
  206. 是否集采:
  207. </view>
  208. <view class="shuo-cont">
  209. {{ refusaData.data.isFas == "0" ? "否" : "是" }}
  210. </view>
  211. </view>
  212. </view>
  213. <view class="inventory-item">
  214. <view class="shuo-item-name">
  215. <view class="shuo-label">
  216. 集采批次:
  217. </view>
  218. <view class="shuo-cont">
  219. {{ refusaData.data.fasBtch}}
  220. </view>
  221. </view>
  222. </view>
  223. <view class="inventory-item">
  224. <view class="shuo-item-name">
  225. <view class="shuo-label">
  226. 一物一码:
  227. </view>
  228. <view class="shuo-cont">
  229. {{ refusaData.data.isBarc == "0" ? "否" : " 是" }}
  230. </view>
  231. </view>
  232. </view>
  233. </view>
  234. <uni-popup ref="popup">
  235. <uni-popup-dialog type="info" :before-close="true" cancelText="取消" confirmText="确定" @confirm="dialogConfirm"
  236. @close="dialogClose" title="拒收">
  237. <uni-forms ref="valiForm" :rules="rules" :modelValue="valiFormData">
  238. <uni-forms-item label="拒收数量" name="retCnt" style="width:500rpx">
  239. <uni-easyinput type="number" placeholder="请输入拒收数量" v-model="valiFormData.retCnt" />
  240. </uni-forms-item>
  241. <uni-forms-item label="拒收原因" name="rejRea" style="width:500rpx">
  242. <uni-easyinput placeholder="请输入拒收原因" v-model="valiFormData.rejRea" />
  243. </uni-forms-item>
  244. </uni-forms>
  245. </uni-popup-dialog>
  246. </uni-popup>
  247. <view class="botm-btn" v-if="acceptDetaData.stas=='B'">
  248. <button type="default" plain="true" style="width:200rpx;line-height: 70rpx;background: #BD3124;color:#fff"
  249. @click.stop="orderEefusa()">拒收</button>
  250. </view>
  251. </view>
  252. </template>
  253. <script>
  254. import {
  255. mapState,
  256. mapMutations,
  257. mapActions
  258. } from 'vuex';
  259. import moment from "moment";
  260. import {
  261. pathToBase64,
  262. base64ToPath
  263. } from 'image-tools'
  264. export default {
  265. data() {
  266. return {
  267. valiFormData: {
  268. retCnt: '',
  269. rejRea: ""
  270. },
  271. baseImg: "",
  272. acceptDetaData: {},
  273. rules: {
  274. rejRea: {
  275. rules: [{
  276. required: true,
  277. errorMessage: ' 拒收原因不能为空'
  278. }]
  279. },
  280. retCnt: {
  281. rules: [{
  282. required: true,
  283. errorMessage: ' 拒收数量不能为空'
  284. }]
  285. }
  286. },
  287. }
  288. },
  289. computed: {
  290. ...mapState(['refusaData', 'acceptDetail'])
  291. },
  292. onShow() {
  293. let that = this;
  294. that.$forceUpdate();
  295. uni.getStorage({
  296. key: 'accept-storage-details',
  297. success: function(res) {
  298. that.acceptDetaData = res.data;
  299. }
  300. });
  301. },
  302. mounted() {
  303. },
  304. methods: {
  305. ...mapActions(['getUDIData']),
  306. ...mapMutations(['setRefusaData', 'setAcceptDetail']),
  307. //查看报关单
  308. queryFiled(id) {
  309. uni.showLoading({
  310. title: "加载中..."
  311. })
  312. this.$http('acceptance.queryFileID', {
  313. id: id,
  314. }, '加载中', true).then((res) => {
  315. if (res.success == true) {
  316. base64ToPath(res.data.fileContent).then((path) => {
  317. uni.openDocument({
  318. filePath: path,
  319. success: function(res) {
  320. console.log('打开文档成功');
  321. },
  322. fail: (res) => {
  323. console.log("打开失败", res);
  324. },
  325. });
  326. })
  327. }
  328. })
  329. },
  330. //查看UNI码
  331. queryUni(data) {
  332. this.getUDIData({
  333. current: 1,
  334. lotNum: data.lotNum,
  335. prodCode: data.prodCode,
  336. size: 10000,
  337. stooutId: this.acceptDetaData.stooutId,
  338. })
  339. uni.navigateTo({
  340. url: '/pages/udiview/index',
  341. success: function(res) {
  342. }
  343. });
  344. },
  345. //拒收总金额
  346. rejAmtNub(row) {
  347. let reCt = row.retCnt || 0;
  348. row.rejAmt =
  349. Number(reCt) * Number(row.purcPric) * Number(row.convrat);
  350. return parseFloat(row.rejAmt.toFixed(4));
  351. },
  352. //验收总金额
  353. shppAmtNub(row) {
  354. row.shppAmt =
  355. Number(row.shppCnt) * Number(row.purcPric) * Number(row.convrat);
  356. return parseFloat(row.shppAmt.toFixed(4));
  357. },
  358. //确定拒收
  359. dialogConfirm() {
  360. this.$refs['valiForm'].validate().then(res => {
  361. if (Number(this.valiFormData.retCnt) > Number(this.refusaData.data.stooutCnt)) {
  362. uni.showToast({
  363. title: '拒收数量不能大于到货数量',
  364. icon: 'none'
  365. });
  366. return;
  367. }
  368. if (Number(this.valiFormData.retCnt) == '0') {
  369. uni.showToast({
  370. title: '拒收数量不能为0',
  371. icon: 'none'
  372. });
  373. return;
  374. }
  375. //获取新的验收数量=到货数量减去拒收数量
  376. let newAcept = Number(this.refusaData.data.stooutCnt) - Number(this.valiFormData.retCnt);
  377. let newData = {
  378. ...this.refusaData.data,
  379. shppCnt: newAcept,
  380. rejRea: this.valiFormData.rejRea,
  381. retCnt: this.valiFormData.retCnt
  382. };
  383. let newAcceptDetal = this.acceptDetail;
  384. newAcceptDetal[this.refusaData.index] = newData;
  385. this.setRefusaData({
  386. index: this.refusaData.index,
  387. data: newData
  388. })
  389. this.setAcceptDetail(newAcceptDetal);
  390. this.$refs.popup.close();
  391. uni.navigateBack();
  392. }).catch(err => {
  393. console.log('err', err);
  394. })
  395. },
  396. //验收按钮触发
  397. orderEefusa() {
  398. this.$refs.popup.open('center');
  399. },
  400. dialogClose() {
  401. this.$refs.popup.close();
  402. },
  403. //日期格式化
  404. forMatTime(time) {
  405. return moment(time).format("YYYY-MM-DD");
  406. },
  407. //跳转上架详情
  408. itemDetails(item) {
  409. this.setMentItemData([item]);
  410. uni.navigateTo({
  411. url: '/pages/groundetials/groundetials',
  412. success: function(res) {
  413. console.log(res, "res")
  414. }
  415. });
  416. },
  417. },
  418. watch: {
  419. }
  420. }
  421. </script>
  422. <style lang="scss" scoped>
  423. .query-wrap {
  424. width: 100%;
  425. height: 100%;
  426. padding: 20rpx;
  427. box-sizing: border-box;
  428. background-color: #F1F1F1;
  429. overflow-y: scroll;
  430. overflow-x: hidden;
  431. position: relative;
  432. padding-bottom: 200rpx;
  433. .baseImage {
  434. width: 300rpx;
  435. height: 300rpx;
  436. }
  437. .uni-input {
  438. border: 1px solid #E5E4E5;
  439. border-radius: 30rpx;
  440. height: 100%;
  441. opacity: 1;
  442. color: #9D9D9D;
  443. padding-left: 20rpx;
  444. font: inherit;
  445. font-size: 25rpx;
  446. line-height: inherit;
  447. letter-spacing: inherit;
  448. text-align: inherit;
  449. text-indent: inherit;
  450. text-transform: inherit;
  451. text-shadow: inherit;
  452. }
  453. .botm-btn {
  454. width: 100%;
  455. height: 120rpx;
  456. background-color: #fff;
  457. position: fixed;
  458. left: 0;
  459. bottom: 0;
  460. padding-top: 40rpx;
  461. }
  462. .time-view {
  463. height: 350rpx;
  464. background-color: #fff;
  465. padding: 50rpx 50rpx 0 50rpx;
  466. box-sizing: border-box;
  467. .btn-view {
  468. width: 100%;
  469. height: 100rpx;
  470. margin-top: 100rpx;
  471. display: flex;
  472. justify-content: space-around;
  473. }
  474. }
  475. }
  476. uni-page-body {
  477. width: 100%;
  478. height: 100%;
  479. }
  480. </style>