|
@@ -37,9 +37,58 @@
|
|
|
>
|
|
|
</template>
|
|
|
<template #menu-left>
|
|
|
- <div id="charts"></div>
|
|
|
+ <div id="charts" style="margin-bottom: 10px"></div>
|
|
|
+ <el-button
|
|
|
+ v-hasPerm="[buttonPermission.PLAN.BTNS.plan_task_batchUpdate]"
|
|
|
+ :disabled="toDeleteIds.length < 1"
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ :size="size"
|
|
|
+ @click="updateStation"
|
|
|
+ >工位修改</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
+ <el-dialog
|
|
|
+ v-model="centerDialogVisible"
|
|
|
+ title="批量修改工位类型"
|
|
|
+ width="500"
|
|
|
+ align-center
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ :model="tmpForm"
|
|
|
+ ref="tempForm"
|
|
|
+ label-width="auto"
|
|
|
+ style="max-width: 800px"
|
|
|
+ :rules="rules"
|
|
|
+ >
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="工位类型" prop="stationType">
|
|
|
+ <el-select
|
|
|
+ v-model="tmpForm.stationType"
|
|
|
+ filterable
|
|
|
+ placeholder="请选择工位类型"
|
|
|
+ style="width: 240px"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in dicts.station_type"
|
|
|
+ :key="item.dictValue"
|
|
|
+ :label="item.dictLabel"
|
|
|
+ :value="item.dictValue"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button @click="centerDialogVisible = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="submitStation()"> 确定 </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
@@ -51,10 +100,30 @@ import { getUserList } from "@/api/system/user";
|
|
|
import { useDictionaryStore } from "@/store";
|
|
|
import { getStatistics } from "@/api/order/index";
|
|
|
import * as echarts from "echarts";
|
|
|
+import { updateStationTask } from "@/api/plan";
|
|
|
+import buttonPermission from "@/common/configs/buttonPermission";
|
|
|
|
|
|
// 数据字典相关
|
|
|
const { dicts } = useDictionaryStore();
|
|
|
+const tempForm = ref("tempForm");
|
|
|
+const tmpForm = ref({});
|
|
|
|
|
|
+const submitStation = () => {
|
|
|
+ tempForm.value.validate((isValid, invalidFields) => {
|
|
|
+ if (isValid) {
|
|
|
+ tmpForm.value.ids = toDeleteIds.value;
|
|
|
+ updateStationTask(tmpForm.value).then((data) => {
|
|
|
+ if (data.code === "200") {
|
|
|
+ centerDialogVisible.value = false;
|
|
|
+ ElMessage.success(data.msg);
|
|
|
+ dataList();
|
|
|
+ } else {
|
|
|
+ ElMessage.error(data.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
// 传入一个url,后面不带/
|
|
|
const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
|
useCrud({
|
|
@@ -69,11 +138,24 @@ const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
const stationList = ref([]);
|
|
|
const userList = ref([]);
|
|
|
const charts = shallowRef(null);
|
|
|
+const centerDialogVisible = ref(false);
|
|
|
+const updateStation = () => {
|
|
|
+ //console.log(toDeleteIds.value);
|
|
|
+
|
|
|
+ centerDialogVisible.value = true;
|
|
|
+};
|
|
|
const handleEdit = (row, index) => {
|
|
|
queryStationByLineId(row.productLineId).then((data) => {
|
|
|
stationList.value = data.data;
|
|
|
});
|
|
|
- option.value.column[0].display = true;
|
|
|
+ option.value.column.forEach((item) => {
|
|
|
+ if (item.prop === "allocationUser") {
|
|
|
+ item.display = false;
|
|
|
+ } else {
|
|
|
+ item.display = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ /*option.value.column[0].display = true;
|
|
|
option.value.column[2].display = true;
|
|
|
option.value.column[3].display = false;
|
|
|
option.value.column[9].display = true;
|
|
@@ -85,7 +167,7 @@ const handleEdit = (row, index) => {
|
|
|
option.value.column[10].display = true;
|
|
|
option.value.column[11].display = true;
|
|
|
option.value.column[12].display = true;
|
|
|
- option.value.column[13].display = true;
|
|
|
+ option.value.column[13].display = true;*/
|
|
|
crudRef.value && crudRef.value.rowEdit(row, index);
|
|
|
};
|
|
|
|
|
@@ -93,7 +175,14 @@ const doEdit = (row, index) => {
|
|
|
getUserList({}).then((data) => {
|
|
|
userList.value = data.data;
|
|
|
});
|
|
|
- option.value.column[0].display = false;
|
|
|
+ option.value.column.forEach((item) => {
|
|
|
+ if (item.prop === "allocationUser" || item.prop === "operationName") {
|
|
|
+ item.display = true;
|
|
|
+ } else {
|
|
|
+ item.display = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ /*option.value.column[0].display = false;
|
|
|
option.value.column[1].display = false;
|
|
|
option.value.column[2].display = false;
|
|
|
option.value.column[3].display = true;
|
|
@@ -106,12 +195,11 @@ const doEdit = (row, index) => {
|
|
|
option.value.column[10].display = false;
|
|
|
option.value.column[11].display = false;
|
|
|
option.value.column[12].display = false;
|
|
|
- option.value.column[13].display = false;
|
|
|
+ option.value.column[13].display = false;*/
|
|
|
crudRef.value && crudRef.value.rowEdit(row, index);
|
|
|
};
|
|
|
onMounted(() => {
|
|
|
charts.value = echarts.init(document.getElementById("charts"));
|
|
|
-
|
|
|
dataList();
|
|
|
|
|
|
getStatistics(search.value).then((res) => {
|
|
@@ -146,10 +234,19 @@ onMounted(() => {
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
-
|
|
|
+const rules = reactive({
|
|
|
+ stationType: [
|
|
|
+ // required是否必填,message不符合此规则时的提示信息,
|
|
|
+ // trigger触发此条规则校验的时机,有两个值, blur 或 change,默认就是blur和change都会进行校验
|
|
|
+ // min此字段的最小长度,max此字段的最大长度
|
|
|
+ // pattern 正则表达式
|
|
|
+ { required: true, message: "工位类型不能为空", trigger: "blur" },
|
|
|
+ ],
|
|
|
+});
|
|
|
// 设置表格列或者其他自定义的option
|
|
|
option.value = Object.assign(option.value, {
|
|
|
selection: true,
|
|
|
+ reserveSelection: true,
|
|
|
menu: true,
|
|
|
menuWidth: 160,
|
|
|
addBtn: false,
|
|
@@ -160,6 +257,11 @@ option.value = Object.assign(option.value, {
|
|
|
editBtn: false,
|
|
|
viewBtn: false,
|
|
|
delBtn: false,
|
|
|
+ selectable: function (row, index) {
|
|
|
+ if (row.state === "0" || row.state === "-1") {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ },
|
|
|
column: [
|
|
|
{
|
|
|
label: "管号",
|
|
@@ -167,13 +269,13 @@ option.value = Object.assign(option.value, {
|
|
|
editDisabled: true,
|
|
|
search: true,
|
|
|
},
|
|
|
- {
|
|
|
+ /* {
|
|
|
label: "工位名称",
|
|
|
prop: "stationName",
|
|
|
//search: true,
|
|
|
hide: true,
|
|
|
display: false,
|
|
|
- },
|
|
|
+ },*/
|
|
|
/*{
|
|
|
label: "工位名称",
|
|
|
hide: true,
|