diff --git a/src/http/api/contract-manage/index.ts b/src/http/api/contract-manage/index.ts
new file mode 100644
index 0000000..02d86b0
--- /dev/null
+++ b/src/http/api/contract-manage/index.ts
@@ -0,0 +1,18 @@
+import { get, post } from '../../index'
+
+// 新增合同
+export const addContractApi = (data: any = {}) => {
+ return post('/material-mall/contract/add', data)
+}
+// 合同列表
+export const getContractListApi = (data: any = {}) => {
+ return get('/material-mall/contract/list', data)
+}
+// 合同编辑
+export const editContractApi = (data: any = {}) => {
+ return post('/material-mall/contract/edit', data)
+}
+// 合同删除
+export const delContractApi = (data: any = {}) => {
+ return post('/material-mall/contract/del', data)
+}
\ No newline at end of file
diff --git a/src/views/user/contract-manage/index.vue b/src/views/user/contract-manage/index.vue
index f48a21f..f76dfec 100644
--- a/src/views/user/contract-manage/index.vue
+++ b/src/views/user/contract-manage/index.vue
@@ -10,94 +10,66 @@
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+ />
-
+
- 查询
重置
- 合同新增
-
+
+
+
+ 合同新建
+
+
+
- {{ row.leaseCode }}
+ {{ row.contractCode }}
-
-
+
+
查看
-
-
+
+
编辑
@@ -151,8 +123,7 @@
text
size="small"
type="primary"
- v-if="row.leaseStatus === 2"
- @click="onRepublish(row.id, true)"
+ @click="onDelete(row.id, true)"
>
删除
@@ -186,12 +157,12 @@
>
-
+
@@ -270,51 +241,58 @@ const isViewForm = ref(false)
const isDisabled = ref(false)
const uploadUrl = import.meta.env.VITE_API_URL + '/file/upload'
+
+const qualityLis = ref([])
+const queryFormRef = ref(null)
+
import {
- getEquipmentTypeApi, //装备类型
- getCompanyListApi, //所属公司
- getEquipmentListApi, //列表
-} from 'http/api/usercenter/goodsmang'
+ getContractListApi, //列表
+ addContractApi, //新增
+ editContractApi, //修改
+ delContractApi, //删除
+} from 'http/api/contract-manage'
import { InfoFilled, UploadFilled } from '@element-plus/icons-vue'
+const total = ref(0)
+const createTime = ref([])
/* 查询参数 */
-const queryParams: any = ref({
- deviceName: '',
- code: '',
- maStatus: '',
- typeId: '',
+const queryParams: any = reactive({
+ contractName: '',
+ contractCode: '',
+ startTime: '',
+ endTime: '',
pageSize: 10,
pageNum: 1,
})
-const addAndEditForm = reactive({
- htName: '',
+const addAndEditForm = ref({
+ id: '',
+ contractName: '',
fileInfoList: [],
fileInfoTempList: [],
+ bmFileInfoList: [],
})
-// 设备类型树
-const deviceTypeTree: any = ref([])
-const partTypeTreeProps: any = ref({
- children: 'children',
- label: 'name',
- multiple: false,
- value: 'id',
-})
-//所属公司
-const companyDataList: any = ref([])
-
-// 获取装备树
-const getTypeTreeData = async () => {
- const res: any = await getEquipmentTypeApi()
- console.log('treeData==========', res)
- deviceTypeTree.value = res.data
+// 获取列表
+const getContractListData = async () => {
+ if (createTime.value.length > 0) {
+ console.log('33333', createTime.value)
+ queryParams.startTime = createTime.value[0]
+ queryParams.endTime = createTime.value[1]
+ }
+ const { data: res }: any = await getContractListApi(queryParams)
+ qualityLis.value = res
+ total.value = res.total
}
-//获取所属公司下拉数据
-const getCompanyList = async () => {
- const res: any = await getCompanyListApi()
- console.log(res, '列表数据**--**-----------')
- companyDataList.value = res.data
+// 重置
+const onReset = () => {
+ createTime.value = []
+ queryParams.startTime = ''
+ queryParams.endTime = ''
+ queryParams.pageNum = 1
+ queryParams.pageSize = 10
+ queryFormRef.value.resetFields()
+ getContractListData()
}
//状态选择
@@ -332,8 +310,22 @@ const addContract = () => {
dialogVisibleSettlein.value = true;
}
+// 合同编辑
+const onContract = (row: any) => {
+ addAndEditForm.value.id = row.id
+ addAndEditForm.value.contractName = row.contractName
+ console.log('2222',addAndEditForm.value.contractName)
+ settleinTitle.value = '合同修改'
+ dialogVisibleSettlein.value = true
+}
+
const onDialogClose = () => {
- // addAndEditFormRef.value.resetFields()
+ addAndEditFormRef.value.resetFields()
+ addAndEditForm.value.fileInfoTempList = []
+ addAndEditForm.value.fileInfoList = []
+ addAndEditForm.value.bmFileInfoList = []
+ addAndEditForm.value.id = ''
+ addAndEditForm.value.contractName = ''
}
// 自定义事件
@@ -350,7 +342,7 @@ const onFileChange = (fileList: any) => {
}
const addAndEditFormRules = reactive({
- htName: [{ required: true, message: '请输入合同名称', trigger: 'blur' }],
+ contractName: [{ required: true, message: '请输入合同名称', trigger: 'blur' }],
fileInfoList: [{ required: true, message: '请上传合同附件', trigger: 'blur' }],
})
@@ -359,30 +351,43 @@ const onSubmit = () => {
addAndEditForm.value.fileInfoList = addAndEditForm.value.fileInfoTempList
addAndEditFormRef.value.validate(async (valid: any) => {
if (valid) {
- // const SEN_API = settleinTitle.value === '合同修改' ? editSafeBookApi : addSafeBookApi
- // const res: any = await SEN_API(addAndEditForm.value)
- // if (res.code === 200) {
- // ElMessage({
- // type: 'success',
- // message: '提交成功',
- // })
- // dialogVisibleSettlein.value = false
- // // getLeaseListData()
- // }
+ const SEN_API = settleinTitle.value === '合同修改' ? editContractApi : addContractApi
+ addAndEditForm.value.bmFileInfoList = addAndEditForm.value.fileInfoList
+ const res: any = await SEN_API(addAndEditForm.value)
+ if (res.code === 200) {
+ ElMessage({
+ type: 'success',
+ message: '提交成功',
+ })
+ dialogVisibleSettlein.value = false
+ getContractListData()
+ }
}
})
}
+// 删除
+const onDelete = async (id: any) => {
+ const res: any = await delContractApi({ id })
+ if (res.code === 200) {
+ ElMessage({
+ type: 'success',
+ message: '删除成功',
+ })
+ getContractListData()
+ }
+}
+
+
// 取消按钮
const onCancel = () => {
dialogVisibleSettlein.value = false
}
onMounted(() => {
- // 获取装备树
- getTypeTreeData()
- // 获取下拉
- getCompanyList()
+ getContractListData()
+ // getEquipmentTypeApi().then((res: any) => {
+ // deviceTypeTree.value = res.data
})
diff --git a/src/views/user/orderManagementCz/components/order-home.vue b/src/views/user/orderManagementCz/components/order-home.vue
index da1f79c..63d9b5e 100644
--- a/src/views/user/orderManagementCz/components/order-home.vue
+++ b/src/views/user/orderManagementCz/components/order-home.vue
@@ -618,6 +618,7 @@ const handleViewWord = () => {
insureList: [],
picList: [],
}
+ wordUrl.value = "http://127.0.0.1:29300/statics/2024/12/13/合同模板2_20241213133604A002.doc"
// 打开租赁协议弹框
dialogFormVisibleSettleWord.value = true
}
@@ -630,6 +631,8 @@ const contract = ref({
// 下载合同为 Word 文件
const downloadContract = () => {}
+
+const wordUrl = ref('')
@@ -1840,9 +1843,10 @@ const downloadContract = () => {}
destroy-on-close
:close-on-click-modal="false"
>
-
-

-
+
+
+
+