From 5f18876241777adb7cacce4bc8316779cb16c237 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期五, 03 四月 2026 10:04:58 +0800
Subject: [PATCH] 生产报表联调,并优化页面
---
src/views/consumablesLogistics/dispatchLog/Record.vue | 145 ++++++++++++++++++++++++++++++++++++-----------
1 files changed, 110 insertions(+), 35 deletions(-)
diff --git a/src/views/consumablesLogistics/dispatchLog/Record.vue b/src/views/consumablesLogistics/dispatchLog/Record.vue
index d47db1e..ebbc8f9 100644
--- a/src/views/consumablesLogistics/dispatchLog/Record.vue
+++ b/src/views/consumablesLogistics/dispatchLog/Record.vue
@@ -12,24 +12,29 @@
clearable
@change="handleQuery"
/>
- <span class="search_title ml10">鏉ユ簮锛�</span>
- <el-select v-model="searchForm.recordType"
- style="width: 240px"
- placeholder="璇烽�夋嫨"
- clearable>
- <el-option v-for="item in stockRecordTypeOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value"/>
- </el-select>
+<!-- <span class="search_title ml10">鏉ユ簮锛�</span>-->
+<!-- <el-select v-model="searchForm.recordType"-->
+<!-- style="width: 240px"-->
+<!-- placeholder="璇烽�夋嫨"-->
+<!-- clearable>-->
+<!-- <el-option v-for="item in stockRecordTypeOptions"-->
+<!-- :key="item.value"-->
+<!-- :label="item.label"-->
+<!-- :value="item.value"/>-->
+<!-- </el-select>-->
<el-button type="primary" @click="handleQuery" style="margin-left: 10px"
>鎼滅储</el-button
>
</div>
<div>
<el-button @click="handleOut">瀵煎嚭</el-button>
- <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
- <el-button type="primary" plain @click="handlePrint">鎵撳嵃</el-button>
+ <el-button
+ type="danger"
+ plain
+ @click="handleDelete"
+ v-if="hasCDispatchCancel"
+ >鍒犻櫎</el-button>
+ <!-- <el-button type="primary" plain @click="handlePrint">鎵撳嵃</el-button> -->
</div>
</div>
<div class="table_list">
@@ -72,41 +77,38 @@
show-overflow-tooltip
/>
<el-table-column
- label="鍑哄簱鏁伴噺"
- prop="stockOutNum"
+ label="鏁伴噺"
+ prop="qualitity"
show-overflow-tooltip
/>
- <el-table-column
- label="鍑�閲�(鍚�)"
- prop="netWeight"
+ <!-- <el-table-column
+ label="閲囪喘鍛�"
+ prop="purchaser"
show-overflow-tooltip
- />
+ /> -->
<el-table-column
label="鍑哄簱浜�"
prop="createBy"
show-overflow-tooltip
/>
- <el-table-column label="鏉ユ簮"
+ <el-table-column label="鎿嶄綔" width="160" align="center">
+ <template #default="scope">
+ <el-button
+ v-if="hasCDispatchEdit"
+ type="primary"
+ size="mini"
+ @click="handleEdit(scope.row)"
+ >缂栬緫</el-button>
+ </template>
+ </el-table-column>
+ <!-- <el-table-column label="鏉ユ簮"
prop="recordType"
show-overflow-tooltip>
<template #default="scope">
{{ getRecordType(scope.row.recordType) }}
</template>
- </el-table-column>
- <el-table-column
- label="杞︾墝"
- prop="licensePlateNo"
- show-overflow-tooltip
- />
- <el-table-column label="鎿嶄綔"
- width="120"
- align="center">
- <template #default="scope">
- <el-button type="primary"
- size="mini"
- @click="handlePreview(scope.row)">瀵煎嚭杩囩鍗�</el-button>
- </template>
- </el-table-column>
+ </el-table-column> -->
+ <!-- 涓嶅啀灞曠ず杩囩鐩稿叧瀛楁涓庡鍑烘搷浣� -->
</el-table>
<pagination
v-show="total > 0"
@@ -118,21 +120,56 @@
/>
</div>
</div>
+
+ <el-dialog
+ title="缂栬緫鍑哄簱淇℃伅"
+ v-model="isShowEditModal"
+ width="600px"
+ >
+ <el-form
+ ref="editFormRef"
+ :model="editForm"
+ label-width="90px"
+ >
+ <el-form-item
+ label="鏁伴噺"
+ prop="qualitity"
+ :rules="[{ required: true, message: '璇疯緭鍏ユ暟閲�', trigger: ['blur', 'change'] }]"
+ >
+ <el-input-number
+ v-model="editForm.qualitity"
+ :min="0"
+ :step="1"
+ :precision="0"
+ controls-position="right"
+ style="width: 100%"
+ placeholder="璇疯緭鍏ユ暟閲�"
+ />
+ </el-form-item>
+ </el-form>
+
+ <template #footer>
+ <el-button @click="closeEditModal">鍙栨秷</el-button>
+ <el-button type="primary" @click="handleEditSubmit">纭畾</el-button>
+ </template>
+ </el-dialog>
</template>
<script setup>
import pagination from "@/components/PIMTable/Pagination.vue";
-import { ref, reactive, toRefs, getCurrentInstance } from "vue";
+import { ref, reactive, toRefs, getCurrentInstance, computed } from "vue";
import { ElMessageBox } from "element-plus";
import useUserStore from "@/store/modules/user";
import { getCurrentDate } from "@/utils/index.js";
import {
getConsumablesOutRecordPage,
delConsumablesOutRecord,
+ editStockOut,
} from "@/api/consumablesLogistics/consumablesOutRecord.js";
import {
findAllQualifiedStockOutRecordTypeOptions, findAllUnQualifiedStockOutRecordTypeOptions,
} from "@/api/basicData/enum.js";
+import { checkPermi } from "@/utils/permission.js";
const userStore = useUserStore();
const { proxy } = getCurrentInstance();
@@ -155,6 +192,44 @@
}
})
+const hasCDispatchEdit = computed(() => checkPermi(['c_dispatch_edit']));
+const hasCDispatchCancel = computed(() => checkPermi(['c_dispatch_cancel']));
+
+// 缂栬緫寮规鏁版嵁
+const isShowEditModal = ref(false);
+const editFormRef = ref();
+const editForm = reactive({
+ id: undefined,
+ qualitity: undefined,
+});
+
+const handleEdit = (row) => {
+ editForm.id = row.id;
+ editForm.qualitity = row.qualitity;
+ isShowEditModal.value = true;
+};
+
+const closeEditModal = () => {
+ isShowEditModal.value = false;
+
+ editForm.id = undefined;
+ editForm.qualitity = undefined;
+
+ editFormRef.value?.clearValidate?.();
+};
+
+const handleEditSubmit = () => {
+ editFormRef.value?.validate?.((valid) => {
+ if (!valid) return;
+ const { purchaser, ...payload } = editForm || {};
+ editStockOut(payload).then(() => {
+ closeEditModal();
+ proxy.$modal.msgSuccess("缂栬緫鎴愬姛");
+ getList();
+ });
+ });
+};
+
// 鎵撳嵃鐩稿叧
const printPreviewVisible = ref(false);
const printData = ref([]);
--
Gitblit v1.9.3