Merge branch 'dev' of http://122.51.230.86:3000/dianliang/lanan-system-vue into dev
This commit is contained in:
commit
0a0cc6cd18
@ -28,6 +28,7 @@ VUE_APP_BAIDU_CODE = fadc1bd5db1a1d6f581df60a1807f8ab
|
||||
|
||||
# 大屏设计器服务
|
||||
VUE_APP_BIG_SCREEN_SERVER = 'http://127.0.0.1:3000'
|
||||
VUE_APP_IMAGE_URL = 'http://122.51.230.86:9000/'
|
||||
|
||||
#小程序推广码前缀
|
||||
VUE_APP_REPAIR_PREX = 'https://www.lighting-it.cn/share?inviteId='
|
||||
|
@ -419,6 +419,12 @@ export default {
|
||||
// 提交
|
||||
async handleSubmit() {
|
||||
try {
|
||||
const isNull = this.validateNull();
|
||||
if (!isNull) return;
|
||||
const names = this.validateZero()
|
||||
if (names){
|
||||
await this.$modal.confirm("确认配件:" + names + "的采购价格为0吗?")
|
||||
}
|
||||
await this.createInit()
|
||||
await createRepairSo(this.formData)
|
||||
this.inStockDialog = false
|
||||
@ -457,6 +463,35 @@ export default {
|
||||
}
|
||||
})]
|
||||
},
|
||||
validateNull(){
|
||||
const flag = this.partList.map(item => {
|
||||
const price = item.newPrice
|
||||
if (price === null || price === ""){
|
||||
this.$modal.msgError("配件:" + item.name + "采购价格为空")
|
||||
return false
|
||||
}else {
|
||||
return true
|
||||
}
|
||||
})
|
||||
let count = 0
|
||||
flag.forEach(item => {
|
||||
if (!item){
|
||||
count++
|
||||
}
|
||||
})
|
||||
return count === 0
|
||||
},
|
||||
validateZero(){
|
||||
const flag = this.partList.map(item => {
|
||||
const price = parseFloat(item.newPrice)
|
||||
if (price === 0){
|
||||
return item.name
|
||||
}else {
|
||||
return ""
|
||||
}
|
||||
})
|
||||
return flag.filter(item => item !== "").join(",")
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -123,13 +123,16 @@
|
||||
</div>
|
||||
<!-- 卡片内容 -->
|
||||
<div>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
|
||||
label-width="90px">
|
||||
<el-form-item label="关键字" prop="query">
|
||||
<el-input style="width: 20rem" type="text" placeholder="工单号、车牌号、联系电话" v-model="queryParams.query"/>
|
||||
<el-input style="width: 20rem" type="text" placeholder="工单号、车牌号、联系电话"
|
||||
v-model="queryParams.query"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="waresStatus">
|
||||
<el-select v-model="queryParams.waresStatus">
|
||||
<el-option v-for="item in this.getDictDatas(DICT_TYPE.TW_ITEM_STATUS)" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-option v-for="item in this.getDictDatas(DICT_TYPE.TW_ITEM_STATUS)" :key="item.value"
|
||||
:label="item.label" :value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@ -167,7 +170,17 @@
|
||||
<el-table-column label="名称" align="center" prop="waresName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="规格" align="center" prop="wares.model" width="180"/>
|
||||
<el-table-column label="数量" align="center" prop="waresCount" width="180"/>
|
||||
<el-table-column v-if="userRole === 'service_advisor' && type" label="折扣" align="center" prop="itemDiscount" width="180">
|
||||
<el-table-column v-if="userRole === 'service_advisor' && type" label="销售价格" align="center" prop="wares.price" width="180">
|
||||
<div v-if="formData.status === '01'" class="item" slot-scope="scope">
|
||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.wares.price"/>
|
||||
<span class="item__txt">{{ scope.row.wares.price }}</span>
|
||||
</div>
|
||||
<div v-else slot-scope="scope">
|
||||
<span>{{ scope.row.wares.price }}</span>
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="userRole === 'service_advisor' && type" label="折扣" align="center"
|
||||
prop="itemDiscount" width="180">
|
||||
<!-- <div v-if="formData.status === '01'" class="item" slot-scope="scope">-->
|
||||
<!--<!– <el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.itemDiscount"/>–>-->
|
||||
<!-- <DiscountInput @input-blur="save(scope.row)" class="item__input" v-model="scope.row.itemDiscount" />-->
|
||||
@ -186,7 +199,8 @@
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
<div slot="footer" class="dialog-footer" v-if="info.status === '01' && (userRole === 'service_advisor' || userRole === 'general_inspection')">
|
||||
<div slot="footer" class="dialog-footer"
|
||||
v-if="info.status === '01' && (userRole === 'service_advisor' || userRole === 'general_inspection')">
|
||||
<el-button type="primary" @click="handleAudit(true)">通 过</el-button>
|
||||
<el-button @click="handleAudit(false)">驳 回</el-button>
|
||||
</div>
|
||||
@ -199,6 +213,7 @@ import {getTicketsById} from "@/api/repair/tickets/Tickets";
|
||||
import {auditTicketWares} from "@/api/repair/tickets/TicketWares";
|
||||
import {listTwItem, updateIsShow} from "@/api/repair/tickets/TWItem";
|
||||
import DiscountInput from "@/views/repair/tickets/Components/DiscountInput.vue";
|
||||
import item from "@/layout/components/Sidebar/Item.vue";
|
||||
|
||||
export default {
|
||||
name: "TicketWaresShow",
|
||||
@ -221,7 +236,7 @@ export default {
|
||||
loading: false,
|
||||
formData: {},
|
||||
clickCellMap: {},
|
||||
editProp: [],
|
||||
editProp: ['wares.price'],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -270,6 +285,12 @@ export default {
|
||||
// 审核
|
||||
async handleAudit(flag) {
|
||||
try {
|
||||
const isNull = this.validateNull();
|
||||
if (!isNull) return;
|
||||
const names = this.validateZero()
|
||||
if (names){
|
||||
await this.$modal.confirm("确认配件:" + names + "的销售价格为0吗?")
|
||||
}
|
||||
this.formData['status'] = flag ? "02" : '05'
|
||||
// 处理配件信息
|
||||
this.formData.wares = [...this.items.map(item => {
|
||||
@ -353,6 +374,35 @@ export default {
|
||||
})
|
||||
this.clickCellMap[id] = []
|
||||
},
|
||||
validateNull(){
|
||||
const flag = this.items.map(item => {
|
||||
const price = item.wares.price
|
||||
if (price === null || price === ""){
|
||||
this.$modal.msgError("配件:" + item.waresName + "销售价格为空")
|
||||
return false
|
||||
}else {
|
||||
return true
|
||||
}
|
||||
})
|
||||
let count = 0
|
||||
flag.forEach(item => {
|
||||
if (!item){
|
||||
count++
|
||||
}
|
||||
})
|
||||
return count === 0
|
||||
},
|
||||
validateZero(){
|
||||
const flag = this.items.map(item => {
|
||||
const price = parseFloat(item.wares.price)
|
||||
if (price === 0){
|
||||
return item.waresName
|
||||
}else {
|
||||
return ""
|
||||
}
|
||||
})
|
||||
return flag.filter(item => item !== "").join(",")
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -361,6 +411,7 @@ export default {
|
||||
.box-card {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.item {
|
||||
.item__input {
|
||||
display: none;
|
||||
|
Loading…
Reference in New Issue
Block a user