| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- <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>
- <div v-for="item in tabOptions" :label="item.name" :name="item.name">
- <headerTitle :title="item.name"></headerTitle>
- <div v-if="item.key == 'main'">
- <receiptInfo ref="modalRefs" :businessId="businessId" :form="form" :detailData="detailData">
- </receiptInfo>
- </div>
- <div v-if="item.key == 'inoutBound'">
- <add ref="inoutBoundRef" :form="form" :sourceBizNo="form.receiveNo" :saleProductList="form.productList"
- :bizType="2" :detailProductList="detailData.productList"></add>
- </div>
- <div v-if="item.key == 'inoutBoundView'">
- <detailDialog ref="inoutBoundViewRef" :bizType="2" :businessId="form.receiveNo" :isUpload="isUpload">
- </detailDialog>
- </div>
- <div v-if="item.key == 'inoutBoundEdit'">
- <procurementWarehousing :businessId="form.receiveNo" :qualityInspectionItems="qualityInspectionItems"
- ref="inoutBoundEditRef">
- </procurementWarehousing>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import dictMixins from '@/mixins/dictMixins';
- import { getReceiveSaleOrderrecordDetail } from '@/api/bpm/components/purchasingManage/purchaseorderreceive';
- import detailDialog from '@/views/bpm/stockManagement/details.vue';
- import procurementWarehousing from '@/views/bpm/stockManagement/quality.vue';
- import { levelList } from '@/enum/dict.js';
- import receiptInfo from './receiptInfo.vue';
- import add from '@/views/bpm/stockManagement/storage.vue';
- import storageApi from '@/api/warehouseManagement';
- // import fileMain from '@/components/addDoc/index.vue';
- export default {
- props: {
- businessId: {
- default: ''
- },
- taskId: {
- default: ''
- },
- taskDefinitionKey: {
- default: ''
- }
- },
- components: {
- // fileMain,
- detailDialog,
- procurementWarehousing,
- add,
- receiptInfo
- },
- mixins: [dictMixins],
- data() {
- return {
- qualityInspectionItems: [
- 'materielDesignation',
- 'clientCode',
- 'engrave',
- 'weight',
- 'result'
- ],
- isUpload: false,
- activeComp: 'main',
- tabOptions: [{ key: 'main', name: '收货单详情' }],
- visible: false,
- detailId: '',
- title: '详情',
- row: {},
- activeName: 'base',
- form: {
- orderFiles: [{ name: '222' }]
- },
- detailData: {},
- };
- },
- async created() {
- await this.getDetailData(this.businessId);
- // getOutInBySourceBizNoOrError(this.form.receiveNo)
- await storageApi
- .getInfoBySourceBizNo(this.form.receiveNo)
- .then((res) => {
- if (JSON.stringify(res) == '{}') {
- // 未查询到相关信息(未入库)
- if (this.taskDefinitionKey == 'storeManagerApprove') {
- this.tabOptions.push({ key: 'inoutBound', name: '入库单' });
- this.activeComp = 'inoutBound';
- this.$emit('activeCompChange', 'inoutBound');
- // this.$nextTick(() => {
- // this.$refs.add.pickerSuccess(this.form);
- // });
- }
- } else {
- if (this.taskDefinitionKey == 'qualityInspection') {
- this.tabOptions.push({
- key: 'inoutBoundEdit',
- name: '入库单详情(已入库)'
- });
- this.activeComp = 'inoutBoundEdit';
- } else if (this.taskDefinitionKey == 'qualityInspectionFeedback') {
- this.tabOptions.push({
- key: 'inoutBoundView',
- name: '入库单详情'
- });
- this.isUpload = true;
- this.activeComp = 'inoutBoundView';
- } else {
- this.tabOptions.push({
- key: 'inoutBoundView',
- name: '入库单详情'
- });
- this.isUpload = false;
- this.activeComp = 'inoutBoundView';
- }
- // if (
- // ![
- // 'starter',
- // 'deptLeaderApprove',
- // 'storeManagerApprove',
- // 'qualityInspection'
- // ].includes(this.taskDefinitionKey)
- // ) {
- // this.tabOptions.push({
- // key: 'inoutBoundView',
- // name: '入库单详情'
- // });
- // this.isUpload = true;
- // this.activeComp = 'inoutBoundView';
- // } else {
- // this.tabOptions.push({
- // key: 'inoutBoundEdit',
- // name: '入库单详情(已入库)'
- // });
- // this.activeComp = 'inoutBoundEdit';
- // }
- }
- })
- .catch(() => {
- this.$message.error('获取入库单详情失败');
- });
- console.log(this.tabOptions, 'this.tabOptions')
- },
- methods: {
- changeActive(item) {
- this.activeComp = item.key;
- this.$emit('activeCompChange', item.key);
- // if (
- // this.taskDefinitionKey == 'storeManagerApprove' &&
- // item.key == 'inoutBound'
- // ) {
- // this.$nextTick(() => {
- // this.$refs.add.pickerSuccess(this.form);
- // });
- // }
- },
- save(data) {
- this.$refs.inoutBoundRef?.[0].handleSave(data);
- },
- success() {
- // this.$parent.handleClose()
- this.$emit('handleClose');
- },
- // 判断质检状态是否全部已检
- allListChecked() {
- return (
- this.$refs.inoutBoundEditRef?.[0] &&
- this.$refs.inoutBoundEditRef[0].getStatus()
- );
- },
- async getTableValue() {
- console.log(this.$refs)
- return {
- form: this.form,
- returnStorageData: this.$refs.inoutBoundRef?.[0]&&this.$refs.inoutBoundRef[0].getReturnStorage(),
- isAllChecked:
- this.$refs.inoutBoundEditRef?.[0] &&
- (await this.$refs.inoutBoundEditRef[0].getStatus()),
- qualityInspector:
- (this.$refs.inoutBoundViewRef?.[0] &&
- this.$refs.inoutBoundViewRef[0].getQualityFile()) ||
- {}
- // qualityInspector:
- // (this.$refs.detailDialog &&
- // this.$refs.detailDialog.getQualityFile()) ||
- // {}
- };
- },
- async getDetailData(id) {
- this.loading = true;
- const data = await getReceiveSaleOrderrecordDetail(id);
- this.loading = false;
- if (data) {
- console.log(data, '1111111111111111111111');
- this.form = data;
- 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>
|