|
|
@@ -21,11 +21,21 @@
|
|
|
<el-input type="textarea" v-model="form.reason" placeholder="请输入审批建议" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px">
|
|
|
+ <div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px" v-if="clientEnvironmentId == 3">
|
|
|
<el-button icon="el-icon-edit-outline" type="success" size="mini" @click="handleAudit(1)">通过
|
|
|
</el-button>
|
|
|
|
|
|
- <el-button icon="el-icon-circle-close" type="danger" size="mini" @click="handleAudit(0)">驳回
|
|
|
+ <el-button icon="el-icon-circle-close" v-if="taskDefinitionKey != 'purchaseLeader'" type="danger" size="mini" @click="handleAudit(0)">驳回
|
|
|
+ </el-button>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 索尔 -->
|
|
|
+ <div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px" v-if="clientEnvironmentId == 2">
|
|
|
+ <el-button icon="el-icon-edit-outline" type="success" size="mini" @click="handleAudit2(1)">通过
|
|
|
+ </el-button>
|
|
|
+
|
|
|
+ <el-button icon="el-icon-circle-close" type="danger" size="mini" @click="handleAudit2(0)">驳回
|
|
|
</el-button>
|
|
|
|
|
|
</div>
|
|
|
@@ -72,6 +82,12 @@ export default {
|
|
|
|
|
|
};
|
|
|
},
|
|
|
+
|
|
|
+ computed: {
|
|
|
+ clientEnvironmentId() {
|
|
|
+ return this.$store.state.user.info.clientEnvironmentId;
|
|
|
+ },
|
|
|
+ },
|
|
|
created() {
|
|
|
if (this.taskDefinitionKey == 'purchaseLeader')
|
|
|
this.userOptionsFn()
|
|
|
@@ -87,14 +103,20 @@ export default {
|
|
|
|
|
|
async handleAudit(status) {
|
|
|
|
|
|
- if (this.taskDefinitionKey == 'purchaseLeader') {
|
|
|
+ if (this.taskDefinitionKey == 'purchaseLeader') { // 采购主管审核
|
|
|
this._approveTaskPurchaseLeader(status)
|
|
|
- } else {
|
|
|
+ } else if (this.taskDefinitionKey == 'deptLeader') {
|
|
|
this._approveTaskWithVariables(status);
|
|
|
}
|
|
|
|
|
|
|
|
|
},
|
|
|
+
|
|
|
+
|
|
|
+ handleAudit2(status) {
|
|
|
+ this._approveTaskThorVariables(status)
|
|
|
+ },
|
|
|
+
|
|
|
async _approveTaskWithVariables(status) {
|
|
|
let variables = {
|
|
|
pass: !!status
|
|
|
@@ -130,9 +152,9 @@ export default {
|
|
|
|
|
|
}).then((res) => {
|
|
|
this.$emit('handleAudit', {
|
|
|
- status,
|
|
|
- title: ''
|
|
|
- });
|
|
|
+ status,
|
|
|
+ title: ''
|
|
|
+ });
|
|
|
});
|
|
|
} else if (status == 0) {
|
|
|
outsourceNotPass({
|
|
|
@@ -141,9 +163,9 @@ export default {
|
|
|
pass: false
|
|
|
}).then((res) => {
|
|
|
this.$emit('handleAudit', {
|
|
|
- status,
|
|
|
- title: '驳回'
|
|
|
- });
|
|
|
+ status,
|
|
|
+ title: '驳回'
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -151,6 +173,39 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
+ async _approveTaskThorVariables(status) {
|
|
|
+
|
|
|
+
|
|
|
+ if (status == 1) {
|
|
|
+
|
|
|
+ outsourceAssign({
|
|
|
+ businessId: this.businessId,
|
|
|
+ id: this.taskId,
|
|
|
+ reason: this.form.reason,
|
|
|
+ pass: true
|
|
|
+
|
|
|
+ }).then((res) => {
|
|
|
+ this.$emit('handleAudit', {
|
|
|
+ status,
|
|
|
+ title: ''
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else if (status == 0) {
|
|
|
+ outsourceNotPass({
|
|
|
+ id: this.taskId,
|
|
|
+ reason: this.form.reason,
|
|
|
+ pass: false
|
|
|
+ }).then((res) => {
|
|
|
+ this.$emit('handleAudit', {
|
|
|
+ status,
|
|
|
+ title: '驳回'
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|
|
|
};
|