维修问题修改

This commit is contained in:
zzyuan 2025-01-23 18:04:04 +08:00
parent b9d449afcb
commit 771b62856d
2 changed files with 26 additions and 26 deletions

View File

@ -29,7 +29,7 @@
</uni-col> </uni-col>
<uni-col :span="6"> <uni-col :span="6">
<view class="btnBox return" @click="changeTab(2)"> <view class="btnBox return" @click="changeTab(2)">
维修 维修
</view> </view>
</uni-col> </uni-col>
<uni-col :span="6"> <uni-col :span="6">
@ -89,7 +89,7 @@
<div style="width: 100%; display: flex"> <div style="width: 100%; display: flex">
<uni-data-select <uni-data-select
:localdata="isChargeList" :localdata="isChargeList"
v-model="item.isCharge" v-model="item.partType"
placeholder="请选择是否收费" placeholder="请选择是否收费"
/> />
<div class="operation-btns"> <div class="operation-btns">
@ -124,7 +124,7 @@
<uni-forms-item label="是否收费"> <uni-forms-item label="是否收费">
<uni-data-select <uni-data-select
:localdata="isChargeList" :localdata="isChargeList"
v-model="item.isCharge" v-model="item.partType"
placeholder="请选择是否收费" placeholder="请选择是否收费"
/> />
</uni-forms-item> </uni-forms-item>
@ -215,7 +215,7 @@ const damageReasonList = ref([
]) ])
const isChargeList = ref([ const isChargeList = ref([
{ value: 1, text: '是' }, { value: 1, text: '是' },
{ value: 2, text: '否' }, { value: 0, text: '否' },
]) ])
// //
@ -312,9 +312,9 @@ const partTreeChange = (val,index) =>{
// //
const partItems = ref([{ partType: '', partNum: '', isCharge: '', partId: '', storageNum: ''}]) const partItems = ref([{ partNum: '', partType: 0, partId: '', storageNum: ''}])
const addPart = () => { const addPart = () => {
partItems.value.push({ partType: '', partNum: '', isCharge: '', partId: '' ,storageNum: ''}) partItems.value.push({ partNum: '', partType: 0, partId: '' ,storageNum: ''})
} }
const delPart = (index) => { const delPart = (index) => {
if (partItems.value.length > 1) { if (partItems.value.length > 1) {
@ -341,7 +341,7 @@ const getSupplierListData = async () => {
} }
getSupplierListData() getSupplierListData()
const partItemsMiddle = ref([ const partItemsMiddle = ref([
{ partName: '', supplierId: '', partNum: '', partPrice: '0', isCharge: '' }, { partName: '', supplierId: '', partNum: '', partPrice: '0', partType: 0 },
]) ])
const addMidPart = () => { const addMidPart = () => {
partItemsMiddle.value.push({ partItemsMiddle.value.push({
@ -349,7 +349,7 @@ const addMidPart = () => {
supplierId: '', supplierId: '',
partNum: '', partNum: '',
partPrice: '0', partPrice: '0',
isCharge: '', partType: 0,
}) })
} }
const delMidPart = (index) => { const delMidPart = (index) => {
@ -439,10 +439,10 @@ const costCheckNum = (item) => {
const saveCode = async () => { const saveCode = async () => {
if(repairPerson.value==""){ if(repairPerson.value==""){
uni.showToast({ title: '请先选择维修人员!', icon: 'none' }) uni.showToast({ title: '请先选择维修人员!', icon: 'none' })
}else{ }else{
rowData.value = queryParams.value; rowData.value = queryParams.value;
// //
rowData.value.repairDeviceList[rowIndex].repairList=[ rowData.value.repairDeviceList[rowIndex.value].repairList=[
{ {
repairer:repairPerson.value, repairer:repairPerson.value,
remark:remark.value, remark:remark.value,
@ -451,8 +451,8 @@ const saveCode = async () => {
] ]
if (repairType.value == 1) { if (repairType.value == 1) {
for (let i = 0; i < partItems.value.length; i++) { for (let i = 0; i < partItems.value.length; i++) {
rowData.value.repairDeviceList[rowIndex].codeInRepairPartList.push({ rowData.value.repairDeviceList[rowIndex.value].codeInRepairPartList.push({
isCharge: partItems.value[i].isCharge, partType: partItems.value[i].partType,
partId: partItems.value[i].partId, partId: partItems.value[i].partId,
partNum: partItems.value[i].partNum, partNum: partItems.value[i].partNum,
storageNum: partItems.value[i].storageNum, storageNum: partItems.value[i].storageNum,
@ -461,8 +461,8 @@ const saveCode = async () => {
} }
} else if (repairType.value == 2) { } else if (repairType.value == 2) {
for (let i = 0; i < partItemsMiddle.value.length; i++) { for (let i = 0; i < partItemsMiddle.value.length; i++) {
rowData.value.repairDeviceList[rowIndex].codeOutRepairPartList.push({ rowData.value.repairDeviceList[rowIndex.value].codeOutRepairPartList.push({
isCharge: partItemsMiddle.value[i].isCharge, partType: partItemsMiddle.value[i].partType,
partPrice: partItemsMiddle.value[i].partPrice, partPrice: partItemsMiddle.value[i].partPrice,
partNum: partItemsMiddle.value[i].partNum, partNum: partItemsMiddle.value[i].partNum,
partName: partItemsMiddle.value[i].partName, partName: partItemsMiddle.value[i].partName,
@ -471,9 +471,9 @@ const saveCode = async () => {
}) })
} }
} else if (repairType.value == 3) { } else if (repairType.value == 3) {
rowData.value.repairDeviceList[rowIndex].codeScrapRepairPartList.push(formRight.value) rowData.value.repairDeviceList[rowIndex.value].codeScrapRepairPartList.push(formRight.value)
} }
rowData.value.repairDeviceList[rowIndex].repairType = repairType.value rowData.value.repairDeviceList[rowIndex.value].repairType = repairType.value;
saveRepairRow(rowData.value.repairDeviceList).then(async (response) => { saveRepairRow(rowData.value.repairDeviceList).then(async (response) => {
if (response.code == 200) { if (response.code == 200) {
uni.showToast({ title: '保存成功', icon: 'none' }) uni.showToast({ title: '保存成功', icon: 'none' })
@ -648,7 +648,7 @@ const saveCode = async () => {
box-shadow: 0 6rpx 20rpx rgba(46, 204, 113, 0.2); box-shadow: 0 6rpx 20rpx rgba(46, 204, 113, 0.2);
} }
// //
&.return { &.return {
background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%); background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
box-shadow: 0 6rpx 20rpx rgba(243, 156, 18, 0.2); box-shadow: 0 6rpx 20rpx rgba(243, 156, 18, 0.2);

View File

@ -83,7 +83,7 @@
<div style="width: 100%; display: flex"> <div style="width: 100%; display: flex">
<uni-data-select <uni-data-select
:localdata="isChargeList" :localdata="isChargeList"
v-model="item.isCharge" v-model="item.partType"
placeholder="请选择是否收费" placeholder="请选择是否收费"
/> />
<div class="operation-btns"> <div class="operation-btns">
@ -123,7 +123,7 @@
<uni-forms-item label="是否收费"> <uni-forms-item label="是否收费">
<uni-data-select <uni-data-select
:localdata="isChargeList" :localdata="isChargeList"
v-model="item.isCharge" v-model="item.partType"
placeholder="请选择是否收费" placeholder="请选择是否收费"
/> />
</uni-forms-item> </uni-forms-item>
@ -217,7 +217,7 @@ const damageReasonList = ref([
const isChargeList = ref([ const isChargeList = ref([
{ value: 1, text: '是' }, { value: 1, text: '是' },
{ value: 2, text: '否' }, { value: 0, text: '否' },
]) ])
// //
@ -334,9 +334,9 @@ getSupplierListData()
const formLeft = ref({ const formLeft = ref({
repairNum: 0, repairNum: 0,
}) })
const partItems = ref([{ partType: '', partNum: '', isCharge: 2, partId: '', storageNum: ''}]) const partItems = ref([{ partNum: '', partType: 0, partId: '', storageNum: ''}])
const addPart = () => { const addPart = () => {
partItems.value.push({ partType: '', partNum: '', isCharge: 2, partId: '', storageNum: '' }) partItems.value.push({ partNum: '', partType: 0, partId: '', storageNum: '' })
} }
const delPart = (index) => { const delPart = (index) => {
if (partItems.value.length > 1) { if (partItems.value.length > 1) {
@ -351,9 +351,9 @@ const formMiddle = ref({
supplierId: undefined, supplierId: undefined,
repairNum: 0, repairNum: 0,
}) })
const partItemsMiddle = ref([{ partName: '', partNum: '', partPrice: '0', isCharge: 2 }]) const partItemsMiddle = ref([{ partName: '', partNum: '', partPrice: '0', partType: 0 }])
const addMidPart = () => { const addMidPart = () => {
partItemsMiddle.value.push({ partName: '', partNum: '', partPrice: '0', isCharge: 2 }) partItemsMiddle.value.push({ partName: '', partNum: '', partPrice: '0', partType: 0 })
} }
const delMidPart = (index) => { const delMidPart = (index) => {
if (partItemsMiddle.value.length > 1) { if (partItemsMiddle.value.length > 1) {
@ -442,7 +442,7 @@ const saveNumAll = async () => {
// //
for (let i = 0; i < partItems.value.length; i++) { for (let i = 0; i < partItems.value.length; i++) {
rowData.value.repairDeviceList[0].numberInRepairPartList.push({ rowData.value.repairDeviceList[0].numberInRepairPartList.push({
isCharge: partItems.value[i].isCharge, partType: partItems.value[i].partType,
partId: partItems.value[i].partId, partId: partItems.value[i].partId,
partNum: partItems.value[i].partNum, partNum: partItems.value[i].partNum,
storageNum: partItems.value[i].storageNum, storageNum: partItems.value[i].storageNum,
@ -452,7 +452,7 @@ const saveNumAll = async () => {
// //
for (let i = 0; i < partItemsMiddle.value.length; i++) { for (let i = 0; i < partItemsMiddle.value.length; i++) {
rowData.value.repairDeviceList[0].numberOutRepairPartList.push({ rowData.value.repairDeviceList[0].numberOutRepairPartList.push({
isCharge: partItemsMiddle.value[i].isCharge, partType: partItemsMiddle.value[i].partType,
partPrice: partItemsMiddle.value[i].partPrice, partPrice: partItemsMiddle.value[i].partPrice,
partNum: partItemsMiddle.value[i].partNum, partNum: partItemsMiddle.value[i].partNum,
partName: partItemsMiddle.value[i].partName, partName: partItemsMiddle.value[i].partName,