|
@@ -15,7 +15,7 @@
|
|
|
</template>
|
|
|
<template #add>
|
|
|
<div>
|
|
|
- <Button @click="add" style="margin-left:20px">添加人工</Button>
|
|
|
+ <!-- <Button @click="add" style="margin-left:20px">添加人工</Button> -->
|
|
|
<Button @click="updataRepairInfo" style="margin-left:20px">重置</Button>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -25,10 +25,16 @@
|
|
|
<template #delList="{ field }">
|
|
|
<Button @click="del(field)">删除</Button>
|
|
|
</template>
|
|
|
+ <template #discount="{ model, field }">
|
|
|
+ <Checkbox v-model:checked="model[field]">
|
|
|
+ 折扣
|
|
|
+ </Checkbox>
|
|
|
+ </template>
|
|
|
</BasicForm>
|
|
|
<div class="priceCount">
|
|
|
<span>合计:</span>
|
|
|
<div class="label">总价:{{ fileFlow.priceCount || 0 }}元 <Button :preIcon="'outline-refresh'" @click="updataCount"><RedoOutlined /></Button></div>
|
|
|
+ <p>注:提交报价后,需等待报修人确认后再进行维修</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
</BasicModal>
|
|
@@ -39,12 +45,13 @@
|
|
|
import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
import { getPriceList, checkRegisterInfo, addOrUpdatePriceList, allList } from '/@/api/spares'
|
|
|
+ import { Checkbox } from 'ant-design-vue';
|
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
import { uploadApi } from '/@/api/product/index';
|
|
|
import { RedoOutlined, } from '@ant-design/icons-vue';
|
|
|
const { t } = useI18n();
|
|
|
export default defineComponent({
|
|
|
- components: { BasicModal, BasicForm, RedoOutlined },
|
|
|
+ components: { BasicModal, BasicForm, RedoOutlined, Checkbox },
|
|
|
props: {
|
|
|
userData: { type: Object },
|
|
|
},
|
|
@@ -57,7 +64,8 @@
|
|
|
count:1,//第一次报价
|
|
|
priceCount:0,//总价
|
|
|
priceLists:[],
|
|
|
- priceListsPrice:{}
|
|
|
+ priceListsPrice:{},
|
|
|
+ manMadeList:[],
|
|
|
})
|
|
|
const loading = ref(false)
|
|
|
const { createMessage,createConfirm } = useMessage();
|
|
@@ -85,6 +93,11 @@
|
|
|
span: 18,
|
|
|
},
|
|
|
},{
|
|
|
+ field: 'warrantyExpirationDateText',
|
|
|
+ component: 'Input',
|
|
|
+ slot: 'text',
|
|
|
+ label: '保修届满日期',
|
|
|
+ },{
|
|
|
field: 'checkResult',
|
|
|
component: 'Input',
|
|
|
label: '检测结果',
|
|
@@ -101,6 +114,18 @@
|
|
|
span: 24,
|
|
|
},
|
|
|
slot: 'add',
|
|
|
+ },{
|
|
|
+ field: 'manMade',
|
|
|
+ component: 'CheckboxGroup',
|
|
|
+ label: '人工费',
|
|
|
+ labelWidth:0,
|
|
|
+ componentProps: {
|
|
|
+ options: fileFlow.manMadeList,
|
|
|
+ maxLength: 50,
|
|
|
+ },
|
|
|
+ colProps: {
|
|
|
+ span: 24,
|
|
|
+ },
|
|
|
},
|
|
|
];
|
|
|
|
|
@@ -118,6 +143,11 @@
|
|
|
console.log('allList',allListOption)
|
|
|
fileFlow.priceListsPrice
|
|
|
allListOption.map(ele => {
|
|
|
+ fileFlow.manMadeList.push({
|
|
|
+ ...ele,
|
|
|
+ label: `${ele.name} ${ele.price}元`,
|
|
|
+ value: ele.laborCostId,
|
|
|
+ })
|
|
|
fileFlow.priceListsPrice[ele.laborCostId] = ele.price
|
|
|
})
|
|
|
});
|
|
@@ -143,6 +173,7 @@
|
|
|
fileFlow.type = data.type
|
|
|
setFieldsValue({
|
|
|
...data,
|
|
|
+ warrantyExpirationDateText: `${data.warrantyDate} (${data.warrantyType==0?'保内保修':data.warrantyType==1?'保内转保外':'保外维修'})`,
|
|
|
deviceInfo:t(`routes.scene.tableType.${data.cameraType}`)+data.cameraSnCode
|
|
|
});
|
|
|
}
|
|
@@ -160,19 +191,39 @@
|
|
|
function addPriceItem(list){
|
|
|
fileFlow.priceLists = list.reverse()
|
|
|
let priceSchema = [],valueObj = {},count=0
|
|
|
- list.map(ele => {
|
|
|
+ list.map((ele,index) => {
|
|
|
valueObj[`priceList${ele.priceListId}`] = ele.count || 0
|
|
|
valueObj[`priceListText${ele.priceListId}`] = `${ele.name} ${ele.price} 元/次`
|
|
|
count = count + ele.count*ele.price
|
|
|
priceSchema.unshift({
|
|
|
field: 'priceListText' + ele.priceListId,
|
|
|
component: 'InputNumber',
|
|
|
- label: ele.type == 0?'备件':'人工',
|
|
|
+ label: index+1,
|
|
|
+ labelWidth:20,
|
|
|
slot: 'text',
|
|
|
// labelWidth:300,
|
|
|
// subLabel:"数量",
|
|
|
colProps: {
|
|
|
- span: 12,
|
|
|
+ span: 8,
|
|
|
+ }
|
|
|
+ },{
|
|
|
+ field: 'discount' + ele.priceListId,
|
|
|
+ component: 'CheckboxGroup',
|
|
|
+ // label: '',
|
|
|
+ // labelWidth:0,
|
|
|
+ // labelWidth:300,
|
|
|
+ // subLabel:"数量",
|
|
|
+ slot: 'discount',
|
|
|
+ componentProps: {
|
|
|
+ options: [
|
|
|
+ {
|
|
|
+ label: `折扣价${ele.priceListId}`,
|
|
|
+ value: 0,
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ colProps: {
|
|
|
+ span: 4,
|
|
|
}
|
|
|
},{
|
|
|
field: 'priceList' + ele.priceListId,
|
|
@@ -180,6 +231,7 @@
|
|
|
// suffix:'数量',
|
|
|
component: 'InputNumber',
|
|
|
defaultValue:ele.count || 0,
|
|
|
+ labelWidth:50,
|
|
|
// labelWidth:300,
|
|
|
// subLabel:"数量",
|
|
|
colProps: {
|
|
@@ -266,14 +318,16 @@
|
|
|
onOk: async () => {
|
|
|
loading.value = true
|
|
|
let priceListsparams = []
|
|
|
- console.log('addOrUpdatePriceList',params,fileFlow.priceLists)
|
|
|
+ console.log('params',params)
|
|
|
fileFlow.priceLists.map(ele => {
|
|
|
+ let discount = params[`discount${ele.priceListId}`]?'1':'0';
|
|
|
priceListsparams.push({
|
|
|
priceListId:ele.priceListId,
|
|
|
type:ele.type,
|
|
|
laborId:ele.laborId,
|
|
|
partId:ele.partId,
|
|
|
- count:params[`priceList${ele.priceListId}`]
|
|
|
+ discount,
|
|
|
+ count:params[`priceList${ele.priceListId}`],
|
|
|
})
|
|
|
})
|
|
|
for (let index = 1; index < n.value; index++) {
|
|
@@ -287,16 +341,17 @@
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
- let res = await addOrUpdatePriceList({
|
|
|
- repairId:params.repairId,
|
|
|
- priceLists:priceListsparams,
|
|
|
- })
|
|
|
- console.log('res',res)
|
|
|
- createMessage.success(t('common.optSuccess'));
|
|
|
- closeModal();
|
|
|
- emit('update');
|
|
|
+ console.log('addOrUpdatePriceList',params,priceListsparams)
|
|
|
+ // let res = await addOrUpdatePriceList({
|
|
|
+ // repairId:params.repairId,
|
|
|
+ // priceLists:priceListsparams,
|
|
|
+ // })
|
|
|
+ // console.log('res',res)
|
|
|
+ // createMessage.success(t('common.optSuccess'));
|
|
|
+ // closeModal();
|
|
|
+ // emit('update');
|
|
|
loading.value = false
|
|
|
- clearInfo()
|
|
|
+ // clearInfo()
|
|
|
},
|
|
|
onCancel: () => {
|
|
|
loading.value = false
|