|
|
@@ -0,0 +1,125 @@
|
|
|
+import request from '@/utils/request';
|
|
|
+
|
|
|
+/**
|
|
|
+ * 表单编号管理API
|
|
|
+ */
|
|
|
+
|
|
|
+/**
|
|
|
+ * 新增表单编号
|
|
|
+ * @param {Object} data 表单编号数据
|
|
|
+ * @returns {Promise}
|
|
|
+ */
|
|
|
+export async function addFormCode(data) {
|
|
|
+ const res = await request.post('/main/form/number/config/add', data);
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ return res.data.data;
|
|
|
+ }
|
|
|
+ return Promise.reject(new Error(res.data.message));
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 变更表单编号
|
|
|
+ * @param {Object} data 表单编号数据
|
|
|
+ * @returns {Promise}
|
|
|
+ */
|
|
|
+export async function changeFormCode(data) {
|
|
|
+ const res = await request.post('/main/form/number/config/change', data);
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ return res.data.data;
|
|
|
+ }
|
|
|
+ return Promise.reject(new Error(res.data.message));
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 删除表单编号
|
|
|
+ * @param {string|number} id 表单编号ID
|
|
|
+ * @returns {Promise}
|
|
|
+ */
|
|
|
+export async function deleteFormCode(id) {
|
|
|
+ const res = await request.get(`/main/form/number/config/delete/${id}`);
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ return res.data.data;
|
|
|
+ }
|
|
|
+ return Promise.reject(new Error(res.data.message));
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 停用表单编号
|
|
|
+ * @param {string|number} id 表单编号ID
|
|
|
+ * @returns {Promise}
|
|
|
+ */
|
|
|
+export async function disableFormCode(id) {
|
|
|
+ const res = await request.get(`/main/form/number/config/disable/${id}`);
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ return res.data.data;
|
|
|
+ }
|
|
|
+ return Promise.reject(new Error(res.data.message));
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 启用表单编号
|
|
|
+ * @param {string|number} id 表单编号ID
|
|
|
+ * @returns {Promise}
|
|
|
+ */
|
|
|
+export async function enableFormCode(id) {
|
|
|
+ const res = await request.put(`/main/form/number/config/enable/${id}`);
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ return res.data.data;
|
|
|
+ }
|
|
|
+ return Promise.reject(new Error(res.data.message));
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 根据ID查询表单编号详情
|
|
|
+ * @param {string|number} id 表单编号ID
|
|
|
+ * @returns {Promise}
|
|
|
+ */
|
|
|
+export async function getFormCodeById(id) {
|
|
|
+ const res = await request.get(`/main/form/number/config/getById/${id}`);
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ return res.data.data;
|
|
|
+ }
|
|
|
+ return Promise.reject(new Error(res.data.message));
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 查询表单编号历史版本
|
|
|
+ * @param {string|number} formCodeId 表单编号ID
|
|
|
+ * @returns {Promise}
|
|
|
+ */
|
|
|
+export async function getFormCodeHistoryList(formCodeId) {
|
|
|
+ const res = await request.get(
|
|
|
+ `/main/form/number/config/getHistoryList/${formCodeId}`
|
|
|
+ );
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ return res.data.data;
|
|
|
+ }
|
|
|
+ return Promise.reject(new Error(res.data.message));
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 分页查询表单编号列表
|
|
|
+ * @param {Object} data 查询参数
|
|
|
+ * @returns {Promise}
|
|
|
+ */
|
|
|
+export async function getFormCodePage(data) {
|
|
|
+ const res = await request.post(`/main/form/number/config/page`, data);
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ return res.data.data;
|
|
|
+ }
|
|
|
+ return Promise.reject(new Error(res.data.message));
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 更新表单编号
|
|
|
+ * @param {Object} data 表单编号数据
|
|
|
+ * @returns {Promise}
|
|
|
+ */
|
|
|
+export async function updateFormCode(data) {
|
|
|
+ const res = await request.post('/main/form/number/config/update', data);
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ return res.data.data;
|
|
|
+ }
|
|
|
+ return Promise.reject(new Error(res.data.message));
|
|
|
+}
|
|
|
+
|