确定
+
@@ -517,7 +517,7 @@
@@ -544,7 +544,8 @@ import {
getContract,
addContrant,
delContract,
- checkContractName
+ checkContractName,
+ updateStatus
} from "@/api/contract/contract"
import {
getparameter
@@ -570,6 +571,7 @@ import {
import {
getToken
} from '@/utils/auth'
+import { getOutDetail } from "@/api/out"
import editor from "./components/editorContract"
import detail from "./components/detailContract"
import paymentRegistration from "./components/paymentRegistration";
@@ -673,6 +675,7 @@ export default {
return {
userList: ["liuxiangyu", "zhushulan", "admin", "jiangjiao"],
+ nowContract: {},
window: {
width: 0,
height: 0,
@@ -1491,6 +1494,13 @@ export default {
this.getContracts();
},
+ //
+ setNowContract(contract,tbname) {
+ this.nowContract = {
+ ...contract,
+ tbname
+ }
+ },
//点击付款计划查看
showPaymentPlan(row, column, cell) {
if (column.property === 'sign_plan_count') {
@@ -1509,7 +1519,7 @@ export default {
"项目名称": row?.name,
"项目预算(元)": row?.plan_price
}
- let res = await getOatoken()
+ //let res = await getOatoken()
let url =
`${process.env.VUE_APP_OUT_OLD}?s=/flow/add/modid/8&oatoken=${res.oatoken}&out_contract_id=${row.id}&contract_json=${JSON.stringify(baseInfo)}`
let bidding = window.open(url, 'bidding',
@@ -1519,10 +1529,12 @@ export default {
//采购流程
async buyProcess(row) {
+ this.setNowContract(row,'caigou')
let baseInfo = {
"title": row?.name,
//"采购形式": row?.purchase_type?.value,
- "iszhengfucaigou": row.purchase_type.value === "政府采购" ? "是" : "否",
+ "iszhengfucaigou": row.purchase_type.value === "政府采购" ? "政府采购" : "否",
+ "out_caigou_id": row.id,
"type": this.type.filter(item => {
return item.value === row.type
})[0]?.label,
@@ -1535,9 +1547,9 @@ export default {
}
},"")
}
- let res = await getOatoken()
+ // let res = await getOatoken()
let url =
- `${process.env.VUE_APP_OUT_OLD}?s=/flow/add/modid/8&username=${this.$store.state.user.username}&out_contract_id=${row.id}&contract_json=${JSON.stringify(baseInfo)}`
+ `${process.env.VUE_APP_OUT_OLD}?s=/flow/add/modid/8&id=${this.$store.state.user.userId}&username=${this.$store.state.user.username}&out_caigou_id=${row.id}&contract_json=${JSON.stringify(baseInfo)}`
let buyProcess = window.open(url, 'buyProcess',
`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`
)
@@ -1550,7 +1562,7 @@ export default {
"total": row?.money,
//"承包商\\供应商":row.supply
}
- let res = await getOatoken()
+ // let res = await getOatoken()
let url =
`${process.env.VUE_APP_OUT_OLD}?s=/flow/add/modid/9&username=${this.$store.state.user.username}&out_contract_id=${row.id}&contract_json=${JSON.stringify(baseInfo)}`
let signProcess = window.open(url, 'signProcess',
@@ -1761,6 +1773,13 @@ export default {
}
})
},
+ delSelections(val) {
+ this.selections.map((item, index) => {
+ if (item.id === val.id) {
+ this.selections.splice(index, 1)
+ }
+ })
+ },
//确认计划选择搜索
planSelectForSearch() {
if (this.select.plan_id == "") {
@@ -1805,13 +1824,14 @@ export default {
is_simple:this.form.is_simple,
supply:this.form.supply,
money:this.form?.money,
- status:this.form?.is_simple ? 2 : 1
+ status:this.form?.is_simple ? 2 : 1,
}).then(res => {
this.isShowAdd = false
Message({
type: 'success',
message: '操作成功'
})
+ this.selections = [];
this.$refs['addContract'].reset()
this.$refs['planTable'].clearSelection()
this.getContracts()
@@ -1836,16 +1856,21 @@ export default {
//框架合同
async getContractToContracts() {
const res = await getContract(this.contractSelect)
- this.contractList = res.list.data
+ let selectedIds = this.selections.map(i => i.id)
+ this.contractList = res.list.data.map(item => {
+ return {
+ ...item,
+ _checked: !!selectedIds.find(i => i === item.id),
+ }
+ })
this.contractTotal = res.list.total
},
selectionChange(selection) {
this.selections = Array.from(
new Set(
- selection.map((item) => item.id)
+ selection
)
);
- console.log(this.selections);
},
},
watch: {
@@ -1853,7 +1878,6 @@ export default {
if(val){
this.getContractToContracts();
}else{
- this.selections = [];
resetSelect(this.contractSelect);
this.contractList = [];
this.contractTotal = 0;
@@ -1883,8 +1907,32 @@ export default {
this.getPurchaseWay()
this.getMoneyWay()
//页面激活后刷新合同列表
- window.onfocus = () => {
- this.getContracts()
+ window.onfocus = async () => {
+ if(this.nowContract?.tbname && this.nowContract?.id) {
+ const res = await getOutDetail({tbname:this.nowContract.tbname,out_caigou_id:this.nowContract.id})
+ let flowIdMap = new Map([
+ ['caigou',8]
+ ])
+ let flowTypeMap = new Map([
+ ['caigou',2]
+ ])
+ let getStatus = (status) => {
+ if(status === 'end') {
+ return 1
+ }
+ if(Number(status)){
+ return 0
+ }
+ return -1
+ }
+ await updateStatus({
+ flow_id: flowIdMap.get(this.nowContract.tbname),
+ flow_type: flowTypeMap.get(this.nowContract.tbname),
+ out_contract_id: this.nowContract.id,
+ status: getStatus(res.flow?.current_step)
+ })
+ await this.getContracts()
+ }
}
},
created() {