|
@@ -8,15 +8,30 @@
|
|
|
:data="data"
|
|
|
:option="option"
|
|
|
v-model:page="page"
|
|
|
- />
|
|
|
- <!-- <el-collapse accordion>
|
|
|
- <el-collapse-item
|
|
|
- :title="item.opName"
|
|
|
- :name="item.id"
|
|
|
- v-for="item in data"
|
|
|
- :key="item.id"
|
|
|
- />
|
|
|
- </el-collapse> -->
|
|
|
+ @row-update="updateRow"
|
|
|
+ >
|
|
|
+ <template #menu="{ size, row, index }">
|
|
|
+ <el-button
|
|
|
+ v-if="
|
|
|
+ row.equitCode!=undefined && row.equitCode!=null
|
|
|
+ "
|
|
|
+ type="primary"
|
|
|
+ link
|
|
|
+ size="small"
|
|
|
+ @click="doEdit(row,index)"
|
|
|
+ ><i-ep-edit />编辑
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ <el-dialog
|
|
|
+ v-model="dialog.visible"
|
|
|
+ :title="dialog.title"
|
|
|
+ width="850px"
|
|
|
+ @close="dialog.visible = false"
|
|
|
+ :destroy-on-close="true"
|
|
|
+ >
|
|
|
+ <device-page @deviceInfo="deviceInfo" :deviceType="deviceDetail.equitType"/>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
@@ -24,7 +39,7 @@ import { ref, getCurrentInstance } from "vue";
|
|
|
import { useCrud } from "@/hooks/userCrud";
|
|
|
import dictDataUtil from "@/common/configs/dictDataUtil";
|
|
|
import ButtonPermKeys from "@/common/configs/buttonPermission";
|
|
|
-import { useCommonStoreHook, useDictionaryStore } from "@/store";
|
|
|
+import {useCommonStoreHook, useDictionaryStore, useUserStoreHook} from "@/store";
|
|
|
|
|
|
// 数据字典相关
|
|
|
const { dicts } = useDictionaryStore();
|
|
@@ -43,19 +58,44 @@ const {
|
|
|
} = useCrud({
|
|
|
src: "/api/v1/process/web/traceability/equitRecordInfo",
|
|
|
});
|
|
|
+const dialog = reactive({
|
|
|
+ title: "设备选择",
|
|
|
+ visible: false,
|
|
|
+});
|
|
|
const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
|
|
|
Methords; //增删改查
|
|
|
const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
|
const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
|
|
|
|
|
|
-const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
-
|
|
|
+const crudRef2 = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
+const userStore = useUserStoreHook();
|
|
|
const refreshTra = (row) => {
|
|
|
commonConfig.value.params = { seqNo: row.seqNo };
|
|
|
dataList();
|
|
|
};
|
|
|
+const deviceDetail = ref({});
|
|
|
+const doEdit = (row, index) => {
|
|
|
+ crudRef2.value && crudRef2.value.rowEdit(row, index);
|
|
|
+ deviceDetail.value = row;
|
|
|
+};
|
|
|
+
|
|
|
+const deviceInfo = (value) => {
|
|
|
+ form.value.equitCode = value.deviceNo;
|
|
|
+ form.value.equitName =value.deviceName;
|
|
|
+ form.value.validDate = value.meteringDate;
|
|
|
+ form.value.equitId = value.id;
|
|
|
+ dialog.visible = false;
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
defineExpose({ refreshTra });
|
|
|
-onMounted(() => {});
|
|
|
+onMounted(() => {
|
|
|
+ if(userStore.user.userId===10000){
|
|
|
+ option.value.menu=true;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+});
|
|
|
|
|
|
option.value = Object.assign(option.value, {
|
|
|
selection: false,
|
|
@@ -67,6 +107,9 @@ option.value = Object.assign(option.value, {
|
|
|
labelWidth: 100,
|
|
|
addBtn: false,
|
|
|
menu: false,
|
|
|
+ editBtn : false,
|
|
|
+ viewBtn: false,
|
|
|
+ delBtn: false,
|
|
|
header: false,
|
|
|
rowKey: "opId",
|
|
|
column: [
|
|
@@ -79,36 +122,68 @@ option.value = Object.assign(option.value, {
|
|
|
{
|
|
|
label: "工序名称",
|
|
|
prop: "opName",
|
|
|
+ display: false
|
|
|
},
|
|
|
{
|
|
|
label: "设备类型",
|
|
|
prop: "equitType",
|
|
|
search: false,
|
|
|
+ disabled: true,
|
|
|
+ type: "select",
|
|
|
+ dicData: dicts.device_type,
|
|
|
+ props: {
|
|
|
+ label: "dictLabel",
|
|
|
+ value: "dictValue",
|
|
|
+ },
|
|
|
+
|
|
|
},
|
|
|
{
|
|
|
label: "精度要求",
|
|
|
prop: "accuracy",
|
|
|
search: false,
|
|
|
+ disabled: true,
|
|
|
},
|
|
|
{
|
|
|
- label: "设备有效期",
|
|
|
+ label: "设备编码",
|
|
|
+ prop: "equitCode",
|
|
|
+ search: false,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请选择设备编码",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ click: ({ value, column }) => {
|
|
|
+ dialog.visible = true;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "计量有效期",
|
|
|
prop: "validDate",
|
|
|
search: false,
|
|
|
+ disabled: true,
|
|
|
},
|
|
|
{
|
|
|
label: "设备名称",
|
|
|
prop: "equitName",
|
|
|
search: false,
|
|
|
+ disabled: true,
|
|
|
},
|
|
|
{
|
|
|
- label: "设备编码",
|
|
|
- prop: "equitCode",
|
|
|
+ label: "设备id",
|
|
|
+ prop: "equitId",
|
|
|
search: false,
|
|
|
+ display: false,
|
|
|
+ hide: true,
|
|
|
},
|
|
|
{
|
|
|
label: "录入时间",
|
|
|
prop: "created",
|
|
|
search: false,
|
|
|
+ format: 'YYYY-MM-DD HH:mm:ss',
|
|
|
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
+ type: "datetime",
|
|
|
},
|
|
|
],
|
|
|
});
|