|
@@ -34,7 +34,22 @@
|
|
|
</HcTooltip>
|
|
|
<HcTooltip keys="system-service-plan-send-btn">
|
|
|
<el-button
|
|
|
- v-if="status === 1 || status === 3 "
|
|
|
+ v-if="status === 1 "
|
|
|
+ class="node-card-plan-btn ml-6"
|
|
|
+ hc-btn
|
|
|
+ keys="system-service-plan-send-btn"
|
|
|
+ type="warning"
|
|
|
+ :loading="sendPlanLoad"
|
|
|
+ :disabled="!isWriteUserAuthorized"
|
|
|
+ @click="sendPlan"
|
|
|
+ >
|
|
|
+ <HcIcon name="send-plane" />
|
|
|
+ 发送计划
|
|
|
+ </el-button>
|
|
|
+ </HcTooltip>
|
|
|
+ <HcTooltip keys="system-service-plan-send-btn">
|
|
|
+ <el-button
|
|
|
+ v-if="status === 3 "
|
|
|
class="node-card-plan-btn ml-6"
|
|
|
hc-btn
|
|
|
keys="system-service-plan-send-btn"
|
|
@@ -54,6 +69,7 @@
|
|
|
keys="system-service-plan-back-btn"
|
|
|
:loading="sendPlanLoad"
|
|
|
type="warning"
|
|
|
+ :disabled="!isSendUserAuthorized"
|
|
|
@click="sendPlanClick(3)"
|
|
|
>
|
|
|
<HcIcon name="arrow-go-back" />
|
|
@@ -68,6 +84,7 @@
|
|
|
hc-btn
|
|
|
keys="system-service-plan-comfirm-btn"
|
|
|
type="success"
|
|
|
+ :disabled="!isSendUserAuthorized"
|
|
|
@click="sendPlanClick(4)"
|
|
|
>
|
|
|
<HcIcon name="check" />
|
|
@@ -95,7 +112,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { ref, watch } from 'vue'
|
|
|
+import { computed, ref, watch } from 'vue'
|
|
|
import { arrToKey, deepClone, getObjVal, isString } from 'js-fast-way'
|
|
|
import HcUserModal from './hc-tasks-user/user-modal.vue'
|
|
|
import { useAppStore } from '~src/store'
|
|
@@ -127,9 +144,12 @@ const isTableForm = ref(false)
|
|
|
const useAppState = useAppStore()
|
|
|
const projectId = ref(useAppState.getProjectId)
|
|
|
const contractId = ref(useAppState.getContractId)
|
|
|
+const { user_id } = ref(useAppState.getUserInfo)
|
|
|
const status = ref()
|
|
|
|
|
|
watch(isShow, (val) => {
|
|
|
+
|
|
|
+
|
|
|
if (val) {
|
|
|
if (val) getExcelHtml()
|
|
|
tableFormData.value = {}
|
|
@@ -231,6 +251,14 @@ const sendPlan = ()=>{
|
|
|
isUserModalShow.value = true
|
|
|
|
|
|
}
|
|
|
+// 计算属性:判断 writeUser 是否包含 user_id
|
|
|
+const isWriteUserAuthorized = computed(() => {
|
|
|
+ return writeUser.value.includes(user_id.value)
|
|
|
+})
|
|
|
+// 计算属性:判断 sendUser 是否包含 user_id
|
|
|
+const isSendUserAuthorized = computed(() => {
|
|
|
+ return sendUser.value.includes(user_id.value)
|
|
|
+})
|
|
|
const isUserModalShow = ref(false)
|
|
|
const userData = ref([])
|
|
|
const dataInfo = ref({
|
|
@@ -328,6 +356,8 @@ const previewPlan = async ()=>{
|
|
|
window?.$message?.error('暂无预览文件')
|
|
|
}
|
|
|
}
|
|
|
+const sendUser = ref('')
|
|
|
+const writeUser = ref('')
|
|
|
const getDetailData = async ()=>{
|
|
|
const { error, code, data } = await dataApi.getDetail({
|
|
|
id: dataId.value,
|
|
@@ -337,11 +367,15 @@ const getDetailData = async ()=>{
|
|
|
const res = getObjVal(data)
|
|
|
|
|
|
status.value = res.status
|
|
|
-
|
|
|
+ sendUser.value = res.sendUser
|
|
|
+ writeUser.value = res.updateUser
|
|
|
+
|
|
|
|
|
|
} else {
|
|
|
|
|
|
status.value = ''
|
|
|
+ sendUser.value = ''
|
|
|
+ writeUser.value = ''
|
|
|
}
|
|
|
}
|
|
|
</script>
|