123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- <template>
- <div class="mainContentBox">
- <avue-crud
- ref="crudRef"
- v-model:search="search"
- v-model="form"
- :data="data"
- :option="option"
- v-model:page="page"
- @row-click="rowClick"
- @search-change="searchChange"
- @search-reset="resetChange"
- @size-change="dataList"
- @current-change="dataList"
- >
- </avue-crud>
- </div>
- </template>
- <script setup>
- import { ref } from "vue";
- import { useCrud } from "@/hooks/userCrud";
- import { useCommonStoreHook } from "@/store";
- import dictDataUtil from "@/common/configs/dictDataUtil";
- const { isShowTable, tableType } = toRefs(useCommonStoreHook());
- const test = () => {
- isShowTable.value = true;
- tableType.value = tableType.value == 1 ? 2 : 1;
- };
- // 传入一个url,后面不带/
- const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
- useCrud({
- src: "/api/v1/base/workShop",
- });
- const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
- const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
- const { checkBtnPerm, downloadTemplate } = Utils; //按钮权限等工具
- const crudRef = ref(null); //crudRef.value 获取avue-crud对象
- const emit = defineEmits(["workShopInfo"])
- const rowClick = (row)=>{
- emit("workShopInfo", row)
- }
- // 设置表格列或者其他自定义的option
- option.value = Object.assign(option.value, {
- delBtn: false,
- selection: false,
- search: false,
- editBtn: false,
- addBtn: false,
- viewBtn: false,
- menu: false,
- column: [
- {
- label: "订单编号",
- prop: "orderCode",
- search: true,
- width: "125",
- display: false,
- },
- {
- label: "订单名称",
- prop: "orderName",
- search: true,
- width: "100",
- },
- {
- label: "ERP号",
- prop: "erpCode",
- search: true,
- width: "100",
- },
- {
- label: "产品编码",
- prop: "materialCode",
- search: true,
- width: "100",
- },
- {
- label: "产品名称",
- prop: "materialName",
- search: true,
- width: "100",
- },
- {
- label: "产品规格",
- width: "100",
- prop: "materialModel",
- },
- {
- label: "订单状态",
- prop: "orderState",
- display: false,
- width: "100",
- type: "select", //类型为下拉选择框
- dicUrl:
- dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_order_state,
- props: {
- label: "dictLabel",
- value: "dictValue",
- },
- searchClearable: false, //可清空的输入框,默认为true
- filterable: true, //添加filterable属性即可启用搜索功能
- },
- {
- label: "订单类型",
- prop: "orderType",
- type: "select", //类型为下拉选择框
- width: "100",
- dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_order_type,
- props: {
- label: "dictLabel",
- value: "dictValue",
- },
- searchClearable: false, //可清空的输入框,默认为true
- filterable: true, //添加filterable属性即可启用搜索功能
- },
- {
- label: "订单数量",
- prop: "orderNum",
- type: "number",
- width: "100",
- min: 1,
- max: 99999,
- },
- {
- label: "排产数量",
- prop: "scheduledNum",
- width: "100",
- display: false,
- },
- {
- label: "优先级",
- prop: "priority",
- width: "100",
- type: "select", //类型为下拉选择框
- dicUrl:
- dictDataUtil.request_url + dictDataUtil.TYPE_CODE.plan_order_priority,
- props: {
- label: "dictLabel",
- value: "dictValue",
- },
- searchClearable: false, //可清空的输入框,默认为true
- filterable: true, //添加filterable属性即可启用搜索功能
- },
- {
- label: "交付日期",
- prop: "deliverTime",
- type: "date",
- width: "100",
- format: "YYYY-MM-DD", //前端展示格式
- valueFormat: "YYYY-MM-DD", //设置后端接收的日期格式
- },
- {
- label: "所属公司",
- prop: "companyId",
- width: "100",
- type: "select", //类型为下拉选择框
- dicUrl: import.meta.env.VITE_APP_BASE_API + "/api/v1/sys/dept/orgList",
- props: {
- label: "deptName",
- value: "id",
- },
- },
- {
- label: "项目号",
- width: "100",
- prop: "projectCode",
- },
- {
- label: "绑定铭牌",
- prop: "nameplated",
- width: "100",
- type: "radio", //类型为单选框
- dicData: [
- {
- label: "否",
- value: 0,
- },
- {
- label: "是",
- value: 1,
- },
- ],
- value: 0,
- },
- {
- label: "备注",
- prop: "remark",
- width: "100",
- minRows: 2, //最小行/最小值
- type: "textarea", //类型为多行文本域框
- maxlength: 512, //最大输入长度
- },
- {
- label: "创建时间",
- prop: "created",
- width: "140",
- overHidden: true,
- type: "datetime",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- },
- {
- label: "创建人",
- prop: "creator",
- width: 80,
- overHidden: true,
- },
- ],
- });
- onMounted(() => {
- dataList();
- });
- </script>
|