|
@@ -24,7 +24,7 @@
|
|
|
type="success"
|
|
type="success"
|
|
|
size="mini"
|
|
size="mini"
|
|
|
@click="handleAudit(1)"
|
|
@click="handleAudit(1)"
|
|
|
- >通过
|
|
|
|
|
|
|
+ >通过
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<el-button
|
|
<el-button
|
|
|
icon="el-icon-circle-close"
|
|
icon="el-icon-circle-close"
|
|
@@ -32,7 +32,7 @@
|
|
|
size="mini"
|
|
size="mini"
|
|
|
@click="handleAudit(0)"
|
|
@click="handleAudit(0)"
|
|
|
v-if="!['starter', 'starterFillApprove'].includes(taskDefinitionKey)"
|
|
v-if="!['starter', 'starterFillApprove'].includes(taskDefinitionKey)"
|
|
|
- >驳回
|
|
|
|
|
|
|
+ >驳回
|
|
|
</el-button>
|
|
</el-button>
|
|
|
|
|
|
|
|
<!-- <el-button
|
|
<!-- <el-button
|
|
@@ -63,101 +63,104 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
- import { UpdateInformation } from '@/api/bpm/components/purchasingManage/purchaseOrder';
|
|
|
|
|
- import { approveTaskWithVariables } from '@/api/bpm/task';
|
|
|
|
|
- import { listAllUserBind } from '@/api/system/organization';
|
|
|
|
|
|
|
+import {UpdateInformation} from '@/api/bpm/components/purchasingManage/purchaseOrder';
|
|
|
|
|
+import {approveTaskWithVariables} from '@/api/bpm/task';
|
|
|
|
|
+import {listAllUserBind} from '@/api/system/organization';
|
|
|
|
|
|
|
|
- // 流程实例的详情页,可用于审批
|
|
|
|
|
- export default {
|
|
|
|
|
- name: '',
|
|
|
|
|
- components: {
|
|
|
|
|
- // Parser
|
|
|
|
|
|
|
+// 流程实例的详情页,可用于审批
|
|
|
|
|
+export default {
|
|
|
|
|
+ name: '',
|
|
|
|
|
+ components: {
|
|
|
|
|
+ // Parser
|
|
|
|
|
+ },
|
|
|
|
|
+ props: {
|
|
|
|
|
+ businessId: {
|
|
|
|
|
+ default: ''
|
|
|
},
|
|
},
|
|
|
- props: {
|
|
|
|
|
- businessId: {
|
|
|
|
|
- default: ''
|
|
|
|
|
- },
|
|
|
|
|
- taskId: {
|
|
|
|
|
- default: ''
|
|
|
|
|
- },
|
|
|
|
|
- id: {
|
|
|
|
|
- default: ''
|
|
|
|
|
- },
|
|
|
|
|
- id: {
|
|
|
|
|
- default: ''
|
|
|
|
|
- },
|
|
|
|
|
- taskDefinitionKey: {
|
|
|
|
|
- default: ''
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ taskId: {
|
|
|
|
|
+ default: ''
|
|
|
},
|
|
},
|
|
|
- data() {
|
|
|
|
|
- return {
|
|
|
|
|
- form: {
|
|
|
|
|
- technicianId: '',
|
|
|
|
|
- reason: ''
|
|
|
|
|
- },
|
|
|
|
|
- userOptions: []
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ id: {
|
|
|
|
|
+ default: ''
|
|
|
},
|
|
},
|
|
|
- created() {
|
|
|
|
|
- this.userOptions = [];
|
|
|
|
|
- listAllUserBind().then((data) => {
|
|
|
|
|
- this.userOptions.push(...data);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ id: {
|
|
|
|
|
+ default: ''
|
|
|
},
|
|
},
|
|
|
- methods: {
|
|
|
|
|
- /** 处理转办审批人 */
|
|
|
|
|
- handleUpdateAssignee() {
|
|
|
|
|
- this.$emit('handleUpdateAssignee');
|
|
|
|
|
- },
|
|
|
|
|
- /** 退回 */
|
|
|
|
|
- handleBackList() {
|
|
|
|
|
- this.$emit('handleBackList');
|
|
|
|
|
|
|
+ taskDefinitionKey: {
|
|
|
|
|
+ default: ''
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ form: {
|
|
|
|
|
+ technicianId: '',
|
|
|
|
|
+ reason: ''
|
|
|
},
|
|
},
|
|
|
|
|
+ userOptions: []
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ created() {
|
|
|
|
|
+ this.userOptions = [];
|
|
|
|
|
+ listAllUserBind().then((data) => {
|
|
|
|
|
+ this.userOptions.push(...data);
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ /** 处理转办审批人 */
|
|
|
|
|
+ handleUpdateAssignee() {
|
|
|
|
|
+ this.$emit('handleUpdateAssignee');
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 退回 */
|
|
|
|
|
+ handleBackList() {
|
|
|
|
|
+ this.$emit('handleBackList');
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
- async handleAudit(status) {
|
|
|
|
|
- //发起人补充
|
|
|
|
|
- if (this.taskDefinitionKey === 'starter') {
|
|
|
|
|
- let arr = await this.getTableValue();
|
|
|
|
|
- if (!arr) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- let data = await UpdateInformation(arr);
|
|
|
|
|
- if (data.code != '0') {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ async handleAudit(status) {
|
|
|
|
|
+ //发起人补充
|
|
|
|
|
+ if (this.taskDefinitionKey === 'starter') {
|
|
|
|
|
+ let arr = await this.getTableValue();
|
|
|
|
|
+ let isFlag = arr.productList.some(item => item.supplierMark == '')
|
|
|
|
|
+ if (isFlag) {
|
|
|
|
|
+ return this.$message.warning('请输入供应商代号')
|
|
|
}
|
|
}
|
|
|
- this._approveTaskWithVariables(status);
|
|
|
|
|
- },
|
|
|
|
|
- async _approveTaskWithVariables(status) {
|
|
|
|
|
- let variables = {
|
|
|
|
|
- pass: !!status
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- approveTaskWithVariables({
|
|
|
|
|
- id: this.taskId,
|
|
|
|
|
- reason: this.form.reason,
|
|
|
|
|
- variables
|
|
|
|
|
- }).then((res) => {
|
|
|
|
|
- if (res.data.code != '-1') {
|
|
|
|
|
- this.$emit('handleAudit', {
|
|
|
|
|
- status,
|
|
|
|
|
- title: status === 0 ? '驳回' : ''
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ if (!arr) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ let data = await UpdateInformation(arr);
|
|
|
|
|
+ if (data.code != '0') {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ this._approveTaskWithVariables(status);
|
|
|
|
|
+ },
|
|
|
|
|
+ async _approveTaskWithVariables(status) {
|
|
|
|
|
+ let variables = {
|
|
|
|
|
+ pass: !!status
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
- getTableValue() {
|
|
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
|
|
- this.$emit('getTableValue', async (data) => {
|
|
|
|
|
- resolve(await data);
|
|
|
|
|
|
|
+ approveTaskWithVariables({
|
|
|
|
|
+ id: this.taskId,
|
|
|
|
|
+ reason: this.form.reason,
|
|
|
|
|
+ variables
|
|
|
|
|
+ }).then((res) => {
|
|
|
|
|
+ if (res.data.code != '-1') {
|
|
|
|
|
+ this.$emit('handleAudit', {
|
|
|
|
|
+ status,
|
|
|
|
|
+ title: status === 0 ? '驳回' : ''
|
|
|
});
|
|
});
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ getTableValue() {
|
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
|
+ this.$emit('getTableValue', async (data) => {
|
|
|
|
|
+ resolve(await data);
|
|
|
});
|
|
});
|
|
|
- }
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
- };
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss"></style>
|
|
<style lang="scss"></style>
|