|
@@ -17,12 +17,6 @@
|
|
|
<el-button icon="el-icon-circle-close" type="danger" size="mini" @click="handleAudit(0)">驳回
|
|
<el-button icon="el-icon-circle-close" type="danger" size="mini" @click="handleAudit(0)">驳回
|
|
|
</el-button>
|
|
</el-button>
|
|
|
|
|
|
|
|
- <el-dropdown @command="(command) => handleCommand(command)" style="margin-left: 30px;">
|
|
|
|
|
- <span class="el-dropdown-link">更多<i class="el-icon-arrow-down el-icon--right"></i></span>
|
|
|
|
|
- <el-dropdown-menu slot="dropdown">
|
|
|
|
|
- <el-dropdown-item command="cancel">作废</el-dropdown-item>
|
|
|
|
|
- </el-dropdown-menu>
|
|
|
|
|
- </el-dropdown>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
@@ -32,9 +26,8 @@
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
|
|
|
-import { apspurchaseplan, cancel } from '@/api/bpm/components/apsMeterialPlan';
|
|
|
|
|
import { approveTaskWithVariables } from '@/api/bpm/task';
|
|
import { approveTaskWithVariables } from '@/api/bpm/task';
|
|
|
-import { listAllUserBind } from '@/api/system/organization';
|
|
|
|
|
|
|
+import { notPass } from '@/api/bpm/components/bomApprover';
|
|
|
|
|
|
|
|
// 流程实例的详情页,可用于审批
|
|
// 流程实例的详情页,可用于审批
|
|
|
export default {
|
|
export default {
|
|
@@ -60,39 +53,30 @@ export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
form: {
|
|
form: {
|
|
|
- technicianId: '',
|
|
|
|
|
reason: ''
|
|
reason: ''
|
|
|
},
|
|
},
|
|
|
- userOptions: []
|
|
|
|
|
|
|
+
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- this.userOptions = [];
|
|
|
|
|
- listAllUserBind().then((data) => {
|
|
|
|
|
- this.userOptions.push(...data);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
|
|
|
|
|
|
|
|
- async handleAudit(status, type) {
|
|
|
|
|
- //生产主管审批选择技术员
|
|
|
|
|
-
|
|
|
|
|
|
|
+ async handleAudit(status) {
|
|
|
|
|
|
|
|
this._approveTaskWithVariables(status);
|
|
this._approveTaskWithVariables(status);
|
|
|
},
|
|
},
|
|
|
async _approveTaskWithVariables(status) {
|
|
async _approveTaskWithVariables(status) {
|
|
|
|
|
|
|
|
-
|
|
|
|
|
if (status == 1) {
|
|
if (status == 1) {
|
|
|
|
|
|
|
|
- apspurchaseplan({
|
|
|
|
|
|
|
+ approveTaskWithVariables({
|
|
|
businessId: this.businessId,
|
|
businessId: this.businessId,
|
|
|
id: this.taskId,
|
|
id: this.taskId,
|
|
|
- userId: this.form.technicianId,
|
|
|
|
|
- userName: this.form.userName,
|
|
|
|
|
reason: this.form.reason,
|
|
reason: this.form.reason,
|
|
|
- pass: true
|
|
|
|
|
|
|
+ variables: { pass: true }
|
|
|
|
|
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
if (res.data.code != '-1') {
|
|
if (res.data.code != '-1') {
|
|
@@ -103,10 +87,10 @@ export default {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
} else if (status == 0) {
|
|
} else if (status == 0) {
|
|
|
- approveTaskWithVariables({
|
|
|
|
|
|
|
+ notPass({
|
|
|
|
|
+ businessId: this.businessId,
|
|
|
id: this.taskId,
|
|
id: this.taskId,
|
|
|
reason: this.form.reason,
|
|
reason: this.form.reason,
|
|
|
- pass: false
|
|
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
if (res.data.code != '-1') {
|
|
if (res.data.code != '-1') {
|
|
|
this.$emit('handleAudit', {
|
|
this.$emit('handleAudit', {
|
|
@@ -127,26 +111,7 @@ export default {
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- //更多
|
|
|
|
|
- handleCommand(command) {
|
|
|
|
|
- if (command === 'cancel') {
|
|
|
|
|
- this.$confirm("是否确认作废?", {
|
|
|
|
|
- type: 'warning',
|
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
|
- confirmButtonText: '确定'
|
|
|
|
|
- }).then(() => {
|
|
|
|
|
- cancel({
|
|
|
|
|
- id: this.taskId,
|
|
|
|
|
- reason: this.form.reason,
|
|
|
|
|
- businessId: this.businessId,
|
|
|
|
|
- }).then(() => {
|
|
|
|
|
- this.$emit('handleClose');
|
|
|
|
|
- }).catch(() => {
|
|
|
|
|
- this.$message.error("流程作废失败");
|
|
|
|
|
- });
|
|
|
|
|
- }).catch(() => {});
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|