123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496 |
- <template>
- <view class="query-wrap">
- <view class="inner-item">
- <view class="inventory-item">
- <view class="shuo-item-name">
- <view class="shuo-label-podnme">
- {{refusaData.data.prodName||"" }}
- </view>
- <view class="shuo-unit">
- <span>{{ refusaData.data.purcUnt }} ({{ refusaData.data.convrat
- }}{{refusaData.data.prcUnt}}/{{ refusaData.data.purcUnt }})</span>
- <span>【{{refusaData.data.purcPric }}元/{{refusaData.data.prcUnt}}】</span>
- </view>
- </view>
- </view>
- <view class="inventory-item" v-if="acceptDetaData.purcType == 'B'">
- <view class="shuo-item-name">
- <view class="shuo-label">
- UDI码:
- </view>
- <view class="shuo-unit" @click.stop="queryUni(refusaData.data)">
- {{refusaData.data.udi}} (查看UDI)
- </view>
- </view>
- </view>
- <view class="inventory-item">
- <view class="shuo-item">
- <view class="shuo-label">
- 采购数量:
- </view>
- <view class="shuo-cont">
- {{refusaData.data.cnt}}
- </view>
- </view>
- <view class="shuo-item">
- <view class="shuo-label">
- 采购总金额:
- </view>
- <view class="shuo-cont">
- {{refusaData.data.ordAmt}}
- </view>
- </view>
- </view>
- <view class="inventory-item">
- <view class="shuo-item">
- <view class="shuo-label">
- 验收数量:
- </view>
- <view class="shuo-cont">
- {{refusaData.data.shppCnt}}
- </view>
- </view>
- <view class="shuo-item">
- <view class="shuo-label">
- 验收总金额:
- </view>
- <view class="shuo-cont">
- {{shppAmtNub(refusaData.data)}}
- </view>
- </view>
- </view>
- <view class="inventory-item">
- <view class="shuo-item">
- <view class="shuo-label">
- 拒收数量:
- </view>
- <view class="shuo-cont">
- {{refusaData.data.retCnt||0}}
- </view>
- </view>
- <view class="shuo-item">
- <view class="shuo-label">
- 拒收总金额:
- </view>
- <view class="shuo-cont">
- {{rejAmtNub(refusaData.data)}}
- </view>
- </view>
- </view>
- <view class="inventory-item">
- <view class="shuo-item-tcl">
- <view class="shuo-label">
- 拒收原因:
- </view>
- <view class="shuo-break">
- {{refusaData.data.rejRea}}
- </view>
- </view>
- </view>
- </view>
- <view class="inner-item">
- <view class="text-title">
- <view class="title-circ">
- </view>
- <span>耗材信息</span>
- </view>
- <view class="inventory-item">
- <view class="shuo-item-name">
- <view class="shuo-label">
- 规格:
- </view>
- <view class="shuo-cont">
- {{refusaData.data.spec}}
- </view>
- </view>
- </view>
- <view class="inventory-item">
- <view class="shuo-item-name">
- <view class="shuo-label">
- 型号:
- </view>
- <view class="shuo-cont">
- {{refusaData.data.mol}}
- </view>
- </view>
- </view>
- <view class="inventory-item">
- <view class="shuo-item-name">
- <view class="shuo-label">
- 生产批次:
- </view>
- <view class="shuo-cont">
- {{refusaData.data.lotNum}}
- </view>
- </view>
- </view>
- <view class="inventory-item">
- <view class="shuo-item-name">
- <view class="shuo-label">
- 生产日期:
- </view>
- <view class="shuo-cont">
- {{refusaData.data.manuDate?forMatTime(refusaData.data.manuDate):""}}
- </view>
- </view>
- </view>
- <view class="inventory-item">
- <view class="shuo-item-name">
- <view class="shuo-label">
- 有效期至:
- </view>
- <view class="shuo-cont">
- {{refusaData.data.prodExpy?forMatTime(refusaData.data.prodExpy):""}}
- </view>
- </view>
- </view>
- <view class="inventory-item">
- <view class="shuo-item-name">
- <view class="shuo-label">
- 注册证号:
- </view>
- <view class="shuo-cont">
- {{refusaData.data.regcertno}}
- </view>
- </view>
- </view>
- <view class="inventory-item">
- <view class="shuo-item-name">
- <view class="shuo-label">
- 耗材类别:
- </view>
- <view class="shuo-cont">
- <span v-if="refusaData.data.mcsType == '0'"> 普通耗材 </span>
- <span v-if="refusaData.data.mcsType == '1'"> 高值耗材 </span>
- <span v-if="refusaData.data.mcsType == '2'"> 试剂 </span>
- <span v-if="refusaData.data.mcsType == '3'"> 总务耗材 </span>
- </view>
- </view>
- </view>
- <view class="inventory-item">
- <view class="shuo-item">
- <view class="shuo-label">
- 生产来源:
- </view>
- <view class="shuo-cont">
- <span v-if="refusaData.data.prodSouc == '1'" type="success"> 国产 </span>
- <span v-if="refusaData.data.prodSouc == '2'" type="danger"> 进口 </span>
- </view>
- </view>
- </view>
- <view class="inventory-item">
- <view class="shuo-item-name">
- <view class="shuo-label">
- 生产企业:
- </view>
- <view class="shuo-cont">
- {{refusaData.data.prodEntp}}
- </view>
- </view>
- </view>
- <view class="inventory-item">
- <view class="shuo-item-name">
- <view class="shuo-label">
- 报关单:
- </view>
- <view class="shuo-cont" @click="queryFiled(refusaData.data.invoFileId)"
- v-if="refusaData.data.invoFileId">
- 查看报关单
- <!-- {{refusaData.data.invoFileId}} -->
- </view>
- </view>
- </view>
- <view class="inventory-item">
- <view class="shuo-item-name">
- <view class="shuo-label">
- 是否集采:
- </view>
- <view class="shuo-cont">
- {{ refusaData.data.isFas == "0" ? "否" : "是" }}
- </view>
- </view>
- </view>
- <view class="inventory-item">
- <view class="shuo-item-name">
- <view class="shuo-label">
- 集采批次:
- </view>
- <view class="shuo-cont">
- {{ refusaData.data.fasBtch}}
- </view>
- </view>
- </view>
- <view class="inventory-item">
- <view class="shuo-item-name">
- <view class="shuo-label">
- 一物一码:
- </view>
- <view class="shuo-cont">
- {{ refusaData.data.isBarc == "0" ? "否" : " 是" }}
- </view>
- </view>
- </view>
- </view>
- <uni-popup ref="popup">
- <uni-popup-dialog type="info" :before-close="true" cancelText="取消" confirmText="确定" @confirm="dialogConfirm"
- @close="dialogClose" title="拒收">
- <uni-forms ref="valiForm" :rules="rules" :modelValue="valiFormData">
- <uni-forms-item label="拒收数量" name="retCnt" style="width:500rpx">
- <uni-easyinput type="number" placeholder="请输入拒收数量" v-model="valiFormData.retCnt" />
- </uni-forms-item>
- <uni-forms-item label="拒收原因" name="rejRea" style="width:500rpx">
- <uni-easyinput placeholder="请输入拒收原因" v-model="valiFormData.rejRea" />
- </uni-forms-item>
- </uni-forms>
- </uni-popup-dialog>
- </uni-popup>
- <view class="botm-btn" v-if="acceptDetaData.stas=='B'">
- <button type="default" plain="true" style="width:200rpx;line-height: 70rpx;background: #BD3124;color:#fff"
- @click.stop="orderEefusa()">拒收</button>
- </view>
- </view>
- </template>
- <script>
- import {
- mapState,
- mapMutations,
- mapActions
- } from 'vuex';
- import moment from "moment";
- import {
- pathToBase64,
- base64ToPath
- } from 'image-tools'
- export default {
- data() {
- return {
- valiFormData: {
- retCnt: '',
- rejRea: ""
- },
- baseImg: "",
- acceptDetaData: {},
- rules: {
- rejRea: {
- rules: [{
- required: true,
- errorMessage: ' 拒收原因不能为空'
- }]
- },
- retCnt: {
- rules: [{
- required: true,
- errorMessage: ' 拒收数量不能为空'
- }]
- }
- },
- }
- },
- computed: {
- ...mapState(['refusaData', 'acceptDetail'])
- },
- onShow() {
- let that = this;
- that.$forceUpdate();
- uni.getStorage({
- key: 'accept-storage-details',
- success: function(res) {
- that.acceptDetaData = res.data;
- }
- });
- },
- mounted() {
- },
- methods: {
- ...mapActions(['getUDIData']),
- ...mapMutations(['setRefusaData', 'setAcceptDetail']),
- //查看报关单
- queryFiled(id) {
- uni.showLoading({
- title: "加载中..."
- })
- this.$http('acceptance.queryFileID', {
- id: id,
- }, '加载中', true).then((res) => {
- if (res.success == true) {
- base64ToPath(res.data.fileContent).then((path) => {
- uni.openDocument({
- filePath: path,
- success: function(res) {
- console.log('打开文档成功');
- },
- fail: (res) => {
- console.log("打开失败", res);
- },
- });
- })
- }
- })
- },
- //查看UNI码
- queryUni(data) {
- this.getUDIData({
- current: 1,
- lotNum: data.lotNum,
- prodCode: data.prodCode,
- size: 10000,
- stooutId: this.acceptDetaData.stooutId,
- })
- uni.navigateTo({
- url: '/pages/udiview/index',
- success: function(res) {
- }
- });
- },
- //拒收总金额
- rejAmtNub(row) {
- let reCt = row.retCnt || 0;
- row.rejAmt =
- Number(reCt) * Number(row.purcPric) * Number(row.convrat);
- return parseFloat(row.rejAmt.toFixed(4));
- },
- //验收总金额
- shppAmtNub(row) {
- row.shppAmt =
- Number(row.shppCnt) * Number(row.purcPric) * Number(row.convrat);
- return parseFloat(row.shppAmt.toFixed(4));
- },
- //确定拒收
- dialogConfirm() {
- this.$refs['valiForm'].validate().then(res => {
- if (Number(this.valiFormData.retCnt) > Number(this.refusaData.data.stooutCnt)) {
- uni.showToast({
- title: '拒收数量不能大于到货数量',
- icon: 'none'
- });
- return;
- }
- if (Number(this.valiFormData.retCnt) == '0') {
- uni.showToast({
- title: '拒收数量不能为0',
- icon: 'none'
- });
- return;
- }
- //获取新的验收数量=到货数量减去拒收数量
- let newAcept = Number(this.refusaData.data.stooutCnt) - Number(this.valiFormData.retCnt);
- let newData = {
- ...this.refusaData.data,
- shppCnt: newAcept,
- rejRea: this.valiFormData.rejRea,
- retCnt: this.valiFormData.retCnt
- };
- let newAcceptDetal = this.acceptDetail;
- newAcceptDetal[this.refusaData.index] = newData;
- this.setRefusaData({
- index: this.refusaData.index,
- data: newData
- })
- this.setAcceptDetail(newAcceptDetal);
- this.$refs.popup.close();
- uni.navigateBack();
- }).catch(err => {
- console.log('err', err);
- })
- },
- //验收按钮触发
- orderEefusa() {
- this.$refs.popup.open('center');
- },
- dialogClose() {
- this.$refs.popup.close();
- },
- //日期格式化
- forMatTime(time) {
- return moment(time).format("YYYY-MM-DD");
- },
- //跳转上架详情
- itemDetails(item) {
- this.setMentItemData([item]);
- uni.navigateTo({
- url: '/pages/groundetials/groundetials',
- success: function(res) {
- console.log(res, "res")
- }
- });
- },
- },
- watch: {
- }
- }
- </script>
- <style lang="scss" scoped>
- .query-wrap {
- width: 100%;
- height: 100%;
- padding: 20rpx;
- box-sizing: border-box;
- background-color: #F1F1F1;
- overflow-y: scroll;
- overflow-x: hidden;
- position: relative;
- padding-bottom: 200rpx;
- .baseImage {
- width: 300rpx;
- height: 300rpx;
- }
- .uni-input {
- border: 1px solid #E5E4E5;
- border-radius: 30rpx;
- height: 100%;
- opacity: 1;
- color: #9D9D9D;
- padding-left: 20rpx;
- font: inherit;
- font-size: 25rpx;
- line-height: inherit;
- letter-spacing: inherit;
- text-align: inherit;
- text-indent: inherit;
- text-transform: inherit;
- text-shadow: inherit;
- }
- .botm-btn {
- width: 100%;
- height: 120rpx;
- background-color: #fff;
- position: fixed;
- left: 0;
- bottom: 0;
- padding-top: 40rpx;
- }
- .time-view {
- height: 350rpx;
- background-color: #fff;
- padding: 50rpx 50rpx 0 50rpx;
- box-sizing: border-box;
- .btn-view {
- width: 100%;
- height: 100rpx;
- margin-top: 100rpx;
- display: flex;
- justify-content: space-around;
- }
- }
- }
- uni-page-body {
- width: 100%;
- height: 100%;
- }
- </style>
|