|
@@ -16,7 +16,39 @@
|
|
@current-change="dataList"
|
|
@current-change="dataList"
|
|
@selection-change="selectionChange"
|
|
@selection-change="selectionChange"
|
|
>
|
|
>
|
|
- <template #menu-left="{ size }"> </template>
|
|
|
|
|
|
+ <template #menu="{ row, index, type }">
|
|
|
|
+ <el-button type="primary" link size="small" @click="viewData(row, 0)"
|
|
|
|
+ ><i-ep-view />查看
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="row.state == 0"
|
|
|
|
+ type="primary"
|
|
|
|
+ link
|
|
|
|
+ size="small"
|
|
|
|
+ @click="handleEdit(row, 0)"
|
|
|
|
+ ><i-ep-edit />编辑
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="row.state == 0 && userStore.user.username == row.manager"
|
|
|
|
+ type="primary"
|
|
|
|
+ link
|
|
|
|
+ size="small"
|
|
|
|
+ @click="handle(row, 2)"
|
|
|
|
+ ><i-ep-edit />确认接收
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="
|
|
|
|
+ row.state == 1 &&
|
|
|
|
+ (userStore.user.username == row.alarmManager ||
|
|
|
|
+ userStore.user.username == row.manager)
|
|
|
|
+ "
|
|
|
|
+ type="primary"
|
|
|
|
+ link
|
|
|
|
+ size="small"
|
|
|
|
+ @click="handle(row, 2)"
|
|
|
|
+ ><i-ep-edit />确认接收
|
|
|
|
+ </el-button>
|
|
|
|
+ </template>
|
|
</avue-crud>
|
|
</avue-crud>
|
|
|
|
|
|
<el-dialog
|
|
<el-dialog
|
|
@@ -26,40 +58,56 @@
|
|
@close="dialog.visible = false"
|
|
@close="dialog.visible = false"
|
|
:destroy-on-close="true"
|
|
:destroy-on-close="true"
|
|
>
|
|
>
|
|
- <drawing-page
|
|
|
|
- :materialCode="drawingDetail.materialCode"
|
|
|
|
- :materialName="drawingDetail.materialName"
|
|
|
|
- :dialog="dialog"
|
|
|
|
- />
|
|
|
|
|
|
+ <shortage-detail :shortage="shortage" :dialog="dialog" />
|
|
|
|
+ </el-dialog>
|
|
|
|
+ <el-dialog
|
|
|
|
+ v-model="dialog2.visible"
|
|
|
|
+ :title="dialog2.title"
|
|
|
|
+ width="900px"
|
|
|
|
+ @close="dialog2.visible = false"
|
|
|
|
+ :destroy-on-close="true"
|
|
|
|
+ >
|
|
|
|
+ <shortage-view :shortage="shortage" :dialog="dialog" />
|
|
</el-dialog>
|
|
</el-dialog>
|
|
- <ExcelUpload ref="uploadRef" @finished="uploadFinished" />
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
-<script setup lang="ts">
|
|
|
|
|
|
+<script setup>
|
|
import { ref, getCurrentInstance } from "vue";
|
|
import { ref, getCurrentInstance } from "vue";
|
|
import { useCrud } from "@/hooks/userCrud";
|
|
import { useCrud } from "@/hooks/userCrud";
|
|
import ButtonPermKeys from "@/common/configs/buttonPermission";
|
|
import ButtonPermKeys from "@/common/configs/buttonPermission";
|
|
import {
|
|
import {
|
|
useCommonStoreHook,
|
|
useCommonStoreHook,
|
|
useDictionaryStore,
|
|
useDictionaryStore,
|
|
- useDictionaryStoreHook,
|
|
|
|
|
|
+ useUserStoreHook,
|
|
} from "@/store";
|
|
} from "@/store";
|
|
|
|
+import ShortageDetail from "@/views/plan/shortage/components/shortage-detail.vue";
|
|
|
|
+import { handleShortage } from "@/api/order/index";
|
|
const { isShowTable, tableType } = toRefs(useCommonStoreHook());
|
|
const { isShowTable, tableType } = toRefs(useCommonStoreHook());
|
|
const { dicts } = useDictionaryStore();
|
|
const { dicts } = useDictionaryStore();
|
|
-
|
|
|
|
|
|
+const userStore = useUserStoreHook();
|
|
const test = () => {
|
|
const test = () => {
|
|
isShowTable.value = true;
|
|
isShowTable.value = true;
|
|
tableType.value = tableType.value == 1 ? 2 : 1;
|
|
tableType.value = tableType.value == 1 ? 2 : 1;
|
|
};
|
|
};
|
|
|
|
+const shortage = ref({});
|
|
|
|
+const handleEdit = (row, index) => {
|
|
|
|
+ dialog.visible = true;
|
|
|
|
+ shortage.value = row;
|
|
|
|
+};
|
|
|
|
+const viewData = (row, index) => {
|
|
|
|
+ dialog2.visible = true;
|
|
|
|
+ shortage.value = row;
|
|
|
|
+};
|
|
const dialog = reactive({
|
|
const dialog = reactive({
|
|
- title: "图纸",
|
|
|
|
|
|
+ title: "编辑",
|
|
|
|
+ visible: false,
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+const dialog2 = reactive({
|
|
|
|
+ title: "缺料明细",
|
|
visible: false,
|
|
visible: false,
|
|
});
|
|
});
|
|
const drawingDetail = ref(null);
|
|
const drawingDetail = ref(null);
|
|
-const drawing = (row) => {
|
|
|
|
- drawingDetail.value = row;
|
|
|
|
- dialog.visible = true;
|
|
|
|
-};
|
|
|
|
// 传入一个url,后面不带/
|
|
// 传入一个url,后面不带/
|
|
const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
useCrud({
|
|
useCrud({
|
|
@@ -108,9 +156,24 @@ const importBomExcelData = () => {
|
|
uploadRef.value.show("/api/v1/base/materialBom/bom/import");
|
|
uploadRef.value.show("/api/v1/base/materialBom/bom/import");
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
+const handleData = ref({});
|
|
|
|
+const handle = (row, state) => {
|
|
|
|
+ handleData.value.id = row.id;
|
|
|
|
+ handleData.value.state = state;
|
|
|
|
+ handleShortage(handleData.value).then((data) => {
|
|
|
|
+ if (data.code == "200") {
|
|
|
|
+ dataList();
|
|
|
|
+ ElMessage.success("操作成功");
|
|
|
|
+ } else {
|
|
|
|
+ ElMessage.error(data.message);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+};
|
|
option.value = Object.assign(option.value, {
|
|
option.value = Object.assign(option.value, {
|
|
addBtn: false,
|
|
addBtn: false,
|
|
viewBtn: false,
|
|
viewBtn: false,
|
|
|
|
+ editBtn: false,
|
|
|
|
+ menuWidth: 240,
|
|
column: [
|
|
column: [
|
|
{
|
|
{
|
|
label: "订单号",
|
|
label: "订单号",
|
|
@@ -161,6 +224,8 @@ option.value = Object.assign(option.value, {
|
|
{
|
|
{
|
|
label: "处理时间",
|
|
label: "处理时间",
|
|
prop: "handleTime",
|
|
prop: "handleTime",
|
|
|
|
+ format: "YYYY-MM-DD HH:mm:ss",
|
|
|
|
+ valueFormat: "YYYY-MM-DD HH:mm:ss",
|
|
width: 120,
|
|
width: 120,
|
|
},
|
|
},
|
|
|
|
|