Commit e801990f authored by zhanglongbao's avatar zhanglongbao

fix

parent b93d00ac
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
export {}
declare global {
}
/* eslint-disable */
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
export {}
/* prettier-ignore */
declare module 'vue' {
export interface GlobalComponents {
Address: typeof import('./src/components/widget/field/address/index.vue')['default']
Avatar: typeof import('./src/components/avatar/index.vue')['default']
Client_tag: typeof import('./src/components/widget/field/client_tag/index.vue')['default']
Create_form_data: typeof import('./src/components/create_form_data/index.vue')['default']
Date_time: typeof import('./src/components/widget/field/date_time/index.vue')['default']
Date_time_range: typeof import('./src/components/widget/field/date_time_range/index.vue')['default']
Dd: typeof import('./src/components/name/dd.vue')['default']
Dept: typeof import('./src/components/widget/field/dept/index.vue')['default']
File: typeof import('./src/components/widget/field/file/index.vue')['default']
Image: typeof import('./src/components/widget/field/image/index.vue')['default']
Input: typeof import('./src/components/widget/field/input/index.vue')['default']
Multiline: typeof import('./src/components/widget/field/multiline/index.vue')['default']
Name: typeof import('./src/components/name/index.vue')['default']
Number: typeof import('./src/components/widget/field/number/index.vue')['default']
Order_client: typeof import('./src/components/widget/field/order_client/index.vue')['default']
Order_product: typeof import('./src/components/widget/field/order_product/index.vue')['default']
Order_tag: typeof import('./src/components/widget/field/order_tag/index.vue')['default']
Parting_line: typeof import('./src/components/widget/field/parting_line/index.vue')['default']
Popup: typeof import('./src/components/popup/index.vue')['default']
Priority: typeof import('./src/components/widget/field/priority/index.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
Select: typeof import('./src/components/select/index.vue')['default']
Select_address: typeof import('./src/components/select_address/index.vue')['default']
Select_client: typeof import('./src/components/select_client/index.vue')['default']
Select_client_tag: typeof import('./src/components/select_client_tag/index.vue')['default']
Select_order_tag: typeof import('./src/components/select_order_tag/index.vue')['default']
Select_product: typeof import('./src/components/select_product/index.vue')['default']
Select_time: typeof import('./src/components/select_time/index.vue')['default']
Select_user_dept: typeof import('./src/components/select_user_dept/index.vue')['default']
Signature: typeof import('./src/components/widget/field/signature/index.vue')['default']
Single_choice: typeof import('./src/components/widget/field/single_choice/index.vue')['default']
Toast: typeof import('./src/components/toast/index.vue')['default']
User: typeof import('./src/components/widget/field/user/index.vue')['default']
User_dept_list: typeof import('./src/components/user_dept_list/index.vue')['default']
VanCheckbox: typeof import('vant/es')['Checkbox']
VanPicker: typeof import('vant/es')['Picker']
VanPopup: typeof import('vant/es')['Popup']
Widget: typeof import('./src/components/widget/index.vue')['default']
Wx: typeof import('./src/components/name/wx.vue')['default']
}
}
......@@ -10,9 +10,12 @@
"dependencies": {
"axios": "^1.7.5",
"dingtalk-jsapi": "^3.0.38",
"mitt": "^3.0.1",
"pinia": "^2.2.2",
"smooth-signature": "^1.0.15",
"vant": "^4.9.4",
"vconsole": "^3.15.1",
"viewerjs": "^1.11.6",
"vue": "^3.4.37",
"vue-router": "^4.4.3"
},
......@@ -72,6 +75,18 @@
"node": ">=6.0.0"
}
},
"node_modules/@babel/runtime": {
"version": "7.25.6",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/runtime/-/runtime-7.25.6.tgz",
"integrity": "sha512-VBj9MYyDb9tuLq7yzqjgzt6Q+IBQLrGZfdjOekyEirZPHxXWoTSGUTMrpsfi58Up73d13NfYLv8HT9vmznjzhQ==",
"license": "MIT",
"dependencies": {
"regenerator-runtime": "^0.14.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/types": {
"version": "7.25.6",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/types/-/types-7.25.6.tgz",
......@@ -1150,6 +1165,29 @@
"url": "https://github.com/sponsors/mesqueeb"
}
},
"node_modules/copy-text-to-clipboard": {
"version": "3.2.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/copy-text-to-clipboard/-/copy-text-to-clipboard-3.2.0.tgz",
"integrity": "sha512-RnJFp1XR/LOBDckxTib5Qjr/PMfkatD0MUCQgdpqS8MdKiNUzBjAQBEN6oUy+jW7LI93BBG3DtMB2KOOKpGs2Q==",
"license": "MIT",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/core-js": {
"version": "3.38.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/core-js/-/core-js-3.38.1.tgz",
"integrity": "sha512-OP35aUorbU3Zvlx7pjsFdu1rGNnD4pgw/CWoYzRY3t2EzoVT7shKHY1dlAy3f41cGIO7ZDPQimhGFTlEYkG/Hw==",
"hasInstallScript": true,
"license": "MIT",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/core-js"
}
},
"node_modules/csstype": {
"version": "3.1.3",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/csstype/-/csstype-3.1.3.tgz",
......@@ -1634,6 +1672,12 @@
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/mitt": {
"version": "3.0.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/mitt/-/mitt-3.0.1.tgz",
"integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==",
"license": "MIT"
},
"node_modules/mlly": {
"version": "1.7.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/mlly/-/mlly-1.7.1.tgz",
......@@ -1661,6 +1705,11 @@
"dev": true,
"license": "MIT"
},
"node_modules/mutation-observer": {
"version": "1.0.3",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/mutation-observer/-/mutation-observer-1.0.3.tgz",
"integrity": "sha512-M/O/4rF2h776hV7qGMZUH3utZLO/jK7p8rnNgGkjKUw8zCGjRQPxB8z6+5l8+VjRUQ3dNYu4vjqXYLr+U8ZVNA=="
},
"node_modules/nanoid": {
"version": "3.3.7",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/nanoid/-/nanoid-3.3.7.tgz",
......@@ -1907,6 +1956,12 @@
"node": ">=8.10.0"
}
},
"node_modules/regenerator-runtime": {
"version": "0.14.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==",
"license": "MIT"
},
"node_modules/reusify": {
"version": "1.0.4",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/reusify/-/reusify-1.0.4.tgz",
......@@ -2242,6 +2297,24 @@
"vue": "^3.0.0"
}
},
"node_modules/vconsole": {
"version": "3.15.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/vconsole/-/vconsole-3.15.1.tgz",
"integrity": "sha512-KH8XLdrq9T5YHJO/ixrjivHfmF2PC2CdVoK6RWZB4yftMykYIaXY1mxZYAic70vADM54kpMQF+dYmvl5NRNy1g==",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.17.2",
"copy-text-to-clipboard": "^3.0.1",
"core-js": "^3.11.0",
"mutation-observer": "^1.0.3"
}
},
"node_modules/viewerjs": {
"version": "1.11.6",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/viewerjs/-/viewerjs-1.11.6.tgz",
"integrity": "sha512-TlhdSp2oEOLFXvEp4psKaeTjR5zBjTRcM/sHUN8PkV1UWuY8HKC8n7GaVdW5Xqnwdr/F1OmzLik1QwDjI4w/nw==",
"license": "MIT"
},
"node_modules/vite": {
"version": "5.4.2",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/vite/-/vite-5.4.2.tgz",
......@@ -2419,6 +2492,14 @@
"@babel/types": "^7.25.6"
}
},
"@babel/runtime": {
"version": "7.25.6",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/runtime/-/runtime-7.25.6.tgz",
"integrity": "sha512-VBj9MYyDb9tuLq7yzqjgzt6Q+IBQLrGZfdjOekyEirZPHxXWoTSGUTMrpsfi58Up73d13NfYLv8HT9vmznjzhQ==",
"requires": {
"regenerator-runtime": "^0.14.0"
}
},
"@babel/types": {
"version": "7.25.6",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/types/-/types-7.25.6.tgz",
......@@ -3040,6 +3121,16 @@
"is-what": "^3.14.1"
}
},
"copy-text-to-clipboard": {
"version": "3.2.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/copy-text-to-clipboard/-/copy-text-to-clipboard-3.2.0.tgz",
"integrity": "sha512-RnJFp1XR/LOBDckxTib5Qjr/PMfkatD0MUCQgdpqS8MdKiNUzBjAQBEN6oUy+jW7LI93BBG3DtMB2KOOKpGs2Q=="
},
"core-js": {
"version": "3.38.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/core-js/-/core-js-3.38.1.tgz",
"integrity": "sha512-OP35aUorbU3Zvlx7pjsFdu1rGNnD4pgw/CWoYzRY3t2EzoVT7shKHY1dlAy3f41cGIO7ZDPQimhGFTlEYkG/Hw=="
},
"csstype": {
"version": "3.1.3",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/csstype/-/csstype-3.1.3.tgz",
......@@ -3356,6 +3447,11 @@
"brace-expansion": "^2.0.1"
}
},
"mitt": {
"version": "3.0.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/mitt/-/mitt-3.0.1.tgz",
"integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw=="
},
"mlly": {
"version": "1.7.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/mlly/-/mlly-1.7.1.tgz",
......@@ -3380,6 +3476,11 @@
"integrity": "sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==",
"dev": true
},
"mutation-observer": {
"version": "1.0.3",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/mutation-observer/-/mutation-observer-1.0.3.tgz",
"integrity": "sha512-M/O/4rF2h776hV7qGMZUH3utZLO/jK7p8rnNgGkjKUw8zCGjRQPxB8z6+5l8+VjRUQ3dNYu4vjqXYLr+U8ZVNA=="
},
"nanoid": {
"version": "3.3.7",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/nanoid/-/nanoid-3.3.7.tgz",
......@@ -3508,6 +3609,11 @@
"picomatch": "^2.2.1"
}
},
"regenerator-runtime": {
"version": "0.14.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw=="
},
"reusify": {
"version": "1.0.4",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/reusify/-/reusify-1.0.4.tgz",
......@@ -3727,6 +3833,22 @@
"@vue/shared": "^3.4.33"
}
},
"vconsole": {
"version": "3.15.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/vconsole/-/vconsole-3.15.1.tgz",
"integrity": "sha512-KH8XLdrq9T5YHJO/ixrjivHfmF2PC2CdVoK6RWZB4yftMykYIaXY1mxZYAic70vADM54kpMQF+dYmvl5NRNy1g==",
"requires": {
"@babel/runtime": "^7.17.2",
"copy-text-to-clipboard": "^3.0.1",
"core-js": "^3.11.0",
"mutation-observer": "^1.0.3"
}
},
"viewerjs": {
"version": "1.11.6",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/viewerjs/-/viewerjs-1.11.6.tgz",
"integrity": "sha512-TlhdSp2oEOLFXvEp4psKaeTjR5zBjTRcM/sHUN8PkV1UWuY8HKC8n7GaVdW5Xqnwdr/F1OmzLik1QwDjI4w/nw=="
},
"vite": {
"version": "5.4.2",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/vite/-/vite-5.4.2.tgz",
......
This diff is collapsed.
import http from "../axios";
import { container } from "@/utils/container/index";
export default {
// 获取工单状态数量
......@@ -8,21 +7,15 @@ export default {
},
// 工单列表
listOrder(params: { form_id?: string; where?: string }) {
return http.post(
`/order.${container.qr_code ? "external" : "order"}/listOrder`,
params
);
return http.post("/order.order/listOrder", params);
},
// 工单列表
deleteOrder(params: { form_id: string; id: string }) {
deleteOrder(params: { data: { form_id: string; id: string }[] }) {
return http.post("/order.order/deleteOrder", params);
},
// 新建/修改工单
saveOrder(params: any) {
return http.post(
`/order.${container.qr_code ? "external" : "order"}/saveOrder`,
params
);
return http.post("/order.order/saveOrder", params);
},
// 工单详情
orderDetail(params: { form_id: string; id: string }) {
......@@ -61,12 +54,89 @@ export default {
getTemplateData(params: { form_id: string; order_id: string }) {
return http.post("/order.order_template/getTemplateData", params);
},
// 工单标签
listOrderLabel(params: { keyword?: string; page: number; size: number }) {
return http.post(
`/order.${container.qr_code ? "external" : "order"}/listOrderLabel`,
params
);
return http.post("/order.order/listOrderLabel", params);
},
// 指派列表
assignOrderList(params: {
page: number;
size: number;
form_id: string[];
key_word?: string;
where?: string;
}) {
return http.post("/order.order/assignOrderList", params);
},
// 超时工单
timeoutOrderList(params: {
page: number;
size: number;
key_word?: string;
where?: string;
timeout_type: number;
form_id: string;
}) {
return http.post("/order.order/timeoutOrderList", params);
},
// 回访工单
evaluateOrderList(params: {
page: number;
size: number;
form_id: string;
where?: string;
key_word?: string;
evaluate_type: number;
}) {
return http.post("/order.order/evaluateOrderList", params);
},
// 回访工单
fileOrderList(params: {
page: number;
size: number;
form_id: string;
where?: string;
key_word?: string;
}) {
return http.post("/order.order/fileOrderList", params);
},
// 审批工单
approveOrderList(params: {
page: number;
size: number;
form_id: string;
where?: string;
key_word?: string;
approve_type: number;
}) {
return http.post("/order.order/approveOrderList", params);
},
// 审批通过
approvePass(params: {
form_id: string;
id: string;
approve_id: string;
approve_user_id: string;
}) {
return http.post("/order.order/approvePass", params);
},
// 审批退回
approveReturn(params: {
form_id: string;
id: string;
approve_id: string;
approve_user_id: string;
}) {
return http.post("/order.order/approveReturn", params);
},
// 审批取消
reApproveOrder(params: {
form_id: string;
id: string;
submit_ids?: string[];
}) {
return http.post("/order.order/reApproveOrder", params);
},
};
......@@ -24,4 +24,8 @@ export default {
}) {
return http.post("/order.power/CreatePart", params);
},
// 获取当前登录人的权限
GetMyPower() {
return http.post("/order.power/GetMyPower");
},
};
......@@ -30,20 +30,18 @@ export interface Props {
data?: object; // 修改初始化数据
defaultData?: object; // 默认数据(用于兼容初始化关联数据的字段,里面会弹出eidtData)
onHide?: () => void;
onConfirm?: (data: object) => void;
onEditConfirm?: (data: object) => void;
onConfirm?: (data: object, close: Function) => void;
onEditConfirm?: (data: object, close: Function) => void;
}
const props = withDefaults(defineProps<Props>(), {});
console.log("defaultData", props);
const show = ref(false);
onMounted(() => {
show.value = true;
});
const confirm = () => {
props.onConfirm?.(data.value);
props.onEditConfirm?.(edit.value);
close();
props.onConfirm?.(data.value, close);
props.onEditConfirm?.(edit.value, close);
};
const popup_comp = ref();
const close = () => {
......
import { createApp } from "vue";
import Comp from "./index.vue";
import type { Props } from "./index.vue";
import { initApp } from "@/utils/init";
export const $select = (options: Props) => {
const container = document.createElement("div");
......@@ -12,6 +13,7 @@ export const $select = (options: Props) => {
};
const vm = createApp(Comp, options as any);
initApp(vm);
vm.mount(container);
document.body.appendChild(container);
};
import { createApp } from "vue";
import Comp from "./index.vue";
import type { Props } from "./index.vue";
import { initApp } from "@/utils/init";
export const $selectAddress = (options: Props) => {
const container = document.createElement("div");
......@@ -12,6 +13,7 @@ export const $selectAddress = (options: Props) => {
};
const vm = createApp(Comp, options as any);
initApp(vm);
vm.mount(container);
document.body.appendChild(container);
};
import { createApp } from "vue";
import Comp from "./index.vue";
import type { Props } from "./index.vue";
import { initApp } from "@/utils/init";
export const $selectClient = (options: Props) => {
const container = document.createElement("div");
......@@ -12,6 +13,7 @@ export const $selectClient = (options: Props) => {
};
const vm = createApp(Comp, options as any);
initApp(vm);
vm.mount(container);
document.body.appendChild(container);
};
import { createApp } from "vue";
import Comp from "./index.vue";
import type { Props } from "./index.vue";
import { initApp } from "@/utils/init";
export const $selectClientTag = (options: Props) => {
const container = document.createElement("div");
......@@ -12,6 +13,7 @@ export const $selectClientTag = (options: Props) => {
};
const vm = createApp(Comp, options as any);
initApp(vm);
vm.mount(container);
document.body.appendChild(container);
};
import { createApp } from "vue";
import Comp from "./index.vue";
import type { Props } from "./index.vue";
import { initApp } from "@/utils/init";
export const $selectOrderTag = (options: Props) => {
const container = document.createElement("div");
......@@ -12,6 +13,7 @@ export const $selectOrderTag = (options: Props) => {
};
const vm = createApp(Comp, options as any);
initApp(vm);
vm.mount(container);
document.body.appendChild(container);
};
import { createApp } from "vue";
import Comp from "./index.vue";
import type { Props } from "./index.vue";
import { initApp } from "@/utils/init";
export const $selectProduct = (options: Props) => {
const container = document.createElement("div");
......@@ -12,6 +13,7 @@ export const $selectProduct = (options: Props) => {
};
const vm = createApp(Comp, options as any);
initApp(vm);
vm.mount(container);
document.body.appendChild(container);
};
import { createApp } from "vue";
import Comp from "./index.vue";
import type { Props } from "./index.vue";
import { initApp } from "@/utils/init";
export const $selectTime = (options: Props) => {
const container = document.createElement("div");
......@@ -12,6 +13,7 @@ export const $selectTime = (options: Props) => {
};
const vm = createApp(Comp, options as any);
initApp(vm);
vm.mount(container);
document.body.appendChild(container);
};
......@@ -7,7 +7,9 @@
<div class="content">
<div class="img" v-for="it in files">
<img v-signature:src="it.file_url" />
<img
v-signature:src="it.file_url"
@click="preview(it.file_url)" />
<i class="icon-12 remove" @click="remove(it)"></i>
</div>
<div class="img add" @click="upload">
......@@ -20,7 +22,7 @@
<script setup lang="ts">
import { ref } from "vue";
import { FieldProps } from "../config";
import { uploadFile, File } from "@/utils/public";
import { uploadFile, File, preview } from "@/utils/public";
const props = defineProps<FieldProps>();
const emit = defineEmits(["edit"]);
......
......@@ -9,6 +9,7 @@
:disabled="disabled"
:data="modelValue"
:defaultData="defaultData"
:required="it.isneed == 1"
@edit="edit" />
</template>
</div>
......
......@@ -5,6 +5,7 @@ import router from "@/router";
import { createPinia } from "pinia";
import mitt from "mitt";
import VConsole from "vconsole";
import vant from "vant";
// css
import "./assets/css/reset.css";
......@@ -18,5 +19,6 @@ new VConsole();
const app = createApp(App);
app.use(createPinia());
app.use(router);
app.use(vant);
initApp(app);
app.mount("#app");
......@@ -63,8 +63,11 @@ router.beforeEach(async (to, from, next) => {
if (!token) {
await login();
token = getToken()!;
}
} else {
if (!getToken()) {
setToken(token);
}
}
const USER = useUserStore();
await USER.getUserInfo(token); // 获取用户信息
......
......@@ -11,6 +11,7 @@ interface UserStatus {
export const useUserStore = defineStore("user", () => {
const user_info = ref<UserInfo>({} as UserInfo);
const user_status = ref<UserStatus>({} as UserStatus);
const user_power = ref<any>({});
// 获取用户信息
const getUserInfo = async (token: string) => {
......@@ -22,6 +23,7 @@ export const useUserStore = defineStore("user", () => {
}
getWorkStatus();
getUserPower();
};
// 获取用户工作状态
......@@ -32,10 +34,21 @@ export const useUserStore = defineStore("user", () => {
}
};
// 获取用户权限
const getUserPower = async () => {
const msg = await api.power.GetMyPower();
if (msg.code == 0) {
user_power.value = msg.data;
console.log("权限:", user_power.value);
}
};
return {
user_info,
getUserInfo,
user_status,
getWorkStatus,
user_power,
getUserPower,
};
});
import { getUrlKey } from "../public";
import { getToken, getUrlKey } from "../public";
import * as dd_util from "./dd";
import * as wx_util from "./wx";
import { useUserStore } from "@/store/user";
/**
* 判断打开程序的容器
......@@ -26,5 +27,10 @@ export const login = async () => {
await wx_util.login();
} else if (container.browser) {
// router.push({ name: "codeLogin" });
return;
}
const token = getToken()!;
const USER = useUserStore();
await USER.getUserInfo(token); // 获取用户信息
};
import { App } from "vue";
import vant from "vant";
// 指令
import directive from "@/utils/directive";
......@@ -10,5 +11,6 @@ import nameComp from "@/components/name/index.vue";
export const initApp = (app: App<Element>) => {
app.component("avatarComp", avatarComp);
app.component("nameComp", nameComp);
app.use(vant);
app.use(directive);
};
......@@ -2,6 +2,9 @@ import { useOssStore } from "@/store/oss";
import axios from "axios";
import file_icon from "@/assets/file_icon/index";
import { $toast } from "@/components/toast";
import { useUserStore } from "@/store/user";
import { ossSignature } from "./ossSignature";
import { showImagePreview } from "vant";
/**
* 格式化文件大小
......@@ -254,3 +257,18 @@ export const dataFormat = (date: any, fmt: string = "YYYY-MM-DD HH:mm:ss") => {
return fmt.replace(/YYYY|MM|DD|HH|mm|ss/g, (match) => formatMap[match]());
};
// 获取权限
export const getPermission = (permission: string) => {
const USER = useUserStore();
return USER.user_power[permission] == 1;
};
// 查看文件
export const preview = async (url: string) => {
const newUrl = await ossSignature(url);
showImagePreview({
images: [newUrl],
});
};
......@@ -25,7 +25,6 @@ export const getPriority = (label: string): Priority => {
export interface OrderType {
label: string;
value: string;
key: string;
bg_color?: string;
color?: string;
}
......@@ -33,73 +32,45 @@ export const order_type: OrderType[] = [
{
label: "待指派",
value: "0",
key: "WaitOrder",
bg_color: "#EB6539",
color: "white",
},
{
label: "待接单",
value: "1",
key: "MissOrder",
bg_color: "#323F54",
color: "white",
},
{
label: "待开始",
value: "2",
key: "WaitBegin",
bg_color: "#8DA4CE",
color: "white",
},
{
label: "处理中",
value: "3",
key: "Dealing",
bg_color: "#3B8CF7",
color: "white",
},
// {
// label: "待确认",
// value: "4",
// key: "Confirm",
// },
{
label: "已完成",
value: "5",
key: "Finish",
bg_color: "#3E9586",
color: "white",
},
{
label: "已评价",
value: "6",
key: "Evaluate",
bg_color: "#3F93B7",
color: "white",
},
// {
// label: "已确认",
// value: "7",
// key: "Confirming",
// },
{
label: "已取消",
value: "8",
key: "Cancel",
bg_color: "#F24537",
color: "white",
},
// {
// label: "已退回",
// value: "9",
// key: "Return",
// },
{
label: "已挂起",
value: "10",
key: "HangUp",
bg_color: "#856CA8",
color: "white",
label: "待受理",
value: "14",
bg_color: "var(--bg_gray)",
color: "gray",
},
];
export const getType = (type: string) => {
......
......@@ -94,7 +94,8 @@
<img
v-for="it in product_detail?.product_info
?.product_images || []"
v-signature:src="it.file_url" />
v-signature:src="it.file_url"
@click="preview(it.file_url)" />
</div>
</div>
</div>
......@@ -113,7 +114,7 @@
<script setup lang="ts">
import { ref } from "vue";
import api from "@/api";
import { File, hexToRgba } from "@/utils/public";
import { File, hexToRgba, preview } from "@/utils/public";
import { $createFormData } from "@/components/create_form_data/index";
import { $toast } from "@/components/toast/index";
import { useRouter } from "vue-router";
......@@ -179,7 +180,7 @@ const createFormData = (button: ButtonType) => {
product_id: product_detail.value.product_info,
customer_id: product_detail.value.customer_info,
},
onConfirm: async (data) => {
onConfirm: async (data, close) => {
const msg = await api.order.saveOrder({
...data,
form_id: button.order_form_id,
......@@ -187,6 +188,7 @@ const createFormData = (button: ButtonType) => {
});
if (msg.code == 0) {
$toast({ type: "success", message: "创建成功" });
close();
}
},
});
......@@ -226,7 +228,7 @@ init();
box-sizing: border-box;
display: flex;
flex-direction: column;
box-shadow: 0 -2px 4px 1px #f3f3f3;
box-shadow: 0 0 4px 1px #f3f3f3;
.order {
display: flex;
......
......@@ -5,9 +5,35 @@ import { $createFormData } from "@/components/create_form_data/index";
import { order_type, OrderType } from "@/utils/variable";
import { useDataList } from "@/utils/hook";
import { $toast } from "@/components/toast";
import { showConfirmDialog } from "vant";
import { useUserStore } from "@/store/user";
// 工单方法
export const useOrderControls = (callBack = () => {}) => {
const USER = useUserStore();
// 显示审批按钮
const show_approval_btn = (order_detail: any) => {
return (
order_detail.approve_status == 1 &&
(order_detail.approve_users_info || []).find(
(it: any) => it.user_id.id == USER.user_info.id
)?.uid_status == 1
);
};
// 显示重新审批
const show_reapproval_btn = (order_detail: any) => {
return order_detail.status == 14 && order_detail.approve_status == 2;
};
// 显示操作按钮
const showControls = (order_detail: any) => {
return (
order_detail.now_node_id !=
order_detail.node_info?.[order_detail.node_info.length - 1]?.id
);
};
// 派单
const assignOrder = ({ form_id, id }: any) => {
$selectUserDept({
......@@ -73,7 +99,7 @@ export const useOrderControls = (callBack = () => {}) => {
$createFormData({
form_id: finish_order.receipt_template_id,
onEditConfirm: async (data) => {
onEditConfirm: async (data, close) => {
const msg = await api.order.finishOrder({
form_id: form_id,
id: id,
......@@ -81,6 +107,7 @@ export const useOrderControls = (callBack = () => {}) => {
});
if (msg.code == 0) {
$toast({ type: "success", message: "完成工单" });
close();
callBack();
}
},
......@@ -95,7 +122,7 @@ export const useOrderControls = (callBack = () => {}) => {
$createFormData({
form_id: evaluate_order.template_id,
onEditConfirm: async (data) => {
onEditConfirm: async (data, close) => {
const msg = await api.order.evaluateOrder({
form_id: form_id,
id: id,
......@@ -103,6 +130,7 @@ export const useOrderControls = (callBack = () => {}) => {
});
if (msg.code == 0) {
$toast({ type: "success", message: "感谢评价" });
close();
callBack();
}
},
......@@ -116,7 +144,7 @@ export const useOrderControls = (callBack = () => {}) => {
$createFormData({
form_id: order_detail.form_id,
data: order_detail,
onEditConfirm: async (data) => {
onEditConfirm: async (data, close) => {
if (order_detail?.id) {
const msg = await api.order.saveOrder({
form_id: order_detail.form_id,
......@@ -125,6 +153,7 @@ export const useOrderControls = (callBack = () => {}) => {
});
if (msg.code == 0) {
$toast({ type: "success", message: "修改成功" });
close();
callBack();
}
}
......@@ -132,6 +161,86 @@ export const useOrderControls = (callBack = () => {}) => {
});
};
// 通过审批
const approval_pass = (order_detail: any) => {
showConfirmDialog({
title: "提示",
width: "300px",
message: "是否通过审批?",
}).then(async () => {
const msg = await api.order.approvePass({
form_id: order_detail.form_id,
id: order_detail.id,
approve_id: order_detail.approve_info.id,
approve_user_id: USER.user_info.id,
});
if (msg.code == 0) {
$toast({ type: "success", message: "审批通过" });
callBack();
}
});
};
// 退回审批
const approval_return = (order_detail: any) => {
showConfirmDialog({
title: "提示",
width: "300px",
message: "是否退回审批?",
}).then(async () => {
const msg = await api.order.approveReturn({
form_id: order_detail.form_id,
id: order_detail.id,
approve_id: order_detail.approve_info.id,
approve_user_id: USER.user_info.id,
});
if (msg.code == 0) {
$toast({ type: "success", message: "审批退回" });
callBack();
}
});
};
// 重新发起审批
const reApproveOrder = (order_detail: any) => {
showConfirmDialog({
title: "提示",
width: "300px",
message: "是否重新发起审批?",
}).then(async () => {
const msg = await api.order.reApproveOrder({
form_id: order_detail.form_id,
id: order_detail.id,
});
if (msg.code == 0) {
$toast({ type: "success", message: "审批退回" });
callBack();
}
});
};
// 删除
const deleteOrder = (order_detail: any) => {
showConfirmDialog({
title: "提示",
width: "300px",
message: "是否删除工单?",
}).then(async () => {
const msg = await api.order.deleteOrder({
data: [
{
form_id: order_detail.form_id,
id: order_detail.id,
},
],
});
if (msg.code == 0) {
$toast({ type: "success", message: "删除工单" });
callBack();
}
});
};
return {
assignOrder,
receiveOrder,
......@@ -139,6 +248,13 @@ export const useOrderControls = (callBack = () => {}) => {
finishOrder,
evaluateOrder,
editOrder,
approval_pass,
approval_return,
reApproveOrder,
deleteOrder,
show_approval_btn,
show_reapproval_btn,
showControls,
};
};
......@@ -201,7 +317,7 @@ export const useOrder = (props: ComputedRef<Props>) => {
const create_order = (order_form: FormInfo) => {
$createFormData({
form_id: order_form.form_id,
onConfirm: async (data) => {
onConfirm: async (data, close) => {
const msg = await api.order.saveOrder({
...data,
form_id: order_form.form_id,
......@@ -209,6 +325,7 @@ export const useOrder = (props: ComputedRef<Props>) => {
});
if (msg.code == 0) {
$toast({ type: "success", message: "创建成功" });
close();
props.value.init();
}
},
......@@ -223,17 +340,6 @@ export const useOrder = (props: ComputedRef<Props>) => {
show_detail.value = true;
};
// 工单操作
const {
assignOrder,
receiveOrder,
startOrder,
finishOrder,
evaluateOrder,
} = useOrderControls(() => {
props.value.init();
});
return {
order_form_list,
default_order_form,
......@@ -254,10 +360,5 @@ export const useOrder = (props: ComputedRef<Props>) => {
show_detail,
detail_info,
detail,
assignOrder,
receiveOrder,
startOrder,
finishOrder,
evaluateOrder,
};
};
......@@ -69,9 +69,35 @@
</div>
<div class="controls">
<template v-if="[1, 2].includes(+it.approve_status)">
<template v-if="show_approval_btn(it)">
<span
class="button green text"
v-if="it.status == 0"
@click="approval_pass(it)">
通过
</span>
<span
class="button green text"
@click="approval_return(it)">
退回
</span>
</template>
<template v-else-if="show_reapproval_btn(it)">
<span
class="button green text"
@click="reApproveOrder(it)">
重新审批
</span>
</template>
</template>
<template v-else-if="showControls(it)">
<span
class="button green text"
v-if="
it.status == 0 && getPermission('assign_order')
"
@click="assignOrder(it)">
派单
</span>
......@@ -103,8 +129,9 @@
@click="evaluateOrder(it)">
评价
</span>
</template>
<span class="button text green" @click="delOrder(it)">
<span class="button text green" @click="deleteOrder(it)">
删除
</span>
</div>
......@@ -115,11 +142,11 @@
<script setup lang="ts">
import { getType, getPriority } from "@/utils/variable";
import { useOrder } from "./hook";
import { useOrder, useOrderControls } from "./hook";
import { computed } from "vue";
import { showConfirmDialog } from "vant";
import { $select } from "@/components/select/index";
import { useScroll } from "@/utils/hook";
import { getPermission } from "@/utils/public";
const init = async () => {
await getOrderFormList();
......@@ -145,29 +172,23 @@ const {
page,
count,
getList,
deleteData,
// create_order,
// show_detail,
// detail_info,
// detail,
} = useOrder(useOrderProps);
// 工单操作
const {
assignOrder,
receiveOrder,
startOrder,
finishOrder,
evaluateOrder,
} = useOrder(useOrderProps);
// 删除工单
const delOrder = (order: any) => {
showConfirmDialog({
title: "提示",
message: "是否删除该工单?删除后将无法恢复。",
}).then(() => {
deleteData({
data: [{ id: order.id, form_id: order.form_id }],
});
});
};
approval_pass,
approval_return,
reApproveOrder,
deleteOrder,
show_approval_btn,
show_reapproval_btn,
showControls,
} = useOrderControls(init);
// 切换工单类型
const changeOrderForm = () => {
......
import { defineConfig, loadEnv } from "vite";
import vue from "@vitejs/plugin-vue";
import path from "path";
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
import { VantResolver } from "@vant/auto-import-resolver";
// https://vitejs.dev/config/
export default ({ mode }: any) => {
......@@ -13,15 +10,7 @@ export default ({ mode }: any) => {
return defineConfig({
base: "./",
plugins: [
vue(),
AutoImport({
resolvers: [VantResolver()],
}),
Components({
resolvers: [VantResolver()],
}),
],
plugins: [vue()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment