| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- <template>
- <div>
- <!-- <div class="switch">
- <div class="switch_left">
- <ul>
- <li
- v-for="item in tabOptions"
- :key="item.key"
- :class="{ active: activeComp == item.key }"
- @click="changeActive(item)"
- >
- {{ item.name }}
- </li>
- </ul>
- </div>
- </div> -->
- <div v-show="activeComp == 'main'">
- <el-form ref="form" :model="form" :rules="rules" label-width="120px">
- <headerTitle title="入库单详情"></headerTitle>
- <el-row>
- <el-col :span="6">
- <el-form-item label="物品名称:" prop="categoryName">
- {{ form.categoryName }}
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="物品编码:" prop="categoryCode">
- {{ form.categoryCode }}
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="物品分类:" prop="categoryLevelName">
- {{ form.categoryLevelName }}
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="包装数量:" prop="totalPackage">
- {{ totalPackage }}
- </el-form-item>
- </el-col>
- <!-- <el-form-item label="单位:" prop="packingUnit">
- {{ form.packingUnit }}
- </el-form-item> -->
- <el-col :span="6">
- <el-form-item label="计量数量:" prop="totalCount">
- {{ totalCount }}
- </el-form-item>
- </el-col>
- <!-- <el-col :span="12">
- <el-form-item label="车牌号:" prop="carNo">
- {{ form.carNo }}
- </el-form-item>
- <el-form-item label="收货单编码:" prop="receiveNo">
- {{ form.receiveNo }}
- </el-form-item>
- <el-form-item label="制单人:" prop="makerName">
- {{ form.makerName }}
- </el-form-item>
- <el-form-item prop="orderNo" label="订单编码:">
- {{ form.orderNo }}
- </el-form-item>
- </el-col> -->
- </el-row>
- </el-form>
- </div>
- <keep-alive>
- <add
- ref="add"
- :form="form"
- :bizType="taskDefinitionKey == 'wmsBizType4' ? 4 : 1"
- v-if="form.code"
- :sourceBizNo="form.code"
- :detailList="form.detailList"
- ></add>
- </keep-alive>
- </div>
- </template>
- <script>
- import { getStorageDetail } from '@/api/mes/index';
- import dictMixins from '@/mixins/dictMixins';
- import { reviewStatusEnum } from '@/enum/dict';
- import add from '@/views/bpm/stockManagement/storage.vue';
- export default {
- props: {
- businessId: {
- default: ''
- },
- taskId: {
- default: ''
- },
- taskDefinitionKey: {
- default: ''
- }
- },
- components: {
- add
- },
- mixins: [dictMixins],
- data() {
- return {
- activeComp: 'main',
- tabOptions: [
- { key: 'main', name: '生产入库单详情' },
- { key: 'storage', name: '生产入库' }
- ],
- reviewStatusEnum,
- rules: {},
- form: {},
- detailData: {},
- totalPackage: '',
- totalCount: ''
- };
- },
- async created() {
- await this.getDetailData(this.businessId);
- },
- methods: {
- changeActive(item) {
- console.log('item', item);
- this.activeComp = item.key;
- this.$emit('activeCompChange', item.key);
- // if (this.taskDefinitionKey == 'storeman' && item.key == 'storage') {
- // this.$nextTick(() => {
- // this.$refs.add.pickerSuccess(this.form);
- // });
- // }
- },
- success() {
- this.$emit('handleClose');
- },
- async getTableValue() {
- return {
- form: this.form,
- returnStorageData:
- this.$refs.add && (await this.$refs.add.getReturnStorage())
- };
- },
- async getDetailData(id) {
- this.loading = true;
- const data = await getStorageDetail(id);
- console.log('data-----------', data);
- this.loading = false;
- if (data) {
- this.form = data;
- let categoryLevelTopIds = data.detailList.map(
- (item) => item.rootCategoryLevelId
- );
- let filterCategoryLevelTopIds = Array.from(
- new Set(categoryLevelTopIds)
- );
- data.categoryLevelTopId = filterCategoryLevelTopIds.join(',');
- if (this.taskDefinitionKey == 'wmsBizType4') {
- this.form.totalCount = data.detailList.reduce(
- (sum, item) => sum + (item.quantity || 0),
- 0
- );
- this.$set(
- this.form,
- 'totalCount',
- data.detailList.reduce(
- (sum, item) => sum + (item.quantity || 0),
- 0
- )
- );
- }
- this.totalPackage =
- this.form.detailList.length + this.form?.detailList[0]?.packingUnit;
- this.totalCount =
- this.form.totalCount + this.form?.detailList[0]?.measuringUnit;
- this.detailData = data;
- }
- }
- }
- };
- </script>
- <style scoped lang="scss">
- .ele-dialog-form {
- .el-form-item {
- margin-bottom: 10px;
- }
- }
- .headbox {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- .amount {
- font-size: 14px;
- font-weight: bold;
- margin-right: 20px;
- }
- }
- </style>
|