|
@@ -1,26 +1,56 @@
|
|
|
<template>
|
|
|
<div style="width: 100%; padding: 0px 15px">
|
|
|
<byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom">
|
|
|
-
|
|
|
+ <template #btn>
|
|
|
+ <div style="width:100%;display:flex">
|
|
|
+ <div style="width:calc(100% - 105px)">
|
|
|
+ <el-form-item label="关联销售合同" prop="contractCode" class="margin-b-0">
|
|
|
+ <el-input disabled v-model="formData.data.contractCode" placeholder="请选择"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <el-button type="primary" style="width:88px;margin-left:15px" @click="openSelectContrct = true" plain>选择订单</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</byForm>
|
|
|
-
|
|
|
+ <el-dialog v-model="openSelectContrct" title="选择订单" width="80%" append-to-body>
|
|
|
+ <ContractSelect @handleSelectContrct="handleSelectContrct"></ContractSelect>
|
|
|
+ <template #footer>
|
|
|
+ <span class="dialog-footer">
|
|
|
+ <el-button @click="openSelectContrct = false">取消</el-button>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
import byForm from "@/components/byForm/index";
|
|
|
import { useRoute } from "vue-router";
|
|
|
+import ContractSelect from "@/views/salesMange/saleContract/contractSelect/index";
|
|
|
+
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const route = useRoute();
|
|
|
// 接收父组件的传值
|
|
|
const props = defineProps({
|
|
|
queryData: Object,
|
|
|
});
|
|
|
+const openSelectContrct = ref(false);
|
|
|
const sealType = computed(() => proxy.useUserStore().allDict["seal_type"]);
|
|
|
+const sealCategory = computed(
|
|
|
+ () => proxy.useUserStore().allDict["seal_category"]
|
|
|
+);
|
|
|
+const sealIsContract = computed(
|
|
|
+ () => proxy.useUserStore().allDict["seal_is_contract"]
|
|
|
+);
|
|
|
+const selectData = ref([]);
|
|
|
const userList = ref([]);
|
|
|
-const sss = ref([]);
|
|
|
const formData = reactive({
|
|
|
- data: {},
|
|
|
+ data: {
|
|
|
+ useMethod: "2",
|
|
|
+ fileList: [],
|
|
|
+ companyFileList: [],
|
|
|
+ customerFileList: [],
|
|
|
+ },
|
|
|
});
|
|
|
const formDom = ref(null);
|
|
|
const judgeStatus = () => {
|
|
@@ -59,7 +89,7 @@ const formConfig = computed(() => {
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
|
- prop: "subcribeUserId",
|
|
|
+ prop: "createUser",
|
|
|
label: "申请人",
|
|
|
required: true,
|
|
|
filterable: true,
|
|
@@ -68,7 +98,7 @@ const formConfig = computed(() => {
|
|
|
},
|
|
|
{
|
|
|
type: "date",
|
|
|
- prop: "subcribeTime",
|
|
|
+ prop: "applyTime",
|
|
|
itemType: "date",
|
|
|
label: "申请日期",
|
|
|
itemWidth: 50,
|
|
@@ -76,16 +106,16 @@ const formConfig = computed(() => {
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
|
- prop: "subcribeUserId",
|
|
|
+ prop: "sealIds",
|
|
|
label: "印章名称",
|
|
|
filterable: true,
|
|
|
multiple: true,
|
|
|
- data: sss.value,
|
|
|
+ data: selectData.value,
|
|
|
itemWidth: 50,
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
|
- prop: "subcribeUserId",
|
|
|
+ prop: "useMethod",
|
|
|
label: "使用方式",
|
|
|
filterable: true,
|
|
|
data: [
|
|
@@ -106,125 +136,184 @@ const formConfig = computed(() => {
|
|
|
label: "印章类型",
|
|
|
data: sealType.value,
|
|
|
itemWidth: 50,
|
|
|
+ isShow: formData.data.useMethod == "2",
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
|
- prop: "subcribeUserId",
|
|
|
+ prop: "isStamped",
|
|
|
label: "是否盖过章",
|
|
|
filterable: true,
|
|
|
data: [
|
|
|
{
|
|
|
- label: "借章",
|
|
|
- value: "1",
|
|
|
+ label: "是",
|
|
|
+ value: 1,
|
|
|
},
|
|
|
{
|
|
|
- label: "盖章",
|
|
|
- value: "2",
|
|
|
+ label: "否",
|
|
|
+ value: 0,
|
|
|
},
|
|
|
],
|
|
|
itemWidth: 50,
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
|
- prop: "sealType",
|
|
|
+ prop: "stampedType",
|
|
|
label: "盖章类别",
|
|
|
- data: sealType.value,
|
|
|
+ data: sealCategory.value,
|
|
|
itemWidth: 50,
|
|
|
},
|
|
|
- {
|
|
|
- type: "upload",
|
|
|
- listType: "text",
|
|
|
- accept: "",
|
|
|
- prop: "fileList",
|
|
|
- label: "需盖章文件",
|
|
|
- },
|
|
|
+
|
|
|
{
|
|
|
type: "select",
|
|
|
- prop: "subcribeUserId",
|
|
|
+ prop: "isContract",
|
|
|
label: "是否销售合同",
|
|
|
filterable: true,
|
|
|
- data: [
|
|
|
- {
|
|
|
- label: "借章",
|
|
|
- value: "1",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "盖章",
|
|
|
- value: "2",
|
|
|
- },
|
|
|
- ],
|
|
|
+ data: sealIsContract.value,
|
|
|
itemWidth: 50,
|
|
|
+ isShow: formData.data.useMethod == "2",
|
|
|
},
|
|
|
{
|
|
|
type: "slot",
|
|
|
slotName: "btn",
|
|
|
- label: "关联销售合同",
|
|
|
+ label: "",
|
|
|
itemWidth: 50,
|
|
|
+ isShow: formData.data.useMethod == "2",
|
|
|
},
|
|
|
{
|
|
|
type: "date",
|
|
|
- prop: "subcribeTime",
|
|
|
+ prop: "borrowTime",
|
|
|
itemType: "date",
|
|
|
label: "借出日期",
|
|
|
itemWidth: 50,
|
|
|
disabled: false,
|
|
|
+ isShow: formData.data.useMethod == "1",
|
|
|
},
|
|
|
{
|
|
|
type: "date",
|
|
|
- prop: "subcribeTime",
|
|
|
+ prop: "returnedTime",
|
|
|
itemType: "date",
|
|
|
label: "归还日期",
|
|
|
itemWidth: 50,
|
|
|
disabled: false,
|
|
|
+ isShow: formData.data.useMethod == "1",
|
|
|
},
|
|
|
|
|
|
{
|
|
|
type: "input",
|
|
|
- prop: "subcribeContent",
|
|
|
+ prop: "remark",
|
|
|
itemType: "textarea",
|
|
|
label: "借出用途说明",
|
|
|
itemWidth: 100,
|
|
|
disabled: false,
|
|
|
+ isShow: formData.data.useMethod == "1",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "upload",
|
|
|
+ listType: "text",
|
|
|
+ accept: "",
|
|
|
+ prop: "fileList",
|
|
|
+ label: "需盖章文件",
|
|
|
+ isShow: formData.data.useMethod == "2",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "upload",
|
|
|
+ listType: "text",
|
|
|
+ accept: "",
|
|
|
+ prop: "companyFileList",
|
|
|
+ label: "公司已盖章文件",
|
|
|
+ isShow: formData.data.useMethod == "2",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "upload",
|
|
|
+ listType: "text",
|
|
|
+ accept: "",
|
|
|
+ prop: "customerFileList",
|
|
|
+ label: "客户已盖章文件",
|
|
|
+ isShow: formData.data.useMethod == "2",
|
|
|
},
|
|
|
];
|
|
|
});
|
|
|
|
|
|
const rules = ref({
|
|
|
- companyId: [{ required: true, message: "请选择业务公司", trigger: "change" }],
|
|
|
- deptId: [{ required: true, message: "请选择业务部门", trigger: "change" }],
|
|
|
- subcribeUserId: [
|
|
|
- { required: true, message: "请选择申请人", trigger: "change" },
|
|
|
+ createUser: [{ required: true, message: "请选择申请人", trigger: "change" }],
|
|
|
+ applyTime: [{ required: true, message: "请选择申请日期", trigger: "change" }],
|
|
|
+ sealIds: [{ required: true, message: "请选择印章名称", trigger: "change" }],
|
|
|
+ useMethod: [{ required: true, message: "请选择使用方式", trigger: "change" }],
|
|
|
+ isStamped: [
|
|
|
+ { required: true, message: "请选择是否盖过章", trigger: "change" },
|
|
|
],
|
|
|
- subcribeTime: [
|
|
|
- { required: true, message: "请选择申购时间", trigger: "change" },
|
|
|
+ sealType: [{ required: true, message: "请选择印章类型", trigger: "change" }],
|
|
|
+ stampedType: [
|
|
|
+ { required: true, message: "请选择盖章类别", trigger: "change" },
|
|
|
],
|
|
|
- putWarehouseId: [
|
|
|
- { required: true, message: "请选择入库仓库", trigger: "change" },
|
|
|
+ isContract: [
|
|
|
+ { required: true, message: "请选择是否销售合同", trigger: "change" },
|
|
|
],
|
|
|
- isSubstitute: [
|
|
|
- { required: true, message: "请选择是否代他人提交", trigger: "change" },
|
|
|
+ borrowTime: [
|
|
|
+ { required: true, message: "请选择借出日期", trigger: "change" },
|
|
|
],
|
|
|
- isInStock: [{ required: true, message: "请选择是否入库", trigger: "change" }],
|
|
|
- isAppoint: [
|
|
|
- { required: true, message: "请选择是否指定供应商", trigger: "change" },
|
|
|
+ returnedTime: [
|
|
|
+ { required: true, message: "请选择归还日期", trigger: "change" },
|
|
|
],
|
|
|
- supplierId: [{ required: true, message: "请选择供应商", trigger: "change" }],
|
|
|
- purposeRemark: [
|
|
|
- { required: true, message: "请输入申请用途", trigger: "blur" },
|
|
|
+ remark: [{ required: true, message: "请输入借出用途说明", trigger: "blur" }],
|
|
|
+ fileList: [
|
|
|
+ { required: true, message: "请选择需盖章文件", trigger: "change" },
|
|
|
],
|
|
|
- count: [{ required: true, message: "请输入数量", trigger: "blur" }],
|
|
|
- price: [{ required: true, message: "请输入单价(不含税)", trigger: "blur" }],
|
|
|
- priceIncludingTax: [
|
|
|
- { required: true, message: "请输入单价(含税)", trigger: "blur" },
|
|
|
+ contractCode: [
|
|
|
+ { required: true, message: "请选择销售订单", trigger: "blur" },
|
|
|
],
|
|
|
});
|
|
|
|
|
|
+const getDeptData = () => {
|
|
|
+ proxy
|
|
|
+ .get("/tenantUser/list", {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10000,
|
|
|
+ tenantId: proxy.useUserStore().user.tenantId,
|
|
|
+ companyId: proxy.useUserStore().user.companyId,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ userList.value = res.rows.map((item) => {
|
|
|
+ return {
|
|
|
+ label: item.nickName,
|
|
|
+ value: item.userId,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
+getDeptData();
|
|
|
+
|
|
|
+const getDict = () => {
|
|
|
+ proxy
|
|
|
+ .post("sealConfig/page", {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 999,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ selectData.value = res.rows.map((x) => ({
|
|
|
+ ...x,
|
|
|
+ label: x.name,
|
|
|
+ value: x.id,
|
|
|
+ }));
|
|
|
+ });
|
|
|
+};
|
|
|
+getDict();
|
|
|
+
|
|
|
+const handleSelectContrct = async (row) => {
|
|
|
+ formData.data.contractId = row.id;
|
|
|
+ formData.data.contractCode = row.code;
|
|
|
+ openSelectContrct.value = false;
|
|
|
+ return proxy.msgTip("选择成功", 1);
|
|
|
+};
|
|
|
+
|
|
|
const handleSubmit = async (isStag = false) => {
|
|
|
if (isStag) {
|
|
|
+ formData.data.sealIds = formData.data.sealIds.join(",");
|
|
|
return true;
|
|
|
}
|
|
|
let flag = await formDom.value.handleSubmit(() => {});
|
|
|
if (flag) {
|
|
|
+ formData.data.sealIds = formData.data.sealIds.join(",");
|
|
|
return true;
|
|
|
} else {
|
|
|
setTimeout(() => {
|
|
@@ -246,24 +335,20 @@ defineExpose({
|
|
|
|
|
|
const getAllData = (businessId) => {
|
|
|
if (businessId) {
|
|
|
- proxy.post("/subscribe/detail", { id: businessId }).then((res) => {
|
|
|
- formData.data = res;
|
|
|
- if (formData.data.supplierId) {
|
|
|
- formData.data.isAppoint = "1";
|
|
|
- changeSupplier(formData.data.supplierId);
|
|
|
+ proxy.post("/sealUse/detail", { id: businessId }).then((res) => {
|
|
|
+ if (res.sealIds) {
|
|
|
+ res.sealIds = res.sealIds.split(",");
|
|
|
} else {
|
|
|
- formData.data.isAppoint = "0";
|
|
|
- }
|
|
|
- if (formData.data.companyId) {
|
|
|
- getDeptData(formData.data.companyId);
|
|
|
+ res.sealIds = [];
|
|
|
}
|
|
|
+ formData.data = res;
|
|
|
|
|
|
proxy
|
|
|
.post("/fileInfo/getList", { businessIdList: [businessId] })
|
|
|
.then((fileObj) => {
|
|
|
if (fileObj[businessId] && fileObj[businessId].length > 0) {
|
|
|
- formData.data.purposeFileList = fileObj[businessId]
|
|
|
- .filter((x) => x.businessType == "15")
|
|
|
+ formData.data.fileList = fileObj[businessId]
|
|
|
+ .filter((x) => x.businessType == "10")
|
|
|
.map((item) => {
|
|
|
return {
|
|
|
...item,
|
|
@@ -271,8 +356,17 @@ const getAllData = (businessId) => {
|
|
|
url: item.fileUrl,
|
|
|
};
|
|
|
});
|
|
|
- formData.data.substituteFileList = fileObj[businessId]
|
|
|
- .filter((x) => x.businessType == "10")
|
|
|
+ formData.data.companyFileList = fileObj[businessId]
|
|
|
+ .filter((x) => x.businessType == "20")
|
|
|
+ .map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ name: item.fileName,
|
|
|
+ url: item.fileUrl,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ formData.data.customerFileList = fileObj[businessId]
|
|
|
+ .filter((x) => x.businessType == "30")
|
|
|
.map((item) => {
|
|
|
return {
|
|
|
...item,
|
|
@@ -281,8 +375,9 @@ const getAllData = (businessId) => {
|
|
|
};
|
|
|
});
|
|
|
} else {
|
|
|
- formData.data.purposeFileList = [];
|
|
|
- formData.data.substituteFileList = [];
|
|
|
+ formData.data.fileList = [];
|
|
|
+ formData.data.companyFileList = [];
|
|
|
+ formData.data.customerFileList = [];
|
|
|
}
|
|
|
});
|
|
|
});
|
|
@@ -291,11 +386,24 @@ const getAllData = (businessId) => {
|
|
|
|
|
|
onMounted(() => {
|
|
|
formOption.disabled = judgeStatus();
|
|
|
- formData.data.subcribeTime = proxy.parseTime(new Date());
|
|
|
- formData.data.subcribeUserId = proxy.useUserStore().user.userId;
|
|
|
+ formData.data.applyTime = proxy.parseTime(new Date());
|
|
|
+ formData.data.createUser = proxy.useUserStore().user.userId;
|
|
|
if (route.query.businessId) {
|
|
|
getAllData(route.query.businessId);
|
|
|
}
|
|
|
+ // 删除莫名多出的一个textarea
|
|
|
+ nextTick(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ let dom = document.getElementsByTagName("textarea");
|
|
|
+ if (dom && dom.length > 0) {
|
|
|
+ for (let i = 0; i < dom.length; i++) {
|
|
|
+ if (!dom[i].className) {
|
|
|
+ dom[i].style.display = "none";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, 100);
|
|
|
+ });
|
|
|
});
|
|
|
</script>
|
|
|
|