Merge remote-tracking branch 'origin/0.8.X' into 0.8.X
This commit is contained in:
@@ -70,10 +70,13 @@
|
||||
<div class="list-body">
|
||||
<div v-for="row in contractList" :key="row.contractId" class="list-item"
|
||||
style="padding: 10px; border-bottom: 2px solid #dddddd; cursor: pointer;"
|
||||
:class="{ 'list-item-active': selectedRow === row }" @click="handleRowClick(row)">
|
||||
:class="{ 'list-item-active': selectedRow === row, 'list-item-top': row.isTop }" @click="handleRowClick(row)">
|
||||
<!-- 合同名称和编号 -->
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;">
|
||||
<div style="display: flex; align-items: center; gap: 8px;">
|
||||
<el-tag v-if="row.isTop" type="warning" size="mini" effect="dark">置顶</el-tag>
|
||||
<div style="font-weight: bold;">{{ row.contractName }}</div>
|
||||
</div>
|
||||
<div style="font-size: 12px; color: #606266;">{{ row.contractCode }}</div>
|
||||
</div>
|
||||
|
||||
@@ -103,6 +106,7 @@
|
||||
|
||||
<!-- 操作按钮独占一行 -->
|
||||
<div style="display: flex; gap: 10px; padding-top: 8px; border-top: 1px dashed #f0f0f0;">
|
||||
<el-button size="mini" type="text" :icon="row.isTop ? 'el-icon-top' : 'el-icon-s-operation'" @click.stop="handleToggleTop(row)">{{ row.isTop ? '取消置顶' : '置顶' }}</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-download" @click.stop="handleExport(row)">导出</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click.stop="$emit('update', row)">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click.stop="$emit('delete', row)">删除</el-button>
|
||||
@@ -121,7 +125,6 @@
|
||||
|
||||
<script>
|
||||
import { listOrder, updateOrder } from "@/api/crm/order";
|
||||
import { listOrderItem } from '@/api/crm/orderItem'
|
||||
import * as ExcelJS from 'exceljs';
|
||||
import { saveAs } from 'file-saver';
|
||||
|
||||
@@ -168,6 +171,17 @@ export default {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 切换置顶状态 */
|
||||
handleToggleTop(row) {
|
||||
const newTopStatus = row.isTop ? 0 : 1;
|
||||
updateOrder({ ...row, isTop: newTopStatus }).then(response => {
|
||||
this.$message({
|
||||
message: newTopStatus ? "置顶成功" : "取消置顶成功",
|
||||
type: "success"
|
||||
});
|
||||
this.getList();
|
||||
})
|
||||
},
|
||||
/** 状态变更 */
|
||||
handleChangeStatus(row) {
|
||||
updateOrder(row).then(response => {
|
||||
@@ -814,6 +828,15 @@ export default {
|
||||
border-left: 3px solid #409eff;
|
||||
}
|
||||
|
||||
.list-item-top {
|
||||
background-color: #fff7e6;
|
||||
border-left: 3px solid #e6a23c;
|
||||
}
|
||||
|
||||
.list-item-top:hover {
|
||||
background-color: #ffebcc;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1200px) {
|
||||
.list-header {
|
||||
font-size: 12px;
|
||||
|
||||
@@ -79,6 +79,11 @@
|
||||
<el-input v-model="form.signLocation" placeholder="请输入签订地点" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="置顶" prop="isTop">
|
||||
<el-switch v-model="form.isTop" :active-value="1" :inactive-value="0"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="产品内容">
|
||||
@@ -452,6 +457,7 @@ export default {
|
||||
productionSchedule: undefined,
|
||||
status: 0,
|
||||
remark: undefined,
|
||||
isTop: 0,
|
||||
createBy: undefined,
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
</el-form>
|
||||
|
||||
<abnormal-table ref="abnormalTable" :list="coilAbnormalList"
|
||||
:editable="true" :show-coil="false"
|
||||
:editable="true" :show-coil="false" :coil-info="currentCoil"
|
||||
@delete="handleDelete" @update="handleUpdate">
|
||||
</abnormal-table>
|
||||
|
||||
|
||||
@@ -34,6 +34,13 @@
|
||||
<dict-tag :options="dict.type.coil_abnormal_degree" :value="scope.row.degree" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建人" align="center" prop="createBy" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="挂载时机" align="center" prop="abnormalTime" v-if="coilInfo.coilId">
|
||||
<template slot-scope="scope">
|
||||
{{ getAbnormalTime(scope.row) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="editable">
|
||||
<template slot-scope="scope">
|
||||
@@ -60,6 +67,10 @@ export default {
|
||||
showCoil: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
coilInfo: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -76,6 +87,22 @@ export default {
|
||||
if (this.editable) {
|
||||
this.$emit('update', row);
|
||||
}
|
||||
},
|
||||
// 计算目标列的异常挂载时机
|
||||
// 如果coilInfo.coilId存在,且与row.coilId相同,
|
||||
// 判断钢卷的createBy和row.createBy是否相同
|
||||
// 判断钢卷的createTime与row的createTime是否在一分钟内
|
||||
// 如果是,返回'生产时'
|
||||
// 如果否,返回'补录'
|
||||
getAbnormalTime(row) {
|
||||
if (this.coilInfo.coilId === row.coilId) {
|
||||
if (this.coilInfo.createBy === row.createBy) {
|
||||
if (Math.abs(new Date(this.coilInfo.createTime) - new Date(row.createTime)) < 60 * 1000) {
|
||||
return '生产时'
|
||||
}
|
||||
}
|
||||
}
|
||||
return '补录'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +82,11 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="主缺陷" prop="mainMark" width="60">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox v-model="scope.row.mainMark" :true-label="1" :false-label="0"></el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="scope.row.abnormalId" type="text" size="mini" @click="handleDelete(scope.row)" style="color: #f56c6c;">
|
||||
@@ -92,11 +97,6 @@
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="主缺陷" prop="mainMark" width="60">
|
||||
<template slot-scope="scope">
|
||||
<el-checkbox v-model="scope.row.mainMark" :true-label="1" :false-label="0"></el-checkbox>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -725,7 +725,7 @@
|
||||
<span class="section-title">异常信息</span>
|
||||
</div>
|
||||
<div class="section-body">
|
||||
<abnormal-table ref="abnormalTable" :list="abmornalList" :editable="false" :show-coil="false" />
|
||||
<abnormal-table ref="abnormalTable" :list="abmornalList" :editable="false" :show-coil="false" :coil-info="coilInfo" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</el-form>
|
||||
|
||||
<abnormal-table v-loading="loading" ref="abnormalTable" :list="coilAbnormalList"
|
||||
:editable="true" :show-coil="false"
|
||||
:editable="true" :show-coil="false" :coil-info="coilInfo"
|
||||
@delete="handleDelete" @update="handleUpdate">
|
||||
</abnormal-table>
|
||||
|
||||
|
||||
@@ -51,7 +51,8 @@
|
||||
<!-- 质量状态,点击后会出现弹窗显示详细信息 -->
|
||||
<template v-else-if="column.prop === 'qualityStatus'">
|
||||
<div @click="handleQualityStatusClick(scope.row)" style="cursor: pointer; background-color: #f5f7fa;">
|
||||
<dict-tag :options="dict.type.coil_quality_status" :value="scope.row.qualityStatus"></dict-tag>
|
||||
<dict-tag v-if="scope.row.qualityStatus" :options="dict.type.coil_quality_status" :value="scope.row.qualityStatus"></dict-tag>
|
||||
<span v-else>暂未判级</span>
|
||||
</div>
|
||||
</template>
|
||||
<!-- 默认渲染 -->
|
||||
@@ -64,7 +65,7 @@
|
||||
|
||||
<el-dialog title="钢卷异常信息" :visible.sync="abmornal.visible" width="60%">
|
||||
<abnormal-table ref="abnormalTable" :list="abmornal.data"
|
||||
:editable="false" :show-coil="false" v-loading="abmornal.loading">
|
||||
:editable="false" :show-coil="false" :coil-info="abmornal.currentCoil" v-loading="abmornal.loading">
|
||||
</abnormal-table>
|
||||
</el-dialog>
|
||||
</div>
|
||||
@@ -123,6 +124,7 @@ export default {
|
||||
visible: false,
|
||||
data: {},
|
||||
loading: false,
|
||||
currentCoil: {},
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -239,6 +241,7 @@ export default {
|
||||
handleQualityStatusClick(row) {
|
||||
this.abmornal.visible = true
|
||||
this.abmornal.loading = true
|
||||
this.abmornal.currentCoil = row
|
||||
listCoilAbnormal({
|
||||
coilId: row.coilId
|
||||
}).then(response => {
|
||||
|
||||
Reference in New Issue
Block a user