| | |
| | | <template> |
| | | <win-md class="stock-detail" :title="setting.title" @close="close" :width="'800px'"> |
| | | <win-lg class="stock-detail" :title="setting.title" @close="close" :width="'800px'" :loading="loading"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <span>出库单号:</span> |
| | | <span>{{ detail.businessFormCode }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>出库仓库:</span> |
| | | <span>{{ detail.warehouseName }}</span> |
| | | <span>报废单号:</span> |
| | | <span>SL2023001</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>所属机构:</span> |
| | | <span>{{ detail.agencyName }}</span> |
| | | <span>河南省邮政分公司</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>部门:</span> |
| | | <span>金融业务部</span> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" style="margin-top: 20px"> |
| | | <el-col :span="8"> |
| | | <span>创建人:</span> |
| | | <span>{{ detail.operatorName }}</span> |
| | | <span>报废人:</span> |
| | | <span>张爱生</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <span>出库时间:</span> |
| | | <span>{{ detail.dealTime | formatTime }}</span> |
| | | <span>报废时间:</span> |
| | | <span>2023-08-08 10:23:12</span> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row v-if="detail.procureDoc" :gutter="20" style="margin-top: 20px"> |
| | | <el-row :gutter="20" style="margin-top: 20px"> |
| | | <el-col class="img-row" :span="24"> |
| | | <span>出库手续:</span> |
| | | <div class="img-box"></div> |
| | | <span>报废手续:</span> |
| | | <div class="img-box" v-for="(item, index) in fileList" :key="index" @click="handlePreview(item)"> |
| | | <img class="img" :src="getUrl(item.path)" alt="" /> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="goods-card" v-for="(goodsItem, goodsIndex) in detail.fromOutputGoods" :key="goodsIndex"> |
| | | <div class="goods-card" v-for="(goodsItem, goodsIndex) in detail.procureGoods" :key="goodsIndex"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-col :span="6"> |
| | | <span>物品分类:</span> |
| | | <span>{{ goodsItem.categoryName }}</span> |
| | | <span>{{ goodsItem.baseCategoryName }}</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-col :span="6"> |
| | | <span>物品名称:</span> |
| | | <span>{{ goodsItem.goodsName }}</span> |
| | | <span>{{ goodsItem.goodsTemplateName }}</span> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <span>物品类别:</span> |
| | | <span>{{ goodsItem.supplier }}</span> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <span>分发单号:</span> |
| | | <span>{{ goodsItem.supplier }}</span> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="goodsItem.models" :stripe="true" style="margin-top: 20px"> |
| | | <el-table-column prop="baseGoodsModelsName" label="规格型号" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.baseGoodsModelsName }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="单位" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.unit }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="counts" label="出库数量" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.counts }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="counts" label="金额" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.price * scope.row.counts | formatPrice}} |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div> |
| | | <el-table :data="goodsItem.models" :stripe="true" style="margin-top: 20px"> |
| | | <el-table-column prop="baseGoodsModelsName" label="规格型号" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.baseGoodsModelsName }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="单位" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.unit }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="使用人" align="center" v-if="goodsItem.type===1"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.unit }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="price" label="再用数量" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.counts }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="counts" label="报废数量" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.counts }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="counts" label="报废原因" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.price }} |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | </win-md> |
| | | <div id="uploadPreviewImages" style="display: none"> |
| | | <span v-for="(src, index) in fileList" :key="index"> |
| | | <img |
| | | v-if="checkImg(src.name)" |
| | | class="v-img" |
| | | :src="src.url" |
| | | :alt="src.name" |
| | | style="width: 100px; height: 100px" |
| | | /> |
| | | </span> |
| | | </div> |
| | | </win-lg> |
| | | </template> |
| | | <script> |
| | | import { outputDetail } from '@/api/stock/accessStock'; |
| | | import winMd from '@/components/win/win-md'; |
| | | import { procureDetail } from '@/api/stock/procure/purchaseOrder'; |
| | | import winLg from '@/components/win/win-lg'; |
| | | import * as DateFormatter from '@/utils/DateFormatter'; |
| | | import { getDownUrl } from '@/utils/base'; |
| | | import Viewer from 'viewerjs'; |
| | | import 'viewerjs/dist/viewer.css'; |
| | | |
| | | let viewer = null; |
| | | |
| | | export default { |
| | | components: { winMd }, |
| | | |
| | | components: { winLg }, |
| | | props: { |
| | | setting: { |
| | | type: Object, |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | loading:false, |
| | | fileList: [], |
| | | detail: { |
| | | categoryName: '', |
| | | baseCategoryName: '', |
| | | businessFormCode: '', |
| | | goodsName: '', |
| | | goodsTemplateName: '', |
| | | procureDoc: '', |
| | | agencyId: '', |
| | | agencyName: '', |
| | | states: '', |
| | | createName: '', |
| | | fromOutputGoods: [], |
| | | time: '', |
| | | procureGoods: [{}, {}], |
| | | fileKey: Math.random(), |
| | | }, |
| | | }; |
| | | }, |
| | | filters: { |
| | | formatTime(time) { |
| | | if (!time) return; |
| | | if (!time) return '-'; |
| | | return DateFormatter.LongToDateTime(time); |
| | | }, |
| | | formatPrice(price) { |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | outputDetail({ id: this.setting.id }).then((res) => { |
| | | procureDetail({ id: this.setting.id }).then((res) => { |
| | | this.detail = res; |
| | | this.fileList = this.detail.procureDoc ? JSON.parse(this.detail.procureDoc) : []; |
| | | this.$nextTick(() => { |
| | | this.initPreviewImg(); |
| | | }); |
| | | }); |
| | | }, |
| | | methods: { |
| | | initPreviewImg() { |
| | | if (viewer != null) { |
| | | viewer.destroy(); |
| | | } |
| | | const ViewerDom = document.querySelector('#uploadPreviewImages'); |
| | | viewer = new Viewer(ViewerDom, {}); |
| | | }, |
| | | handlePreview(file) { |
| | | if (!this.checkImg(file.name)) { |
| | | return false; |
| | | } |
| | | let index = 0; |
| | | for (let i = 0; i < this.fileList.length; i++) { |
| | | const f = this.fileList[i]; |
| | | if (this.checkImg(f.name)) { |
| | | if (file.id == f.id) { |
| | | break; |
| | | } |
| | | index++; |
| | | } |
| | | } |
| | | // this.fileList.forEach((f, i) => { |
| | | // if (file.uid == f.uid) { |
| | | // index = i |
| | | // } |
| | | // }) |
| | | // document.querySelector('#uploadPreviewImages').children[0].click() |
| | | viewer.view(index); |
| | | }, |
| | | checkImg(name) { |
| | | const suffix = name.substring(name.lastIndexOf('.'), name.length); |
| | | const imgArray = ['.jpg', '.jpeg', '.png', '.bmp']; |
| | | if (imgArray.indexOf(suffix) < 0) { |
| | | return false; |
| | | } |
| | | return true; |
| | | }, |
| | | getUrl(path) { |
| | | if (path.substr(0, 7).toLowerCase() == 'http://' || path.substr(0, 8).toLowerCase() == 'https://') { |
| | | return path; |
| | | } else { |
| | | return getDownUrl() + path; |
| | | } |
| | | }, |
| | | close() { |
| | | this.$emit('close') |
| | | this.$emit('close'); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | @import url(../../../../styles/store.scss); |
| | | //@import url(../../../../styles/store.scss); |
| | | </style> |