|
|
@@ -39,10 +39,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
- <el-form-item
|
|
|
- label="回收人:"
|
|
|
- prop="recycleName"
|
|
|
- >
|
|
|
+ <el-form-item label="回收人:" prop="recycleName">
|
|
|
<!-- <el-select style="width: 100%;" v-model="form.recycleId" disabled placeholder="请选择">
|
|
|
<el-option
|
|
|
v-for="item in loginChangeRoleVOList"
|
|
|
@@ -50,7 +47,7 @@
|
|
|
:label="item.roleName"
|
|
|
:value="item.roleId"
|
|
|
></el-option>
|
|
|
- </el-select> -->
|
|
|
+ </el-select>-->
|
|
|
<el-input v-model="form.recycleName" disabled />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -161,7 +158,7 @@
|
|
|
</el-form>
|
|
|
<template v-slot:footer>
|
|
|
<el-button @click="handleClose">取消</el-button>
|
|
|
- <el-button type="primary" v-if="type == 'add'" @click="save" :loading="loading">确认</el-button>
|
|
|
+ <el-button type="primary" v-if="type != 'view'" @click="save" :loading="loading">确认</el-button>
|
|
|
</template>
|
|
|
<workOrderList ref="workOrderListRef" @changeSelect="changeSelect" />
|
|
|
</ele-modal>
|
|
|
@@ -170,10 +167,10 @@
|
|
|
<script>
|
|
|
import spareInfo from '@/views/salesServiceManagement/accessory/components/spareInfo.vue';
|
|
|
import workOrderList from '@/views/salesServiceManagement/accessory/components/workOrderList.vue';
|
|
|
-import { getCurrentUser } from '@/utils/token-util';
|
|
|
-
|
|
|
+// import spareParts from '@/views/salesServiceManagement/components/sparePartsList.vue';
|
|
|
import {
|
|
|
recycleSave,
|
|
|
+ recycleUpdate,
|
|
|
getSalesWorkOrderById,
|
|
|
recycleDetails
|
|
|
} from '@/api/salesServiceManagement/index';
|
|
|
@@ -193,20 +190,27 @@ export default {
|
|
|
editRepairNotesDialog: false,
|
|
|
type: 'add',
|
|
|
form: {
|
|
|
- recycleName:'',
|
|
|
+ recycleName: ''
|
|
|
},
|
|
|
loginChangeRoleVOList: [],
|
|
|
deviceList: [],
|
|
|
detailList: []
|
|
|
};
|
|
|
},
|
|
|
- watch: {},
|
|
|
+ watch: {
|
|
|
+ detailList: {
|
|
|
+ handler(newVal) {
|
|
|
+ this.tableList = newVal;
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
init(row, type) {
|
|
|
this.editRepairNotesDialog = true;
|
|
|
this.type = type;
|
|
|
- this.title = type == 'add' ? '新增' : '详情';
|
|
|
- let currentUser = getCurrentUser()
|
|
|
+ this.title = type == 'add' ? '新增' : type == 'edit' ? '编辑' : '详情';
|
|
|
+ let currentUser = JSON.parse(sessionStorage['currentUser']);
|
|
|
this.form.recycleDeptId = currentUser.currentGroupId; // 部门id
|
|
|
this.roleVOListData();
|
|
|
if (row?.id) {
|
|
|
@@ -217,7 +221,8 @@ export default {
|
|
|
this.echoData();
|
|
|
}
|
|
|
},
|
|
|
- async getDetail(row) {
|
|
|
+ async getDetail(data) {
|
|
|
+ const row = JSON.parse(JSON.stringify(data));
|
|
|
const res = await recycleDetails(row.id);
|
|
|
this.detailList = res.detailList;
|
|
|
this.form.code = res.code;
|
|
|
@@ -228,6 +233,7 @@ export default {
|
|
|
this.$set(this.form, 'reason', res.reason);
|
|
|
this.$set(this.form, 'contactName', res.contactName);
|
|
|
this.$set(this.form, 'contactCode', res.contactCode);
|
|
|
+ this.form.id = row.id;
|
|
|
this.changeSelect(
|
|
|
{
|
|
|
id: res.repairId,
|
|
|
@@ -240,13 +246,11 @@ export default {
|
|
|
// this.echoData();
|
|
|
this.$set(this.form, 'recycleId', res.recycleId);
|
|
|
this.$set(this.form, 'recycleName', res.recycleName);
|
|
|
- console.log(res, 'res 55');
|
|
|
- console.log(this.loginChangeRoleVOList, 'loginChangeRoleVOList --');
|
|
|
},
|
|
|
handleClose() {
|
|
|
this.editRepairNotesDialog = false;
|
|
|
this.form = {
|
|
|
- recycleName:''
|
|
|
+ recycleName: ''
|
|
|
};
|
|
|
this.$refs.recyleFormRef.resetFields();
|
|
|
this.deviceList = [];
|
|
|
@@ -266,7 +270,11 @@ export default {
|
|
|
...this.form,
|
|
|
detailList
|
|
|
};
|
|
|
- const res = await recycleSave(data);
|
|
|
+ if (data.code) {
|
|
|
+ delete data.code;
|
|
|
+ }
|
|
|
+ const requestName = this.type == 'add' ? recycleSave : recycleUpdate;
|
|
|
+ const res = await requestName(data);
|
|
|
if (res) {
|
|
|
this.$message.success('操作成功');
|
|
|
this.handleClose();
|
|
|
@@ -285,11 +293,12 @@ export default {
|
|
|
},
|
|
|
addData(item, arr) {
|
|
|
let totalCount = item.totalCount ? item.totalCount - 0 : '';
|
|
|
- if (!totalCount) {
|
|
|
+ if (!totalCount || totalCount == 1) {
|
|
|
arr.push(item);
|
|
|
return;
|
|
|
}
|
|
|
for (let i = 0; i < totalCount; i++) {
|
|
|
+ item.totalPrice = item.singlePrice || 0;
|
|
|
item.totalCount = 1;
|
|
|
arr.push(item);
|
|
|
}
|
|
|
@@ -302,7 +311,6 @@ export default {
|
|
|
},
|
|
|
// 确认选择工单
|
|
|
async changeSelect(row, type) {
|
|
|
- console.log(row, 'row ==========');
|
|
|
this.$set(this.form, 'orderWorkName', row.name);
|
|
|
this.$set(this.form, 'orderWorkCode', row.code);
|
|
|
this.form.repairId = row.id; // 工单id
|