|
@@ -80,7 +80,7 @@ import SamplePDF from "@/components/PDF/samplePDF.vue";
|
|
|
import byTable from "@/components/byTable/index";
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const props = defineProps({
|
|
|
- contractId: String,
|
|
|
+ sampleId: String,
|
|
|
code: String,
|
|
|
});
|
|
|
const activeName = ref("first");
|
|
@@ -88,7 +88,7 @@ const currentItem = ref({});
|
|
|
const rowData = ref({});
|
|
|
const rowDataOne = ref({});
|
|
|
const leftList = ref([]);
|
|
|
-const contractDataList = ref([]);
|
|
|
+const sampleDataList = ref([]);
|
|
|
const purchaseDataList = ref([]);
|
|
|
const tableData = ref([]);
|
|
|
const transactionType = ref([
|
|
@@ -186,12 +186,7 @@ const pushProcessApproval = (row) => {
|
|
|
};
|
|
|
const handleChange = (val) => {
|
|
|
if (val === "first") {
|
|
|
- // leftList.value = contractDataList.value;
|
|
|
- leftList.value = [
|
|
|
- {
|
|
|
- id: props.contractId,
|
|
|
- },
|
|
|
- ];
|
|
|
+ leftList.value = sampleDataList.value;
|
|
|
}
|
|
|
if (val === "second") {
|
|
|
leftList.value = purchaseDataList.value;
|
|
@@ -200,46 +195,37 @@ const handleChange = (val) => {
|
|
|
handleItemClick(leftList.value[0]);
|
|
|
}
|
|
|
};
|
|
|
-if (props.contractId) {
|
|
|
- leftList.value = [
|
|
|
- {
|
|
|
- id: props.contractId,
|
|
|
- },
|
|
|
- ];
|
|
|
- handleItemClick(leftList.value[0]);
|
|
|
-}
|
|
|
+
|
|
|
const getDetailsData = () => {
|
|
|
+ proxy.post("/sample/getVersionList", { id: props.sampleId }).then((res) => {
|
|
|
+ sampleDataList.value = res;
|
|
|
+ leftList.value = sampleDataList.value;
|
|
|
+ if (sampleDataList.value && sampleDataList.value.length > 0) {
|
|
|
+ handleItemClick(sampleDataList.value[0]);
|
|
|
+ }
|
|
|
+ });
|
|
|
proxy
|
|
|
- .post("/contract/getVersionList", { id: props.contractId })
|
|
|
- .then((res) => {
|
|
|
- contractDataList.value = res;
|
|
|
- leftList.value = contractDataList.value;
|
|
|
- if (contractDataList.value && contractDataList.value.length > 0) {
|
|
|
- handleItemClick(contractDataList.value[0]);
|
|
|
- }
|
|
|
- });
|
|
|
- proxy
|
|
|
- .post("/contract/getPurchaseListByContractId", { id: props.contractId })
|
|
|
+ .post("/sample/getPurchaseListBySampleId", { id: props.sampleId })
|
|
|
.then((res) => {
|
|
|
purchaseDataList.value = res;
|
|
|
});
|
|
|
|
|
|
proxy
|
|
|
- .post("/contract/getAccountRunningWaterByContractId", {
|
|
|
- id: props.contractId,
|
|
|
+ .post("/sample/getAccountRunningWaterBySampleId", {
|
|
|
+ id: props.sampleId,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
tableData.value = res;
|
|
|
});
|
|
|
};
|
|
|
-// getDetailsData();
|
|
|
+getDetailsData();
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.content-box {
|
|
|
display: flex;
|
|
|
.left {
|
|
|
- width: 120px;
|
|
|
+ width: 130px;
|
|
|
// background: #ccc;
|
|
|
.left-item {
|
|
|
height: 36px;
|