|
|
@@ -323,7 +323,14 @@
|
|
|
@click="save()"
|
|
|
v-loading="loading"
|
|
|
v-if="type != 'view'"
|
|
|
- >确认</el-button
|
|
|
+ >保存</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="save('submit')"
|
|
|
+ v-loading="loading"
|
|
|
+ v-if="type != 'view'"
|
|
|
+ >提交</el-button
|
|
|
>
|
|
|
|
|
|
<el-button @click="cancel">关闭</el-button>
|
|
|
@@ -332,10 +339,17 @@
|
|
|
ref="inspectionWorkDialog"
|
|
|
@changeParent="changeParent"
|
|
|
></inspectionWorkDialog>
|
|
|
+ <processSubmitDialog
|
|
|
+ :processSubmitDialogFlag.sync="processSubmitDialogFlag"
|
|
|
+ v-if="processSubmitDialogFlag"
|
|
|
+ ref="processSubmitDialogRef"
|
|
|
+ @reload="search"
|
|
|
+ ></processSubmitDialog>
|
|
|
</ele-modal>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
|
|
|
const defForm = {
|
|
|
code: '', //编码
|
|
|
name: '', //名称
|
|
|
@@ -368,7 +382,7 @@
|
|
|
import inspectionWorkDialog from '@/views/inspectionWork/components/inspectionWorkDialog.vue';
|
|
|
import { getCodeList, getCode } from '@/api/login';
|
|
|
export default {
|
|
|
- components: { bpmDetail, inspectionWorkDialog },
|
|
|
+ components: { bpmDetail, inspectionWorkDialog, processSubmitDialog },
|
|
|
props: {
|
|
|
isSampleRecord: {
|
|
|
default: false
|
|
|
@@ -376,6 +390,7 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ processSubmitDialogFlag: false,
|
|
|
form: { ...defForm },
|
|
|
activeComp: 'main',
|
|
|
tabOptions: [
|
|
|
@@ -401,7 +416,9 @@
|
|
|
quantity: [{ required: true, message: '请输入', trigger: 'change' }],
|
|
|
portion: [{ required: true, message: '请输入', trigger: 'change' }],
|
|
|
unit: [{ required: true, message: '请选择', trigger: 'change' }],
|
|
|
- packingUnit: [{ required: true, message: '请选择', trigger: 'change' }],
|
|
|
+ packingUnit: [
|
|
|
+ { required: true, message: '请选择', trigger: 'change' }
|
|
|
+ ]
|
|
|
},
|
|
|
sampleQuantityList: [
|
|
|
{ label: '批样', value: 1 },
|
|
|
@@ -1202,7 +1219,7 @@
|
|
|
return res;
|
|
|
},
|
|
|
/* 保存编辑 */
|
|
|
- save() {
|
|
|
+ save(type) {
|
|
|
if (this.type == 'add') {
|
|
|
[
|
|
|
'id',
|
|
|
@@ -1232,19 +1249,11 @@
|
|
|
//取整样
|
|
|
if (data.conditionType == 1) {
|
|
|
data.quantity = data.portion;
|
|
|
- // if (data.unit != data.measureUnit) {
|
|
|
- // data.quantity = this.sampleList.reduce(
|
|
|
- // (total, el) => total + Number(el.measureQuantity),
|
|
|
- // 0
|
|
|
- // );
|
|
|
- // } else {
|
|
|
- // data.quantity = this.form.portion;
|
|
|
- // }
|
|
|
+
|
|
|
data.measureUnit = this.tableList[0].measureUnit;
|
|
|
} else {
|
|
|
data.measureUnit = data.unit;
|
|
|
data.copies = data.portion;
|
|
|
- // data.quantity = data.quantity * data.copies;
|
|
|
}
|
|
|
}
|
|
|
this.loading = true;
|
|
|
@@ -1255,14 +1264,40 @@
|
|
|
})
|
|
|
.then((res) => {
|
|
|
this.$message.success('操作成功');
|
|
|
- this.cancel();
|
|
|
- this.$emit('reload');
|
|
|
+
|
|
|
+ if (type == 'submit') {
|
|
|
+ this.approvalSubmit(this.type == 'add' ? res : data.id);
|
|
|
+ } else {
|
|
|
+ this.cancel();
|
|
|
+ this.$emit('reload');
|
|
|
+ }
|
|
|
})
|
|
|
.finally(() => {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+ },
|
|
|
+ async approvalSubmit(id) {
|
|
|
+ const res = await getById(id);
|
|
|
+ this.processSubmitDialogFlag = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let params = {
|
|
|
+ businessId: res.id,
|
|
|
+ businessKey: 'sampling_approval_process',
|
|
|
+ formCreateUserId: res.createUserId,
|
|
|
+ variables: {
|
|
|
+ businessCode: res.code,
|
|
|
+ businessName: '取样',
|
|
|
+ businessType: res.conditionType == 1 ? '整样' : '小样'
|
|
|
+ }
|
|
|
+ };
|
|
|
+ this.$refs.processSubmitDialogRef.init(params);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ search() {
|
|
|
+ this.cancel();
|
|
|
+ this.$emit('reload');
|
|
|
}
|
|
|
}
|
|
|
};
|