|
@@ -0,0 +1,408 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <ele-modal
|
|
|
|
|
+ custom-class="ele-dialog-form long-dialog-form"
|
|
|
|
|
+ :centered="true"
|
|
|
|
|
+ :visible.sync="editRepairNotesDialog"
|
|
|
|
|
+ :title="title"
|
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
|
+ width="85%"
|
|
|
|
|
+ :maxable="true"
|
|
|
|
|
+ append-to-body
|
|
|
|
|
+ @close="handleClose"
|
|
|
|
|
+ >
|
|
|
|
|
+ <div class="switch" v-if="type == 'view'">
|
|
|
|
|
+ <div class="switch_left">
|
|
|
|
|
+ <ul>
|
|
|
|
|
+ <li
|
|
|
|
|
+ v-for="item in tabOptions"
|
|
|
|
|
+ :key="item.key"
|
|
|
|
|
+ :class="{ active: activeComp == item.key }"
|
|
|
|
|
+ @click="handleTag(item.key)"
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ item.name }}
|
|
|
|
|
+ </li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-form
|
|
|
|
|
+ ref="recyleFormRef"
|
|
|
|
|
+ :model="form"
|
|
|
|
|
+ label-width="100px"
|
|
|
|
|
+ v-show="activeComp === 'main'"
|
|
|
|
|
+ >
|
|
|
|
|
+ <headerTitle title="基本信息" style="margin-top: 15px"></headerTitle>
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="编码:" prop="code">
|
|
|
|
|
+ <el-input v-model="form.code" disabled />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ label="名称:"
|
|
|
|
|
+ prop="name"
|
|
|
|
|
+ :rules="{
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: '请输入名称',
|
|
|
|
|
+ trigger: 'change'
|
|
|
|
|
+ }"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-input v-model="form.name" :disabled="type == 'view'" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ label="配件申请单:"
|
|
|
|
|
+ prop="sparePartsApplyCode"
|
|
|
|
|
+ :rules="{
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: '请选择配件申请单',
|
|
|
|
|
+ trigger: 'change'
|
|
|
|
|
+ }"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="form.sparePartsApplyCode"
|
|
|
|
|
+ :disabled="type == 'view'"
|
|
|
|
|
+ @click.native="$refs.accessoryListRef.open"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="备注:" prop="remark">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="form.remark"
|
|
|
|
|
+ :disabled="type == 'view'"
|
|
|
|
|
+ type="textarea"
|
|
|
|
|
+ placeholder="请输入"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <headerTitle title="归还配件明细" style="margin-top: 15px"> </headerTitle>
|
|
|
|
|
+ <ele-pro-table
|
|
|
|
|
+ ref="table"
|
|
|
|
|
+ :needPage="false"
|
|
|
|
|
+ :columns="columns"
|
|
|
|
|
+ :datasource="form.detailList"
|
|
|
|
|
+ class="time-form"
|
|
|
|
|
+ :maxHeight="400"
|
|
|
|
|
+ full-height="calc(100vh - 116px)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <!-- 表头工具栏 -->
|
|
|
|
|
+ <template v-slot:toolbar v-if="type != 'view'">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ icon="el-icon-plus"
|
|
|
|
|
+ class="ele-btn-icon"
|
|
|
|
|
+ @click="openOutbound({ code: form.sparePartsApplyCode })"
|
|
|
|
|
+ >新增</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-slot:measureQuantity="scope">
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ label-width="0"
|
|
|
|
|
+ :prop="'detailList.' + scope.$index + '.measureQuantity'"
|
|
|
|
|
+ :rules="[{ required: true, message: '请输入', trigger: 'blur' }]"
|
|
|
|
|
+ style="margin-bottom: 0"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="scope.row.measureQuantity"
|
|
|
|
|
+ :disabled="type == 'view'"
|
|
|
|
|
+ type="number"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-slot:action="{ row, $index }" v-if="type != 'view'">
|
|
|
|
|
+ <el-popconfirm
|
|
|
|
|
+ class="ele-action"
|
|
|
|
|
+ title="确定要删除此条数据吗?"
|
|
|
|
|
+ @confirm="del($index)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template v-slot:reference>
|
|
|
|
|
+ <el-link type="danger" icon="el-icon-delete" :underline="false"
|
|
|
|
|
+ >删除</el-link
|
|
|
|
|
+ >
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-popconfirm>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </ele-pro-table>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <template v-slot:footer>
|
|
|
|
|
+ <el-button @click="handleClose">取消</el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ v-if="type != 'view'"
|
|
|
|
|
+ @click="save"
|
|
|
|
|
+ :loading="loading"
|
|
|
|
|
+ >确认</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <bpmDetail
|
|
|
|
|
+ v-if="activeComp === 'bpm' && form.processInstanceId"
|
|
|
|
|
+ :id="form.processInstanceId"
|
|
|
|
|
+ ></bpmDetail>
|
|
|
|
|
+
|
|
|
|
|
+ <!--入库详情-->
|
|
|
|
|
+ <innerBoundDetails
|
|
|
|
|
+ v-if="activeComp === 'store' && form.approvalStatus == 2"
|
|
|
|
|
+ ref="innerBoundDetailsRef"
|
|
|
|
|
+ ></innerBoundDetails>
|
|
|
|
|
+ <accessoryList
|
|
|
|
|
+ ref="accessoryListRef"
|
|
|
|
|
+ @changeSelect="changeSelect"
|
|
|
|
|
+ ></accessoryList>
|
|
|
|
|
+ <outboundDetailsDialog
|
|
|
|
|
+ ref="outboundDetailsDialogRef"
|
|
|
|
|
+ :outboundDetailsDialogFlag.sync="outboundDetailsDialogFlag"
|
|
|
|
|
+ @saveDate="saveDate"
|
|
|
|
|
+ ></outboundDetailsDialog>
|
|
|
|
|
+ </ele-modal>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script>
|
|
|
|
|
+ import { save, update, getById } from '@/api/salesServiceManagement/return';
|
|
|
|
|
+ import bpmDetail from '@/views/bpm/processInstance/detail.vue';
|
|
|
|
|
+
|
|
|
|
|
+ import accessoryList from '@/views/salesServiceManagement/accessory/components/accessoryList.vue';
|
|
|
|
|
+ import outboundDetailsDialog from './outboundDetailsDialog.vue';
|
|
|
|
|
+ import innerBoundDetails from '@/BIZComponents/innerdetails.vue';
|
|
|
|
|
+
|
|
|
|
|
+ const defForm = {
|
|
|
|
|
+ code: '',
|
|
|
|
|
+ name: '',
|
|
|
|
|
+ sparePartsApplyId: '',
|
|
|
|
|
+ sparePartsApplyCode: '',
|
|
|
|
|
+ workOrderId: '',
|
|
|
|
|
+ remark: '',
|
|
|
|
|
+ detailList: []
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ export default {
|
|
|
|
|
+ props: {},
|
|
|
|
|
+ components: {
|
|
|
|
|
+ accessoryList,
|
|
|
|
|
+ outboundDetailsDialog,
|
|
|
|
|
+ bpmDetail,
|
|
|
|
|
+ innerBoundDetails
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ loading: false,
|
|
|
|
|
+ title: '新增',
|
|
|
|
|
+ editRepairNotesDialog: false,
|
|
|
|
|
+ outboundDetailsDialogFlag: false,
|
|
|
|
|
+ activeComp: 'main',
|
|
|
|
|
+ tabOptions: [
|
|
|
|
|
+ { key: 'main', name: '发货单详情' },
|
|
|
|
|
+ { key: 'bpm', name: '流程详情' },
|
|
|
|
|
+ { key: 'store', name: '入库单详情' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ type: 'add',
|
|
|
|
|
+ form: {
|
|
|
|
|
+ ...defForm
|
|
|
|
|
+ },
|
|
|
|
|
+ columns: [
|
|
|
|
|
+ {
|
|
|
|
|
+ width: 45,
|
|
|
|
|
+ type: 'index',
|
|
|
|
|
+ columnKey: 'index',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ fixed: 'left'
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+ minWidth: 160,
|
|
|
|
|
+ prop: 'categoryCode',
|
|
|
|
|
+ label: '编码',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ align: 'center'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ minWidth: 120,
|
|
|
|
|
+ prop: 'categoryName',
|
|
|
|
|
+ label: '名称',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ align: 'center'
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+ minWidth: 160,
|
|
|
|
|
+ prop: 'batchNo',
|
|
|
|
|
+ label: '批次号',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ slot: 'batchNo',
|
|
|
|
|
+ align: 'center'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ minWidth: 150,
|
|
|
|
|
+ prop: 'measureQuantity',
|
|
|
|
|
+ slot: 'measureQuantity',
|
|
|
|
|
+ label: '归还数量',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ align: 'center'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ minWidth: 150,
|
|
|
|
|
+ prop: 'measureUnit',
|
|
|
|
|
+ label: '计量单位',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ align: 'center'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ minWidth: 160,
|
|
|
|
|
+ prop: 'sendCode',
|
|
|
|
|
+ label: '发货条码',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ slot: 'barcodes',
|
|
|
|
|
+ align: 'center'
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ {
|
|
|
|
|
+ minWidth: 160,
|
|
|
|
|
+ prop: 'packageNo',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ label: '包装编码',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ minWidth: 160,
|
|
|
|
|
+ prop: 'categoryModel',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ label: '型号',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ minWidth: 160,
|
|
|
|
|
+ prop: 'specification',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ label: '规格',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ minWidth: 160,
|
|
|
|
|
+ prop: 'brandNum',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ label: '牌号',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ columnKey: 'action',
|
|
|
|
|
+ slot: 'action',
|
|
|
|
|
+ label: '操作',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ width: 130,
|
|
|
|
|
+ resizable: false,
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ }
|
|
|
|
|
+ // {
|
|
|
|
|
+ // minWidth: 120,
|
|
|
|
|
+ // prop: 'packingUnit',
|
|
|
|
|
+ // align: 'center',
|
|
|
|
|
+ // label: '包装单位',
|
|
|
|
|
+ // showOverflowTooltip: true
|
|
|
|
|
+ // },
|
|
|
|
|
+ ]
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ async init(row, type, isPage) {
|
|
|
|
|
+ this.editRepairNotesDialog = true;
|
|
|
|
|
+ this.activeComp = 'main';
|
|
|
|
|
+
|
|
|
|
|
+ this.type = type;
|
|
|
|
|
+ this.title = type == 'add' ? '新增' : type == 'edit' ? '编辑' : '详情';
|
|
|
|
|
+ if (isPage) {
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.changeSelect(row);
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (row?.id) {
|
|
|
|
|
+ this.getDetail(row);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ async getDetail(row) {
|
|
|
|
|
+ this.form = await getById(row.id);
|
|
|
|
|
+ },
|
|
|
|
|
+ handleTag(val) {
|
|
|
|
|
+ this.activeComp = val;
|
|
|
|
|
+ if (val == 'store') {
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.$refs.innerBoundDetailsRef._getInfo(this.form.code);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ changeSelect(row) {
|
|
|
|
|
+ this.form.sparePartsApplyCode = row.code;
|
|
|
|
|
+ this.form.sparePartsApplyId = row.id;
|
|
|
|
|
+ this.form.workOrderId = row.repairId;
|
|
|
|
|
+
|
|
|
|
|
+ this.openOutbound(row);
|
|
|
|
|
+ },
|
|
|
|
|
+ del(index) {
|
|
|
|
|
+ this.form.detailList.splice(index, 1);
|
|
|
|
|
+ },
|
|
|
|
|
+ openOutbound(row) {
|
|
|
|
|
+ this.outboundDetailsDialogFlag = true;
|
|
|
|
|
+ if (!row.code) {
|
|
|
|
|
+ this.$message.warning('请选择配件申请单');
|
|
|
|
|
+
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.$refs.outboundDetailsDialogRef.init(row);
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ saveDate(list) {
|
|
|
|
|
+ this.form.detailList = list.map((item) => {
|
|
|
|
|
+ item.id = '';
|
|
|
|
|
+ return item;
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log(list);
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ handleClose() {
|
|
|
|
|
+ this.editRepairNotesDialog = false;
|
|
|
|
|
+ this.form = {
|
|
|
|
|
+ ...defForm
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ async save() {
|
|
|
|
|
+ if (this.form.detailList.length == 0) {
|
|
|
|
|
+ this.$message.warning('请至少添加一条归还配件明细');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$refs.recyleFormRef.validate(async (valid) => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ const requestName = this.type == 'add' ? save : update;
|
|
|
|
|
+ const res = await requestName(this.form);
|
|
|
|
|
+ if (res) {
|
|
|
|
|
+ this.$message.success('操作成功');
|
|
|
|
|
+ this.handleClose();
|
|
|
|
|
+ this.$emit('refresh');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
|
+ .device_name {
|
|
|
|
|
+ .el-select-dropdown__wrap {
|
|
|
|
|
+ .el-select-dropdown__item {
|
|
|
|
|
+ padding: 0 !important;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .option_ {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ padding: 0 20px;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+</style>
|