|
@@ -2,7 +2,7 @@
|
|
|
<div class="tenant">
|
|
|
<byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading"
|
|
|
:selectConfig="selectConfig" :action-list="actionList" @get-list="getList"
|
|
|
- @moreSearch="() => queryDialogVisible = true">
|
|
|
+ @moreSearch="() => queryDialogVisible = true" :table-events="tableEvents">
|
|
|
</byTable>
|
|
|
|
|
|
<!--高级搜索-->
|
|
@@ -24,7 +24,8 @@
|
|
|
|
|
|
<el-form label-position="right" label-width="auto">
|
|
|
<el-form-item label="报废数量">
|
|
|
- <el-input-number v-model="formData.scrappedCount" style="width: 100%" :controls="false" disabled></el-input-number>
|
|
|
+ <el-input-number v-model="formData.scrappedCount" style="width: 100%" :controls="false"
|
|
|
+ disabled></el-input-number>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="转良品数量">
|
|
|
<el-input-number v-model="formData.scrappedToQualifiedCount" style="width: 100%" :controls="false" :min="0"
|
|
@@ -46,6 +47,39 @@
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <el-dialog title="批量处理" v-model="batchVisible" width="1200px" destroy-on-close>
|
|
|
+
|
|
|
+ <el-table :data="handleSelectData">
|
|
|
+ <el-table-column prop="code" label="质检单号"/>
|
|
|
+ <el-table-column prop="productCustomCode" label="物品编码"/>
|
|
|
+ <el-table-column prop="productName" label="物品名称"/>
|
|
|
+ <el-table-column prop="scrappedCount" label="报废数量"/>
|
|
|
+ <el-table-column prop="scrappedToQualifiedCount" label="报废转良品数量">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-input-number v-model="scope.row.scrappedToQualifiedCount" style="width: 100%" :controls="false" :min="0"
|
|
|
+ :max="scope.row.scrappedCount" :precision="0"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="scrappedToDefectiveCount" label="报废转次品数量">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-input-number v-model="scope.row.scrappedToDefectiveCount" style="width: 100%" :controls="false" :min="0"
|
|
|
+ :max="scope.row.scrappedCount" :precision="0"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="resultScrappedCount" label="最终报废数量">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-input-number v-model="scope.row.resultScrappedCount" style="width: 100%" :controls="false" :min="0"
|
|
|
+ :max="scope.row.scrappedCount" :precision="0"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="batchVisible = false" size="large">取消</el-button>
|
|
|
+ <el-button @click="batchSubmit" type="primary" size="large">确定</el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -58,30 +92,86 @@ const {proxy} = getCurrentInstance();
|
|
|
const loading = ref(false);
|
|
|
|
|
|
const visible = ref(false);
|
|
|
+const batchVisible = ref(false);
|
|
|
const queryDialogVisible = ref(false);
|
|
|
|
|
|
const formData = ref({})
|
|
|
|
|
|
+const selectData = ref([]);
|
|
|
+const handleSelectData = ref([]);
|
|
|
+
|
|
|
const sourceList = ref({
|
|
|
data: [],
|
|
|
pagination: {
|
|
|
total: 0,
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
+ scrappedHandleStatus: undefined
|
|
|
},
|
|
|
});
|
|
|
|
|
|
-const selectConfig = computed(() => {
|
|
|
- return [];
|
|
|
-});
|
|
|
+const tableEvents = computed(() => {
|
|
|
+ return {
|
|
|
+ 'selection-change': (val) => {
|
|
|
+ selectData.value = val;
|
|
|
+
|
|
|
+ handleSelectData.value = []
|
|
|
+ selectData.value.forEach(item => {
|
|
|
+ handleSelectData.value.push({...item, resultScrappedCount: item.scrappedCount})
|
|
|
+ });
|
|
|
+ },
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+const selectConfig = ref([
|
|
|
+ {
|
|
|
+ label: "状态",
|
|
|
+ prop: "scrappedHandleStatus",
|
|
|
+ data: [
|
|
|
+ {
|
|
|
+ label: "待处理",
|
|
|
+ value: "1",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "待验证",
|
|
|
+ value: "2",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "已验证",
|
|
|
+ value: "3",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: "项目组",
|
|
|
+ prop: "deptId",
|
|
|
+ },
|
|
|
+
|
|
|
+]);
|
|
|
+
|
|
|
|
|
|
const actionList = computed(() => {
|
|
|
- return []
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ text: '批量处理',
|
|
|
+ disabled: selectData.value.length === 0,
|
|
|
+ action: () => {
|
|
|
+ batchVisible.value = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
});
|
|
|
|
|
|
const config = computed(() => {
|
|
|
return [
|
|
|
{
|
|
|
+ type: "selection",
|
|
|
+ attrs: {
|
|
|
+ checkAtt: "isCheck",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
attrs: {
|
|
|
label: "质检单号",
|
|
|
prop: "code",
|
|
@@ -155,15 +245,31 @@ const config = computed(() => {
|
|
|
case 1:
|
|
|
return '待处理'
|
|
|
case 2:
|
|
|
- return '待确认'
|
|
|
+ return '待验证'
|
|
|
case 3:
|
|
|
- return '已确认'
|
|
|
+ return '已验证'
|
|
|
}
|
|
|
return '未知状态';
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
+ label: "生成时间",
|
|
|
+ prop: "createTime",
|
|
|
+ align: "left",
|
|
|
+ width: 160
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "处理时间",
|
|
|
+ prop: "scrappedHandleTime",
|
|
|
+ align: "left",
|
|
|
+ width: 160
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
label: "操作",
|
|
|
align: "center",
|
|
|
fixed: "right",
|
|
@@ -190,6 +296,22 @@ const config = computed(() => {
|
|
|
];
|
|
|
});
|
|
|
|
|
|
+const getDeptList = () => {
|
|
|
+ proxy.get("/jdRefundQualityCheck/deptList", {})
|
|
|
+ .then(({data}) => {
|
|
|
+ console.log(data)
|
|
|
+ selectConfig.value[1].data = data.map((item) => {
|
|
|
+ return {
|
|
|
+ label: item.deptName,
|
|
|
+ value: item.deptId,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ })
|
|
|
+
|
|
|
+ selectConfig.value = JSON.parse(JSON.stringify(selectConfig.value));
|
|
|
+}
|
|
|
+getDeptList();
|
|
|
+
|
|
|
const getList = async (req) => {
|
|
|
loading.value = true;
|
|
|
|
|
@@ -207,6 +329,12 @@ const getList = async (req) => {
|
|
|
.then(({data}) => {
|
|
|
sourceList.value.data = data.rows;
|
|
|
sourceList.value.pagination.total = data.total;
|
|
|
+
|
|
|
+ for (let item of sourceList.value.data) {
|
|
|
+ if (item.scrappedHandleStatus === 1) {
|
|
|
+ item.isCheck = true
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
.finally(_ => {
|
|
|
loading.value = false;
|
|
@@ -228,7 +356,7 @@ const handleQuery = () => {
|
|
|
};
|
|
|
|
|
|
const submit = () => {
|
|
|
- const {scrappedCount,scrappedToQualifiedCount,scrappedToDefectiveCount,resultScrappedCount} = formData.value
|
|
|
+ const {scrappedCount, scrappedToQualifiedCount, scrappedToDefectiveCount, resultScrappedCount} = formData.value
|
|
|
if (scrappedCount !== scrappedToQualifiedCount + scrappedToDefectiveCount + resultScrappedCount) {
|
|
|
ElMessage.error("转良品数量+转次品数量+最终报废数量 必须等于 报废数量")
|
|
|
return
|
|
@@ -241,6 +369,22 @@ const submit = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+const batchSubmit = () => {
|
|
|
+ for (let item of handleSelectData.value) {
|
|
|
+ const {scrappedCount, scrappedToQualifiedCount, scrappedToDefectiveCount, resultScrappedCount} = item
|
|
|
+ if (scrappedCount !== scrappedToQualifiedCount + scrappedToDefectiveCount + resultScrappedCount) {
|
|
|
+ ElMessage.error(`产品【${item.productCustomCode}】转良品数量+转次品数量+最终报废数量 必须等于 报废数量`)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ proxy.post("/jdRefundQualityCheck/batchHandle", handleSelectData.value)
|
|
|
+ .then(() => {
|
|
|
+ ElMessage.success("批量处理成功")
|
|
|
+ batchVisible.value = false;
|
|
|
+ getList()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
getList();
|
|
|
|
|
|
</script>
|