| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285 |
- <template>
- <view class="mainBox">
- <uni-nav-bar
- fixed="true"
- statusBar="true"
- left-icon="back"
- title="报损报溢详情"
- @clickLeft="back"
- >
- </uni-nav-bar>
- <view>
- <CellInfo label="报损报溢编码" :value="infoData.code"></CellInfo>
- <CellInfo label="名称" :value="infoData.name"></CellInfo>
- <CellInfo
- label="报损报溢部门"
- :value="infoData.reportDeptName"
- ></CellInfo>
- <CellInfo label="报损报溢人" :value="infoData.reportName"></CellInfo>
- <CellInfo label="审核人部门" :value="infoData.auditDeptName"></CellInfo>
- <CellInfo label="审核人" :value="infoData.auditName"></CellInfo>
- <CellInfo label="备注" :value="infoData.remark"></CellInfo>
- </view>
- <uni-section title="报损报溢明细" type="line">
- <view class="order-box">盘点工单{{ infoData.workOrderCode }}</view>
- <view
- v-for="(item, index) in infoData.list"
- :key="index"
- class="list-card"
- >
- <view class="status" :style="{ color: _getStatus(item.status).color }">
- <text>{{ _getStatus(item.status).name }}</text>
- <text
- >数量:{{
- (([1, 2].includes(item.status) ? '-' : '+') || '') + item.amount
- }}</text
- >
- </view>
- <view class="row first">
- <view class="col">
- <text class="main">{{ item.name }}</text>
- {{ item.code }}
- </view>
- </view>
- <view class="row">
- <view class="col" style="width: 100%">
- <text class="main">货位:</text>
- {{ item.warehouseName }}-{{ item.reservoirName }}-{{
- item.goodsShelfName
- }}-{{ item.goodsAllocationName }}
- </view>
- </view>
- <view class="row">
- <view class="col">
- <text class="label">批次号:</text>
- {{ item.batch }}
- </view>
- <view class="col">
- <text class="label">类型:</text>
- {{ getDictValue('物品类型', item.productType) }}
- </view>
- <view class="col" v-for="(itm, index) in tableHeader" :key="index">
- <text class="label">{{ itm.label }}:</text>
- {{ item[itm.prop] }}
- </view>
- <view class="col" v-if="!item.isUnpack">
- <text class="label">最小单元:</text>
- {{ item.unit }}/{{ item.minPackUnit }}
- </view>
- </view>
- </view>
- </uni-section>
- </view>
- </template>
- <script>
- import { post, postJ, get, getJ } from '@/utils/api.js'
- import { getDict, wh_equStatus } from '../enum.js'
- import CellInfo from '@/components/CellInfo.vue'
- import dictMxins from '@/mixins/dictMixins'
- export default {
- components: { CellInfo },
- mixins: [dictMxins],
- data () {
- return {
- pickerIndex: 0,
- deptList: [],
- userList: [],
- infoData: {
- auditId: '',
- auditName: '',
- verifyDeptCode: '',
- verifyDeptName: '',
- workOrderCode: '',
- list: []
- }
- }
- },
- computed: {
- tableHeader () {
- if (this.infoData.list?.length) {
- return this.getTableHeader(this.infoData.list[0].productType)
- }
- return []
- }
- },
- onLoad ({ id }) {
- this.getDetail(id)
- this.requestDict('物品类型')
- },
- methods: {
- getTableHeader (selectEquiType) {
- switch (+selectEquiType) {
- case 3:
- return [{ label: '牌号', prop: 'assetBrand' }]
- case 8:
- return [
- // { label: '型号', prop: 'assetSku' },
- { label: '型号', prop: 'modelType' },
- { label: '规格', prop: 'specification' }
- ]
- case 4:
- return [
- { label: '牌号', prop: 'assetBrand' },
- { label: '型号', prop: 'modelType' },
- // { label: '型号', prop: 'assetSku' }
- ]
- case 5: //'周转车'
- return [
- { label: '规格', prop: 'specification' },
- {
- label: '材质',
- prop: 'texture',
- formatter (row) {
- if (!row?.extendField) return ''
- const extendField = JSON.parse(row.extendField)
- return extendField.texture
- }
- },
- {
- label: '长宽高',
- prop: '',
- formatter (row) {
- if (!row?.extendField) return ''
- const extendField = JSON.parse(row.extendField)
- return `${extendField.length || '-'}*${
- extendField.width || '-'
- }*${extendField.high || '-'}`
- }
- }
- ]
- case 2: //'舟皿'
- return [
- { label: '规格', prop: 'specification' },
- { label: '型号', prop: 'modelType' },
- // { label: '型号', prop: 'assetSku' },
- {
- label: '长宽高',
- prop: '',
- formatter (row) {
- if (!row?.extendField) return ''
- const extendField = JSON.parse(row.extendField)
- return `${extendField.length || '-'}*${
- extendField.width || '-'
- }*${extendField.high || '-'}`
- }
- }
- ]
- case 1: //'设备'
- return [
- // { label: '型号', prop: 'assetSku' },
- { label: '型号', prop: 'modelType' },
- { label: '规格', prop: 'specification' }
- ]
- case 6: //'模具'
- return [
- { label: '牌号', prop: 'assetBrand' },
- { label: '型号', prop: 'modelType' },
- // { label: '型号', prop: 'assetSku' },
- {
- label: '收缩系数',
- prop: '',
- formatter (row) {
- if (!row?.extendField) return ''
- const extendField = JSON.parse(row.extendField)
- return extendField.shrinkageCoefficient
- }
- }
- ]
- case 7: //'备品备件'
- return [
- { label: '规格', prop: 'specification' },
- { label: '型号', prop: 'modelType' },
- // { label: '型号', prop: 'assetSku' }
- ]
- }
- return []
- },
- _getStatus: getDict(wh_equStatus),
- async getDetail (id) {
- const res = await get(this.apiUrl + `/breakag/info/${id}`)
- if (res?.success) {
- this.infoData = res.data
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .footBox {
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- }
- .mainBox {
- padding-bottom: 90rpx;
- .order-box {
- color: #7f7f7f;
- background-color: rgba(215, 215, 215, 0.729411764705882);
- line-height: 44rpx;
- border-radius: 44rpx;
- text-align: center;
- font-size: 28rpx;
- margin: 0 20rpx;
- }
- .list-card {
- border-bottom: 6rpx solid #f2f2f2;
- position: relative;
- .status {
- padding: 6rpx 20rpx;
- font-weight: bold;
- font-size: 28rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- border-bottom: 1rpx solid #f2f2f2;
- }
- .del {
- position: absolute;
- color: $uni-color-order-error !important;
- bottom: 5rpx;
- right: 10rpx;
- font-size: 50rpx !important;
- }
- .row {
- display: flex;
- justify-content: space-between;
- align-items: center;
- font-size: 28rpx;
- flex-wrap: wrap;
- padding: 10rpx 20rpx;
- color: #7d7d7d;
- &.first {
- color: #000;
- font-size: 28rpx;
- border-bottom: 1rpx solid #f2f2f2;
- .col {
- width: 100%;
- }
- }
- .col {
- width: 50%;
- }
- .label {
- margin-right: 10rpx;
- display: inline-block;
- width: 180rpx;
- text-align: right;
- }
- .main {
- margin-right: 10rpx;
- }
- }
- }
- }
- </style>
|