|
|
@@ -1,120 +1,148 @@
|
|
|
<template>
|
|
|
- <ele-modal custom-class="ele-dialog-form long-dialog-form" :visible.sync="visibleDialog" title="报工"
|
|
|
- :close-on-click-modal="false" width="55%" append-to-body @close="handleClose" :maxable="true">
|
|
|
- <el-form ref="form" :model="addForm" label-width="100px">
|
|
|
- <el-form-item label="实际起始时间" prop="time">
|
|
|
- <el-date-picker v-model="addForm.time" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
- range-separator="至" start-placeholder="实际开始日期" end-placeholder="实际结束日期">
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="附件:" prop="attachments">
|
|
|
- <fileMain v-model="addForm.attachments"></fileMain>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="备注:" prop="reason">
|
|
|
- <el-input type="textarea" placeholder="请输入内容" v-model="addForm.reason">
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="footer">
|
|
|
- <el-button type="primary" @click="submitAdd">提交</el-button>
|
|
|
- <el-button @click="handleClose">取消</el-button>
|
|
|
- </div>
|
|
|
- </ele-modal>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
+ <ele-modal
|
|
|
+ custom-class="ele-dialog-form long-dialog-form"
|
|
|
+ :visible.sync="visibleDialog"
|
|
|
+ title="报工"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ width="85%"
|
|
|
+ append-to-body
|
|
|
+ @close="handleClose"
|
|
|
+ :maxable="true"
|
|
|
+ >
|
|
|
+ <el-form ref="form" :model="addForm" label-width="100px">
|
|
|
+ <el-form-item label="实际起始时间" prop="time">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="addForm.time"
|
|
|
+ type="datetimerange"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="实际开始日期"
|
|
|
+ end-placeholder="实际结束日期"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="附件:" prop="attachments">
|
|
|
+ <fileMain v-model="addForm.attachments"></fileMain>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="备注:" prop="reason">
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ v-model="addForm.reason"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
|
|
|
-import fileMain from '@/components/addDoc/index.vue';
|
|
|
+ <info ref="infoRef" type="view" :isPurchaseNeed="false"></info>
|
|
|
|
|
|
-import { reportWorkingSalesWorkOrder } from '@/api/salesServiceManagement/index'
|
|
|
+ <header-title title="方案"></header-title>
|
|
|
+ <spareParts ref="sparePartsRef" :type="type"></spareParts>
|
|
|
+ <div slot="footer" class="footer">
|
|
|
+ <el-button type="primary" @click="submitAdd">提交</el-button>
|
|
|
+ <el-button @click="handleClose">取消</el-button>
|
|
|
+ </div>
|
|
|
+ </ele-modal>
|
|
|
+</template>
|
|
|
|
|
|
-export default {
|
|
|
- props: {
|
|
|
- },
|
|
|
+<script>
|
|
|
+ import fileMain from '@/components/addDoc/index.vue';
|
|
|
+ import { getSalesWorkOrderById } from '@/api/salesServiceManagement/index';
|
|
|
+ import { reportWorkingSalesWorkOrder } from '@/api/salesServiceManagement/index';
|
|
|
+ import spareParts from '@/views/salesServiceManagement/components/sparePartsList.vue';
|
|
|
+ import info from '@/views/salesServiceManagement/components/info.vue';
|
|
|
+ export default {
|
|
|
+ props: {},
|
|
|
components: {
|
|
|
- fileMain
|
|
|
+ fileMain,
|
|
|
+ spareParts,
|
|
|
+ info
|
|
|
},
|
|
|
watch: {},
|
|
|
- computed: {
|
|
|
- },
|
|
|
+ computed: {},
|
|
|
data() {
|
|
|
- return {
|
|
|
- title: '',
|
|
|
- visibleDialog: false,
|
|
|
- addForm: {
|
|
|
- id: '',
|
|
|
- time: [],
|
|
|
- attachments: [],
|
|
|
- reason: '',
|
|
|
- },
|
|
|
- row: {}
|
|
|
- }
|
|
|
- },
|
|
|
- created() {
|
|
|
+ return {
|
|
|
+ title: '',
|
|
|
+ visibleDialog: false,
|
|
|
+ addForm: {
|
|
|
+ id: '',
|
|
|
+ time: [],
|
|
|
+ attachments: [],
|
|
|
+ reason: ''
|
|
|
+ },
|
|
|
+ row: {}
|
|
|
+ };
|
|
|
},
|
|
|
+ created() {},
|
|
|
methods: {
|
|
|
- open(row) {
|
|
|
- this.row = row;
|
|
|
- this.visibleDialog = true;
|
|
|
-
|
|
|
- },
|
|
|
- async submitAdd() {
|
|
|
- this.$refs.form.validate(async (valid) => {
|
|
|
- if (valid) {
|
|
|
- await reportWorkingSalesWorkOrder({
|
|
|
- acceptTime: this.addForm.time[0],
|
|
|
- finishTime: this.addForm.time[1],
|
|
|
- attachments: this.addForm.attachments,
|
|
|
- reason: this.addForm.reason,
|
|
|
-
|
|
|
- }).then((res) => {
|
|
|
- if (!res) return
|
|
|
- this.$message.success('操作成功')
|
|
|
- this.visibleDialog = false;
|
|
|
- this.$emit('reload');
|
|
|
- });
|
|
|
- } else {
|
|
|
- return false;
|
|
|
- }
|
|
|
+ open(row) {
|
|
|
+ this.row = row;
|
|
|
+ this.visibleDialog = true;
|
|
|
+ this.getDetail(row);
|
|
|
+ },
|
|
|
+ async getDetail(row) {
|
|
|
+ console.log(row,'row')
|
|
|
+ const res = await getSalesWorkOrderById(row.id);
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.infoRef.init(res.afterSalesDemandVO);
|
|
|
+ this.$refs.sparePartsRef.setTableValue(res?.costListVOS || []);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async submitAdd() {
|
|
|
+ this.$refs.form.validate(async (valid) => {
|
|
|
+ if (valid) {
|
|
|
+ await reportWorkingSalesWorkOrder({
|
|
|
+ acceptTime: this.addForm.time[0],
|
|
|
+ finishTime: this.addForm.time[1],
|
|
|
+ attachments: this.addForm.attachments,
|
|
|
+ reason: this.addForm.reason
|
|
|
+ }).then((res) => {
|
|
|
+ if (!res) return;
|
|
|
+ this.$message.success('操作成功');
|
|
|
+ this.visibleDialog = false;
|
|
|
+ this.$emit('reload');
|
|
|
});
|
|
|
- },
|
|
|
- handleClose() {
|
|
|
- this.visibleDialog = false;
|
|
|
- },
|
|
|
-
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleClose() {
|
|
|
+ this.visibleDialog = false;
|
|
|
+ }
|
|
|
}
|
|
|
-};
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.dialog_top {
|
|
|
+ .dialog_top {
|
|
|
margin-bottom: 10px;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
|
|
|
span {
|
|
|
- margin-left: 50px;
|
|
|
+ margin-left: 50px;
|
|
|
}
|
|
|
|
|
|
.name {
|
|
|
- font-weight: 800;
|
|
|
- color: #40a9ff;
|
|
|
+ font-weight: 800;
|
|
|
+ color: #40a9ff;
|
|
|
}
|
|
|
-}
|
|
|
+ }
|
|
|
|
|
|
-::v-deep .el-row {
|
|
|
+ ::v-deep .el-row {
|
|
|
display: flex;
|
|
|
flex-wrap: wrap;
|
|
|
-}
|
|
|
+ }
|
|
|
|
|
|
-.btns {
|
|
|
+ .btns {
|
|
|
text-align: right;
|
|
|
// margin: 10px 0;
|
|
|
-}
|
|
|
+ }
|
|
|
|
|
|
-.main_container {
|
|
|
+ .main_container {
|
|
|
width: 100%;
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
-}
|
|
|
-</style>
|
|
|
+ }
|
|
|
+</style>
|