212cf865 by lihua

数据交付接口联调

1 parent 2142750a
......@@ -12,4 +12,23 @@ export const deleteDeliveryContract = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/contract-delivery/delete`,
method: 'delete',
data: params
});
\ No newline at end of file
});
/** 获取查看核验信息明细接口 */
export const getDeliveryVerifyDetail = (guid) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/contract-delivery/verify-detail?deliveryGuid=${guid}`,
method: 'get'
});
/** 更新核验状态 */
export const verifyStatusChange = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/contract-delivery/verify-status-change`,
method: 'post',
data: params
})
/** 交付合约 */
export const deliveryContract = (guid) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/contract-delivery/delivery?deliveryGuid=${guid}`,
method: 'post'
})
\ No newline at end of file
......
......@@ -3,7 +3,10 @@ import TableTools from "@/components/Tools/table_tools.vue";
import { commonPageConfig, TableColumnWidth } from '@/utils/enum';
import {
getPageList,
deleteDeliveryContract
deleteDeliveryContract,
getDeliveryVerifyDetail,
verifyStatusChange,
deliveryContract
} from "@/api/modules/dataDelivery";
const router = useRouter();
......@@ -121,6 +124,15 @@ const tableFields = ref([
}, click: (scope) => {
//弹出查看日志框。
dialogInfo.value.visible = true;
execTableInfo.value.loading = true;
getDeliveryVerifyDetail(scope.row.guid).then((res: any) => {
execTableInfo.value.loading = false;
if (res?.code == proxy.$passCode) {
execTableInfo.value.data = res.data || [];
} else {
res?.msg && proxy.$ElMessage.error(res?.msg);
}
})
},
},
getName: (scope) => {
......@@ -170,7 +182,7 @@ const tableInfo = ref({
rowKey: 'guid',
loading: false,
fields: tableFields.value,
data: [{verifySatus: 2}, { verifySatus: 4 }, { verifySatus: 3, deliveryStatus: 2, }],
data: [], //{ verifySatus: 2 }, { verifySatus: 4 }, { verifySatus: 3, deliveryStatus: 2, }
page: {
type: "normal",
rows: 0,
......@@ -216,14 +228,24 @@ const tableInfo = ref({
if (verifySatus == 2) {
btns.push({
value: 'verify', label: '核验', click: (scope) => {
currTableData.value = scope.row;
verifyDialogInfo.value.visible = true;
verifyDialogInfo.value.contents[0].formInfo.items[0].default = 'TG';
verifyDialogInfo.value.contents[0].formInfo.items[1].default = '';
}
});
}
//已通过且未交付时,有交付按钮
verifySatus == 3 && deliveryStatus != 2 && btns.push({
value: 'delivery', label: '交付', click: (scope) => {
deliveryContract(scope.row.guid).then((res: any) => {
if (res?.code == proxy.$passCode) {
getTableData();
proxy.$ElMessage.success('交付提交成功');
} else {
res?.msg && proxy.$ElMessage.error(res?.msg);
}
})
}
});
return btns;
......@@ -256,8 +278,8 @@ const getTableData = () => {
}).then((res: any) => {
tableInfo.value.loading = false
if (res?.code == proxy.$passCode) {
const data = res.data || {}
// tableInfo.value.data = data.records || []
const data = res.data || {};
tableInfo.value.data = data.records || []
tableInfo.value.page.limit = data.pageSize
tableInfo.value.page.curr = data.pageIndex
tableInfo.value.page.rows = data.totalRows
......@@ -338,7 +360,7 @@ const verifyDialogInfo = ref({
{
type: 'radio-group',
label: ' ',
field: 'verifySatus ',
field: 'verifySatus',
default: 'TG',
required: false,
options: [
......@@ -354,7 +376,7 @@ const verifyDialogInfo = ref({
clearable: true,
required: true,
maxlength: 200,
visible: true,
visible: false,
block: true,
col: 'margin_b_0',
}
......@@ -370,13 +392,28 @@ const verifyDialogInfo = ref({
},
});
const verifyDialogRadioChange = (val, row, info) => {
const verifyDialogRadioChange = (val, info) => {
verifyDialogInfo.value.contents[0].formInfo.items[1].visible = val == 'NTG';
}
const verifyDialogBtnClick = (btn, info) => {
if (btn.value == 'submit') {
debugger
if (!info.verifySuggest) {
proxy.$ElMessage.error('请先填写未通过理由');
return;
}
verifyDialogInfo.value.footer.btns[1].loading = true;
verifyStatusChange(Object.assign({}, info, {
deliveryGuid: currTableData.value.guid
})).then((res: any) => {
verifyDialogInfo.value.footer.btns[1].loading = false;
if (res?.code == proxy.$passCode) {
proxy.$ElMessage.success('核验状态提交成功');
getTableData();
} else {
res?.msg && proxy.$ElMessage.error(res?.msg)
}
})
} else if (btn.value == 'cancel') {
verifyDialogInfo.value.visible = false;
}
......@@ -396,7 +433,8 @@ const verifyDialogBtnClick = (btn, info) => {
:close-on-click-modal="true" destroy-on-close align-center @close="handleDialogCancel">
<Table ref="execTableRef" :tableInfo="execTableInfo" class="exec-table" />
</el-dialog>
<Dialog :dialogInfo="verifyDialogInfo" @btnClick="verifyDialogBtnClick" @radio-group-change=verifyDialogRadioChange />
<Dialog :dialogInfo="verifyDialogInfo" @btnClick="verifyDialogBtnClick"
@radio-group-change=verifyDialogRadioChange />
</div>
</template>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!