details.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. <template>
  2. <view class="query-wrap">
  3. <view class="inner-item">
  4. <view class="text-title">
  5. <view class="title-circ">
  6. </view>
  7. <span>基本信息</span>
  8. </view>
  9. <view class="inventory-item">
  10. <view class="shuo-item-name">
  11. <view class="shuo-label-podnme">
  12. 订单号:
  13. </view>
  14. <view class="shuo-unit">
  15. {{acceptDetaData.id}}
  16. </view>
  17. </view>
  18. </view>
  19. <view class="inventory-item">
  20. <view class="shuo-item">
  21. <view class="shuo-label">
  22. 订单品种数
  23. </view>
  24. <view class="shuo-cont">
  25. {{acceptDetaData.detlCnt||""}}
  26. </view>
  27. </view>
  28. <view class="shuo-item">
  29. <view class="shuo-label">
  30. 订单总数量
  31. </view>
  32. <view class="shuo-cont">
  33. {{acceptDetaData.qtySum||""}}
  34. </view>
  35. </view>
  36. </view>
  37. <view class="inventory-item">
  38. <view class="shuo-item">
  39. <view class="shuo-label">
  40. 订单总金额:
  41. </view>
  42. <view class="shuo-cont">
  43. {{acceptDetaData.purcAmt||""}}
  44. </view>
  45. </view>
  46. <view class="shuo-item">
  47. <view class="shuo-label">
  48. 剩余出库量:
  49. </view>
  50. <view class="shuo-cont">
  51. {{acceptDetaData.delvCnt||""}}
  52. </view>
  53. </view>
  54. </view>
  55. <view class="inventory-item">
  56. <view class="shuo-item-name">
  57. <view class="shuo-label">
  58. 来源机构:
  59. </view>
  60. <view class="shuo-cont">
  61. {{acceptDetaData.branchName}}
  62. </view>
  63. </view>
  64. </view>
  65. <view class="inventory-item">
  66. <view class="shuo-item-name">
  67. <view class="shuo-label">
  68. 采购类型:
  69. </view>
  70. <view class="shuo-cont">
  71. <span v-if="acceptDetaData.purcType == '2'">{{ item.oprn }}</span>
  72. <span v-if="acceptDetaData.purcType == '1'">普通采购</span>
  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. {{forMatTime(acceptDetaData.docmkDate)}}
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. <view class="empty-cont" v-if="orderDelData.length=='0'">
  88. 暂无明细数据
  89. </view>
  90. <view class="inner-item" v-for="(item,idex) in orderDelData" :key="idex" @click.stop="itemDetails(item,idex)">
  91. <view class="text-title" v-if="idex=='0'">
  92. <view class="title-circ">
  93. </view>
  94. <span>耗材清单</span>
  95. </view>
  96. <view class="check-title" @tap.stop.prevent>
  97. <checkbox-group @change="checkChange" :data-id="item.id">
  98. <label>
  99. <checkbox :value="idex" />
  100. </label>
  101. </checkbox-group>
  102. </view>
  103. <view class="inventory-item">
  104. <view class="shuo-item-name">
  105. <view class="shuo-label-podnme">
  106. 耗材编码
  107. </view>
  108. <view class="shuo-unit">
  109. {{item.prodCode}}
  110. </view>
  111. </view>
  112. </view>
  113. <view class="inventory-item">
  114. <view class="shuo-item-name">
  115. <view class="shuo-label-podnme">
  116. 医保编码
  117. </view>
  118. <view class="shuo-unit">
  119. {{item.hiCode}}
  120. </view>
  121. </view>
  122. </view>
  123. <view class="inventory-item">
  124. <view class="shuo-item-name">
  125. <view class="shuo-label-podnme">
  126. {{item.prodName}}
  127. </view>
  128. <view class="shuo-unit">
  129. <span>{{ item.purcUnt }} ({{ item.convrat }}{{ item.prcUnt }}/{{
  130. item.purcUnt
  131. }})</span>
  132. </view>
  133. </view>
  134. </view>
  135. <view class="inventory-item">
  136. <view class="shuo-item">
  137. <view class="shuo-label">
  138. 规格:
  139. </view>
  140. <view class="shuo-cont">
  141. {{item.spec}}
  142. </view>
  143. </view>
  144. <view class="shuo-item">
  145. <view class="shuo-label">
  146. 型号:
  147. </view>
  148. <view class="shuo-cont">
  149. {{item.mol}}
  150. </view>
  151. </view>
  152. </view>
  153. <view class="inventory-item">
  154. <view class="shuo-item">
  155. <view class="shuo-label">
  156. 材质:
  157. </view>
  158. <view class="shuo-cont">
  159. {{item.matl}}
  160. </view>
  161. </view>
  162. <view class="shuo-item">
  163. <view class="shuo-label">
  164. 采购数量:
  165. </view>
  166. <view class="shuo-cont">
  167. {{item.purcCnt}}
  168. </view>
  169. </view>
  170. </view>
  171. <view class="inventory-item">
  172. <view class="shuo-item">
  173. <view class="shuo-label">
  174. 已出库数量:
  175. </view>
  176. <view class="shuo-cont">
  177. {{item.delvCntYck}}
  178. </view>
  179. </view>
  180. <view class="shuo-item">
  181. <view class="shuo-label">
  182. 剩余出库量:
  183. </view>
  184. <view class="shuo-cont">
  185. {{item.toDelvCnt}}
  186. </view>
  187. </view>
  188. </view>
  189. </view>
  190. <uni-popup ref="popup">
  191. <uni-popup-dialog type="warn" :before-close="true" cancelText="取消" confirmText="确定" content="你确定当前操作吗?"
  192. @confirm="dialogConfirm" @close="dialogClose"></uni-popup-dialog>
  193. </uni-popup>
  194. <view class="botm-btn">
  195. <button type="default" plain="true" style="width:240rpx;line-height: 70rpx;background: #01A992;color:#fff"
  196. @click.stop="accessData()">确认</button>
  197. </view>
  198. </view>
  199. </template>
  200. <script>
  201. import {
  202. mapState,
  203. mapMutations,
  204. mapActions
  205. } from 'vuex';
  206. import moment from "moment";
  207. export default {
  208. data() {
  209. return {
  210. listData: [],
  211. acceptDetaData: {},
  212. subMitData: {},
  213. selcectData: {} //详情选中的数据
  214. }
  215. },
  216. computed: {
  217. ...mapState(['orderDelData', 'instData', 'batchData'])
  218. },
  219. onShow() {
  220. let that = this;
  221. uni.getStorage({
  222. key: 'orderDetailsData',
  223. success: function(res) {
  224. that.touData({
  225. id: res.data.id,
  226. spdId: that.instData.spdId,
  227. });
  228. that.acceptDetaData = res.data;
  229. }
  230. });
  231. },
  232. mounted() {},
  233. methods: {
  234. ...mapActions(['getOrderAwaitDetail']),
  235. ...mapMutations(['setBatchData']),
  236. async touData(data) {
  237. this.getOrderAwaitDetail(data)
  238. },
  239. forMatTime(row) {
  240. return moment(row).format("YYYY-MM-DD HH:mm");
  241. },
  242. checkChange(e) {
  243. let newSelect = {
  244. ...this.selcectData
  245. };
  246. let chekData = e.detail.value;
  247. if (chekData.length > 0) {
  248. this.selcectData = {
  249. ...this.selcectData,
  250. [e.target.dataset.id]: this.orderDelData[chekData[0]]
  251. }
  252. } else {
  253. delete newSelect[e.target.dataset.id]
  254. this.selcectData = newSelect;
  255. }
  256. },
  257. //耗材添加批次跳转
  258. itemDetails(item, index) {
  259. if (!this.selcectData[item.id]) {
  260. uni.showToast({
  261. title: '请选中再添加批次',
  262. icon: 'none',
  263. duration: 1000,
  264. });
  265. return;
  266. }
  267. uni.setStorage({
  268. key: 'batchDelsData',
  269. data: item
  270. });
  271. uni.navigateTo({
  272. url: '/subpkg/pages/order-outbond/batch',
  273. success: function(res) {
  274. console.log(res, "res")
  275. }
  276. });
  277. },
  278. //确认/退回
  279. accessData() {
  280. if (JSON.stringify(this.selcectData) === "{}") {
  281. uni.showToast({
  282. title: '请选择出库耗材',
  283. icon: 'none',
  284. duration: 1000,
  285. });
  286. return;
  287. };;
  288. let selectKey = Object.keys(this.selcectData);
  289. let filterEmpty = selectKey.filter((item) => {
  290. return this.batchData[item] == null || this.batchData[item].length == 0
  291. })
  292. if (filterEmpty.length > 0) {
  293. uni.showToast({
  294. title: '请为选中的耗材添加批次',
  295. icon: 'none',
  296. duration: 1000,
  297. });
  298. return;
  299. };
  300. let newSubData = [];
  301. selectKey.forEach((item) => {
  302. newSubData.push(this.batchData[item])
  303. })
  304. const merged = newSubData.reduce((acc, current) => [...acc, ...current], []);
  305. this.$http('orderOutbond.subMitData', {
  306. spdId: this.instData.spdId,
  307. detlList: merged
  308. }, '加载中').then(res => {
  309. if (res.success == true) {
  310. this.setBatchData({});
  311. uni.navigateTo({
  312. url: '/subpkg/pages/order-outbond/index',
  313. success: function(res) {
  314. console.log(res, "res")
  315. }
  316. });
  317. }
  318. }).catch(e => {
  319. })
  320. },
  321. //属性值进行比较
  322. //日期格式化
  323. forMatTime(time) {
  324. return moment(time).format("YYYY-MM-DD");
  325. },
  326. //加时分秒
  327. forMatTimehs(time) {
  328. return moment(time).format("YYYY-MM-DD HH:mm");
  329. },
  330. },
  331. watch: {
  332. }
  333. }
  334. </script>
  335. <style lang="scss" scoped>
  336. .query-wrap {
  337. width: 100%;
  338. height: 100%;
  339. padding: 20rpx;
  340. box-sizing: border-box;
  341. background-color: #F1F1F1;
  342. overflow-y: scroll;
  343. overflow-x: hidden;
  344. position: relative;
  345. padding-bottom: 200rpx;
  346. .botm-btn {
  347. width: 100%;
  348. height: 120rpx;
  349. background-color: #fff;
  350. position: fixed;
  351. left: 0;
  352. bottom: 0;
  353. padding-top: 40rpx;
  354. display: flex;
  355. align-items: center;
  356. justify-content: space-around;
  357. }
  358. .time-view {
  359. height: 350rpx;
  360. background-color: #fff;
  361. padding: 50rpx 50rpx 0 50rpx;
  362. box-sizing: border-box;
  363. .btn-view {
  364. width: 100%;
  365. height: 100rpx;
  366. margin-top: 100rpx;
  367. display: flex;
  368. justify-content: space-around;
  369. }
  370. }
  371. }
  372. uni-page-body {
  373. width: 100%;
  374. height: 100%;
  375. }
  376. </style>