石广澎
2023-11-29 20913c80c3f5fc8e533cb92b90e6f20bcd68e032
admin-web/src/views/departmentitem/itemdis/distribution/detail.vue
@@ -1,89 +1,103 @@
<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>{{detail.businessFormCode}}</span>
      </el-col>
      <el-col :span="8">
        <span>所属机构:</span>
        <span>{{ detail.agencyName }}</span>
        <span>{{detail.outAgencyName}}</span>
      </el-col>
      <el-col :span="8">
        <span>部门:</span>
        <span>{{detail.inWarehouseName}}</span>
      </el-col>
    </el-row>
    <el-row :gutter="20" style="margin-top: 20px">
      <el-col :span="8">
        <span>状态:</span>
        <span>{{ detail.states == 1 ? '待入库' : '已入库' }}</span>
        <span>分发人:</span>
        <span>{{detail.outOperatorName}}</span>
      </el-col>
      <el-col :span="8">
        <span>创建人:</span>
        <span>{{ detail.buyerName }}</span>
        <span>分发时间:</span>
        <span>{{detail.createTime|formatTime}}</span>
      </el-col>
      <el-col :span="8">
        <span>入库时间:</span>
        <span>{{ detail.incomeTime | formatTime }}</span>
        <span>领取人:</span>
        <span>{{detail.inOperatorName}}</span>
      </el-col>
    </el-row>
    <el-row :gutter="20" style="margin-top: 20px">
      <el-col class="img-row" :span="12">
        <span>采购类型:</span>
        <span>{{ detail.buyType == 1 ? '集采' : '自采' }}</span>
      <el-col :span="8">
        <span>联系电话:</span>
        <span>{{detail.tel}}</span>
      </el-col>
    </el-row>
    <el-row :gutter="20" style="margin-top: 20px">
      <el-col class="img-row" :span="24">
        <span>采购手续照片:</span>
        <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.procureGoods" :key="goodsIndex">
    <div class="goods-card" v-for="(goodsItem, goodsIndex) in detail.formTransferGoods" :key="goodsIndex">
      <el-row :gutter="20">
        <el-col :span="8">
          <span>物品分类:</span>
          <span>{{ goodsItem.baseCategoryName }}</span>
          <span>{{ goodsItem.categoryName }}</span>
        </el-col>
        <el-col :span="8">
          <span>物品名称:</span>
          <span>{{ goodsItem.goodsTemplateName }}</span>
          <span>{{ goodsItem.goodsName }}</span>
        </el-col>
        <el-col :span="8">
          <span>供货商:</span>
          <span>{{ goodsItem.supplier }}</span>
          <span>物品类别:</span>
          <span>{{ goodsItem.type }}类</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="price" label="单价" align="center">
          <template slot-scope="scope">
            {{ scope.row.price | formatPrice }}
          </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>
      <el-form>
        <el-row class="card3" v-for="(mItem, mIndex) in goodsItem.models" :key="mIndex">
          <el-col :span="10">
            <el-form-item label="规格型号:"  style="margin-bottom: 0">
              {{ mItem.baseGoodsModelsName }}
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="单位:" style="margin-bottom: 0" label-width="80">
              {{mItem.unit}}
            </el-form-item>
          </el-col>
          <!--A类商品 -->
          <el-col :span="24" v-if="goodsItem.type==='A'">
            <el-row v-for="(user, u) in mItem.useInfo" :key="u">
              <el-col :span="6">
                <el-form-item label="分发数量:" style="margin-bottom: 0" label-width="80">
                  {{user.num}}
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="使用人:" style="margin-bottom: 0" label-width="80">
                  {{user.name}}
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="联系电话:" style="margin-bottom: 0" label-width="80">
                  {{user.tel}}
                </el-form-item>
              </el-col>
            </el-row>
          </el-col>
          <!--BC类商品 -->
          <el-col style="padding: 10px 0" :span="10" v-else>
            <el-form-item label="分发数量:" prop="counts" style="margin-bottom: 0" label-width="80">
              {{mItem.counts}}
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
    <div id="uploadPreviewImages" style="display: none">
      <span v-for="(src, index) in fileList" :key="index">
@@ -96,21 +110,26 @@
        />
      </span>
    </div>
  </win-md>
  </win-lg>
</template>
<script>
import { procureDetail } from '@/api/stock/procure/purchaseOrder';
import winMd from '@/components/win/win-md';
import {transferDetail} from '@/api/stock/transfer';
import winLg from '@/components/win/win-lg';
import * as DateFormatter from '@/utils/DateFormatter';
import { getDownUrl } from '@/utils/base';
import {getDownUrl} from '@/utils/base';
import Viewer from 'viewerjs';
import 'viewerjs/dist/viewer.css';
import de from "element-ui/src/locale/lang/de";
let viewer = null;
export default {
  components: { winMd },
  computed: {
    de() {
      return de
    }
  },
  components: { winLg },
  props: {
    setting: {
      type: Object,
@@ -119,6 +138,7 @@
  },
  data() {
    return {
      loading:false,
      fileList: [],
      detail: {
        baseCategoryName: '',
@@ -145,7 +165,7 @@
    }
  },
  created() {
    procureDetail({ id: this.setting.id }).then((res) => {
    transferDetail({ id: this.setting.id }).then((res) => {
      this.detail = res;
      this.fileList = this.detail.procureDoc ? JSON.parse(this.detail.procureDoc) : [];
      this.$nextTick(() => {
@@ -206,4 +226,18 @@
</script>
<style lang="scss" scoped>
@import url(../../../../styles/store.scss);
.card3 {
  padding: 10px;
  margin-top: 10px;
  border-radius: 2px;
  background: #ffffff;
}
.img-box{
  width: 100px;
  height: 100px;
}
.img-box .img{
  width: 100px;
  height: 100px;
}
</style>