|
@@ -1,123 +1,109 @@
|
|
-<!--<template>
|
|
|
|
|
|
+<template>
|
|
|
|
+ <div class="mainContentBox">
|
|
|
|
+ <!--{{dataDetail}}-->
|
|
|
|
+ <!--{{dicts}}-->
|
|
|
|
+ <avue-crud
|
|
|
|
+ ref="crudRef"
|
|
|
|
+ v-model:search="search"
|
|
|
|
+ v-model="form"
|
|
|
|
+ :data="data"
|
|
|
|
+ :option="option"
|
|
|
|
+ @row-update="updateRow"
|
|
|
|
+ @row-del="deleteRow"
|
|
|
|
+ @search-change="searchChange"
|
|
|
|
+ @search-reset="resetChange"
|
|
|
|
+ @selection-change="selectionChange"
|
|
|
|
+ >
|
|
|
|
+ <template #menu-left="{ size }">
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ icon="el-icon-plus"
|
|
|
|
+ circle
|
|
|
|
+ @click="addSkill"
|
|
|
|
+ ></el-button
|
|
|
|
+ ></template>
|
|
|
|
|
|
- <avue-form :option="option"
|
|
|
|
- v-model="form">
|
|
|
|
- <template #input="{row}">
|
|
|
|
|
|
+ <template #footer>
|
|
|
|
+ <div class="detail-footer">
|
|
|
|
+ <el-button type="primary" @click="addList"> 保存 </el-button>
|
|
|
|
+ <el-button @click="cancel">取消</el-button>
|
|
|
|
|
|
- </template>
|
|
|
|
- </avue-form>
|
|
|
|
-</template>
|
|
|
|
-<script ssetup lang="ts">
|
|
|
|
- export default {
|
|
|
|
- data () {
|
|
|
|
- return {
|
|
|
|
- form: {
|
|
|
|
- dynamic: [{
|
|
|
|
- input: 1,
|
|
|
|
- select: 1
|
|
|
|
- }, {
|
|
|
|
- input: 2,
|
|
|
|
- select: 2
|
|
|
|
- }]
|
|
|
|
- },
|
|
|
|
- option: {
|
|
|
|
- column: [
|
|
|
|
- {
|
|
|
|
- label: '技能',
|
|
|
|
- prop: 'dynamic',
|
|
|
|
- type: 'dynamic',
|
|
|
|
- span: 24,
|
|
|
|
- children: {
|
|
|
|
- align: 'center',
|
|
|
|
- headerAlign: 'center',
|
|
|
|
- rowAdd: (done) => {
|
|
|
|
- this.$message.success('新增回调');
|
|
|
|
- done({
|
|
|
|
- input: '默认值'
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- rowDel: (row, done) => {
|
|
|
|
- this.$message.success('删除回调' + JSON.stringify(row));
|
|
|
|
- done();
|
|
|
|
- },
|
|
|
|
- column: [{
|
|
|
|
- label: '选择框',
|
|
|
|
- prop: "select",
|
|
|
|
- type: 'select',
|
|
|
|
- dicData: [{
|
|
|
|
- label: '测试1',
|
|
|
|
- value: 1
|
|
|
|
- }, {
|
|
|
|
- label: '测试2',
|
|
|
|
- value: 2
|
|
|
|
- }]
|
|
|
|
- }]
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </avue-crud>
|
|
|
|
|
|
- ]
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- addAll () {
|
|
|
|
- for (let i = 0; i < 10; i++) {
|
|
|
|
- this.form.dynamic.push({
|
|
|
|
- input: 1,
|
|
|
|
- select: 1
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-</script>-->
|
|
|
|
-
|
|
|
|
-<template>
|
|
|
|
-<avue-form :option="option"
|
|
|
|
- v-model="form">
|
|
|
|
- <template #input="{row}">
|
|
|
|
-
|
|
|
|
- </template>
|
|
|
|
-</avue-form>
|
|
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
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 { useCommonStoreHook } from "@/store";
|
|
|
|
-
|
|
|
|
|
|
+ import { useCommonStoreHook, useDictionaryStoreHook } from "@/store/index";
|
|
|
|
+ import {addPostSkill} from "../../../../api/system/skill";
|
|
const { isShowTable, tableType } = toRefs(useCommonStoreHook());
|
|
const { isShowTable, tableType } = toRefs(useCommonStoreHook());
|
|
- import { useDictionaryStoreHook } from "@/store";
|
|
|
|
|
|
+ // 数据字典相关
|
|
const { dicts } = useDictionaryStoreHook();
|
|
const { dicts } = useDictionaryStoreHook();
|
|
- import {
|
|
|
|
- addStationDevice,
|
|
|
|
- } from "@/api/station";
|
|
|
|
|
|
+ const router = useRouter();
|
|
|
|
+ const route = useRoute();
|
|
|
|
+
|
|
|
|
+ const dataDetail=ref({});
|
|
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 props = defineProps({
|
|
|
|
- postId: {
|
|
|
|
- type: Number,
|
|
|
|
- default: () => {
|
|
|
|
- return 0;
|
|
|
|
|
|
+
|
|
|
|
+ const formData=ref({});
|
|
|
|
+ const dataBomLists=()=>{
|
|
|
|
+ search.value.materialCode=route.value.materialCode;
|
|
|
|
+ dataNoPageList();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ const dialog=ref(null);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ const addList=()=>{
|
|
|
|
+ for(var i=0;i<data.value.length;i++){
|
|
|
|
+ if(data.value[i].skillDictValue==="0"||data.value[i].skillDictValue ===null){
|
|
|
|
+ ElMessage({
|
|
|
|
+ message:"技能选项存在空值",
|
|
|
|
+ type: "error",
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- })
|
|
|
|
-
|
|
|
|
- watch?.(
|
|
|
|
- () => props.postId,
|
|
|
|
- (newVal: string) => {
|
|
|
|
- search.value.postId = newVal
|
|
|
|
- dataList()
|
|
|
|
|
|
+ if(data.value.length===0){
|
|
|
|
+ ElMessage({
|
|
|
|
+ message: "没有添加记录!",
|
|
|
|
+ type: "error",
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
- );
|
|
|
|
|
|
+ addPostSkill(data.value).then(
|
|
|
|
+ (data: any)=>{
|
|
|
|
+ if(data.code==="200") {
|
|
|
|
+ ElMessage({
|
|
|
|
+ message: data.msg,
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ ElMessage({
|
|
|
|
+ message: data.msg,
|
|
|
|
+ type: "error",
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ props.dialog.visible=false;
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ }
|
|
// 传入一个url,后面不带/
|
|
// 传入一个url,后面不带/
|
|
const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
useCrud({
|
|
useCrud({
|
|
src: "/api/v1/sys/postSkill",
|
|
src: "/api/v1/sys/postSkill",
|
|
});
|
|
});
|
|
- const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
|
|
|
|
|
|
+ const { dataNoPageList,createRow, updateRow, deleteRow, searchChange, resetChange } =
|
|
Methords; //增删改查
|
|
Methords; //增删改查
|
|
const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
|
|
const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
|
|
@@ -128,44 +114,101 @@
|
|
// editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
|
|
// editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
|
|
// menu: true,
|
|
// menu: true,
|
|
// });
|
|
// });
|
|
- const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
|
|
|
|
|
|
|
+ const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
|
+ const props = defineProps({
|
|
|
|
+ postId: {
|
|
|
|
+ type: Number,
|
|
|
|
+ default: () => {
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ dialog:{
|
|
|
|
+ type:Object,
|
|
|
|
+ default:()=>{
|
|
|
|
+ return {};
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
// console.log("crudRef", crudRef)
|
|
// console.log("crudRef", crudRef)
|
|
- dataList();
|
|
|
|
|
|
+ search.value.postId=props.postId;
|
|
|
|
+ dataNoPageList();
|
|
|
|
+
|
|
});
|
|
});
|
|
- /* const form=ref({
|
|
|
|
- dynamic: [{
|
|
|
|
- input: 1,
|
|
|
|
- select: 1
|
|
|
|
- }, {
|
|
|
|
- input: 2,
|
|
|
|
- select: 2
|
|
|
|
- }]
|
|
|
|
- });*/
|
|
|
|
|
|
+ const cancel=()=>{
|
|
|
|
+ props.dialog.visible=false;
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * 上传excel相关
|
|
|
|
+ */
|
|
|
|
+ const uploadRef = ref(null);
|
|
|
|
+ const uploadFinished = () => {
|
|
|
|
+ // 上传完成后的刷新操作
|
|
|
|
+ dataNoPageList();
|
|
|
|
+ };
|
|
|
|
+ const importExcelData = () => {
|
|
|
|
+ if (uploadRef.value) {
|
|
|
|
+ uploadRef.value.show("/api/v1/plan/order/import");
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+
|
|
// 设置表格列或者其他自定义的option
|
|
// 设置表格列或者其他自定义的option
|
|
option.value = Object.assign(option.value, {
|
|
option.value = Object.assign(option.value, {
|
|
- column: [
|
|
|
|
- {label: '技能',
|
|
|
|
- prop: 'dynamic',
|
|
|
|
- type: 'dynamic',
|
|
|
|
- span: 24,
|
|
|
|
- children: {
|
|
|
|
- align: 'center',
|
|
|
|
- type: 'form',
|
|
|
|
- headerAlign: 'center',
|
|
|
|
- column: [
|
|
|
|
- {
|
|
|
|
- label: "技能",
|
|
|
|
- prop: "skill_dict_value",
|
|
|
|
- type: 'select',
|
|
|
|
- dicData:dicts.skill_type,
|
|
|
|
- props: { label: "dictLabel", value: "dictValue" },
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- ],
|
|
|
|
|
|
+ selection: false,
|
|
|
|
+ addBtn: false,
|
|
|
|
+ viewBtn: false,
|
|
|
|
+ editBtn:false,
|
|
|
|
+ saveBtn:false,
|
|
|
|
+ cellBtn: true,
|
|
|
|
+ column: [{
|
|
|
|
+ label: "技能",
|
|
|
|
+ prop: "skillDictValue",
|
|
|
|
+ align: 'center',
|
|
|
|
+ headerAlign: 'center',
|
|
|
|
+ cell: true,
|
|
|
|
+ span:24,
|
|
|
|
+ type: 'select',
|
|
|
|
+ dicData:dicts.skill_type,
|
|
|
|
+ props: {
|
|
|
|
+ label: "dictLabel", // 下拉菜单显示的字段
|
|
|
|
+ value: "dictValue" // 下拉菜单值的字
|
|
|
|
+ },
|
|
|
|
+ },],
|
|
});
|
|
});
|
|
|
|
+ const routeBack =()=>{
|
|
|
|
+ router.back();
|
|
|
|
+ }
|
|
|
|
+ const addSkill = () => {
|
|
|
|
+ const bom=ref({
|
|
|
|
+ postId:props.postId,
|
|
|
|
+ $cellEdit:true,
|
|
|
|
+ });
|
|
|
|
+ data.value.push(bom.value);
|
|
|
|
+ };
|
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
+<style type="text/css">
|
|
|
|
+ .title-detail{
|
|
|
|
+ width: 30%;
|
|
|
|
+ height: 50px;
|
|
|
|
+ line-height: 50px;
|
|
|
|
+ margin: 25px 20px 25px 0;
|
|
|
|
+ float: left;
|
|
|
|
+ }
|
|
|
|
+ .detail{
|
|
|
|
+ margin: 0 auto;
|
|
|
|
+ width: 100%;
|
|
|
|
+ }
|
|
|
|
+ .avue-crud{
|
|
|
|
+ float: left;
|
|
|
|
+ }
|
|
|
|
+ .detail-footer{
|
|
|
|
+ float: right;
|
|
|
|
+ margin-top:15px;
|
|
|
|
+ }
|
|
|
|
+ .el-select__selection{
|
|
|
|
+ width: 400px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+</style>
|