配件申请单子项可以搜索、可以设置给不给保险公司看
This commit is contained in:
parent
12916957f6
commit
c36226d14c
@ -63,3 +63,20 @@ export function passBackTicketWares(data){
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 修改是否传给保险公司
|
||||||
|
export function updateSafe(data){
|
||||||
|
return request({
|
||||||
|
url: preUrl + "/updateSafe",
|
||||||
|
method: "post",
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查单个配件申请单的信息
|
||||||
|
export function getById(id){
|
||||||
|
return request({
|
||||||
|
url: preUrl + "/getById?id=" + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -46,11 +46,21 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<!-- 分页组件 -->
|
<!-- 分页组件 -->
|
||||||
<pagination style="margin-bottom: 2rem" v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
<pagination style="margin-bottom: 2rem" v-show="total > 0" :total="total" :page.sync="queryParams.pageNo"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<el-dialog title="单据处理" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
|
<el-dialog title="单据处理" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
|
||||||
|
<el-form :inline="true">
|
||||||
|
<el-form-item label="名称" prop="query">
|
||||||
|
<el-input v-model="query"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" @click="searchByQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" @click=resetByQuery>重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
<el-table
|
<el-table
|
||||||
@cell-mouse-enter="handleCellEnter"
|
@cell-mouse-enter="handleCellEnter"
|
||||||
@cell-mouse-leave="handleCellLeave"
|
@cell-mouse-leave="handleCellLeave"
|
||||||
@ -139,7 +149,8 @@
|
|||||||
<el-table-column label="单位" align="center" width="150" prop="unit">
|
<el-table-column label="单位" align="center" width="150" prop="unit">
|
||||||
<div class="item" slot-scope="scope">
|
<div class="item" slot-scope="scope">
|
||||||
<el-select class="item__input" v-model="scope.row.unit" @blur="save(scope.row)">
|
<el-select class="item__input" v-model="scope.row.unit" @blur="save(scope.row)">
|
||||||
<el-option v-for="dict in getDictDatasToType(DICT_TYPE.REPAIR_UNIT)" :key="dict.value" :label="dict.label" :value="dict.value" />
|
<el-option v-for="dict in getDictDatasToType(DICT_TYPE.REPAIR_UNIT)" :key="dict.value" :label="dict.label"
|
||||||
|
:value="dict.value"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<span class="item__txt">
|
<span class="item__txt">
|
||||||
<dict-tag :type="DICT_TYPE.REPAIR_UNIT" v-model="scope.row.unit"/>
|
<dict-tag :type="DICT_TYPE.REPAIR_UNIT" v-model="scope.row.unit"/>
|
||||||
@ -234,12 +245,25 @@ export default {
|
|||||||
editProp: ['warehouse', 'count', 'newPrice', 'remark', 'code', 'waresCount', 'model', 'unit'],
|
editProp: ['warehouse', 'count', 'newPrice', 'remark', 'code', 'waresCount', 'model', 'unit'],
|
||||||
remark: null,
|
remark: null,
|
||||||
tableKey: 0,
|
tableKey: 0,
|
||||||
|
query: null,
|
||||||
|
twId: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
searchByQuery(){
|
||||||
|
const data = {
|
||||||
|
twId: this.twId,
|
||||||
|
query: this.query
|
||||||
|
}
|
||||||
|
this.getTwitemList(data)
|
||||||
|
},
|
||||||
|
resetByQuery() {
|
||||||
|
this.query = null
|
||||||
|
this.searchByQuery()
|
||||||
|
},
|
||||||
getDictDatasToType(type) {
|
getDictDatasToType(type) {
|
||||||
return this.getDictDatas(type)
|
return this.getDictDatas(type)
|
||||||
},
|
},
|
||||||
@ -310,15 +334,27 @@ export default {
|
|||||||
this.resetForm('queryForm')
|
this.resetForm('queryForm')
|
||||||
this.handleQuery()
|
this.handleQuery()
|
||||||
},
|
},
|
||||||
async handleDispose(row) {
|
handleDispose(row) {
|
||||||
this.formData = {}
|
this.formData = {}
|
||||||
this.formData = {
|
this.formData = {
|
||||||
...row
|
...row
|
||||||
}
|
}
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
try {
|
|
||||||
this.dialogLoading = true
|
|
||||||
const data = {twId: row.id}
|
const data = {twId: row.id}
|
||||||
|
this.twId = row.id
|
||||||
|
this.getTwitemList(data)
|
||||||
|
// const res = await listTwItem(data)
|
||||||
|
// this.items = res.data
|
||||||
|
// this.items = this.items.filter(item => item.waresStatus === '1')
|
||||||
|
// this.items.forEach(item => {
|
||||||
|
// const count = item.waresAlreadyCount ? parseInt(item.waresCount) - parseInt(item.waresAlreadyCount) : item.waresCount
|
||||||
|
// item.waresCount = this.type ? count : item.waresAlreadyCount
|
||||||
|
// item.isStock = this.type ? count <= item.wares.stock : true
|
||||||
|
// })
|
||||||
|
// this.items = this.items.filter(item => this.type ? item.waresCount > 0 : item.waresAlreadyCount > 0)
|
||||||
|
},
|
||||||
|
async getTwitemList(data) {
|
||||||
|
try {
|
||||||
const res = await listTwItem(data)
|
const res = await listTwItem(data)
|
||||||
this.items = res.data
|
this.items = res.data
|
||||||
this.items = this.items.filter(item => item.waresStatus === '1')
|
this.items = this.items.filter(item => item.waresStatus === '1')
|
||||||
@ -328,8 +364,7 @@ export default {
|
|||||||
item.isStock = this.type ? count <= item.wares.stock : true
|
item.isStock = this.type ? count <= item.wares.stock : true
|
||||||
})
|
})
|
||||||
this.items = this.items.filter(item => this.type ? item.waresCount > 0 : item.waresAlreadyCount > 0)
|
this.items = this.items.filter(item => this.type ? item.waresCount > 0 : item.waresAlreadyCount > 0)
|
||||||
} finally {
|
} catch {
|
||||||
this.dialogLoading = false
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getRowClass(row) {
|
getRowClass(row) {
|
||||||
|
@ -95,6 +95,9 @@
|
|||||||
<el-button size="small" type="primary" @click="handleAddWares">
|
<el-button size="small" type="primary" @click="handleAddWares">
|
||||||
添加配件
|
添加配件
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button size="small" type="primary" @click="handleSetting">
|
||||||
|
设置可见
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 卡片内容 -->
|
<!-- 卡片内容 -->
|
||||||
@ -166,12 +169,56 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<TWIAdd ref="twiAdd" @success="handleSuccess" />
|
<TWIAdd ref="twiAdd" @success="handleSuccess" />
|
||||||
|
|
||||||
|
<el-dialog title="设置" width="40%" :visible.sync="settingDialog" v-dialogDrag append-to-body>
|
||||||
|
<el-form v-model="settingForm" :inline="true" label-width="20rem">
|
||||||
|
<el-row :gutter="1">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="是否传给保险公司" prop="toSafe">
|
||||||
|
<el-switch
|
||||||
|
v-model="settingForm.toSafe"
|
||||||
|
active-text="是"
|
||||||
|
active-value="1"
|
||||||
|
inactive-text="否"
|
||||||
|
inactive-value="0"
|
||||||
|
>
|
||||||
|
</el-switch>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="1">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="保险公司名称" prop="safeName">
|
||||||
|
<el-input :disabled="settingForm.toSafe !== '1'" v-model="settingForm.safeName" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="1">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="联系人" prop="safeContact">
|
||||||
|
<el-input :disabled="settingForm.toSafe !== '1'" v-model="settingForm.safeContact" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="1">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="联系电话" prop="safeMobile">
|
||||||
|
<el-input :disabled="settingForm.toSafe !== '1'" v-model="settingForm.safeMobile" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="doSetting">确认</el-button>
|
||||||
|
<el-button @click="settingDialog = false" >取消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {getTicketsById} from "@/api/repair/tickets/Tickets";
|
import {getTicketsById} from "@/api/repair/tickets/Tickets";
|
||||||
import {auditTicketWares} from "@/api/repair/tickets/TicketWares";
|
import {auditTicketWares, updateSafe, getById} from "@/api/repair/tickets/TicketWares";
|
||||||
import {listTwItem, updateIsShow} from "@/api/repair/tickets/TWItem";
|
import {listTwItem, updateIsShow} from "@/api/repair/tickets/TWItem";
|
||||||
import DiscountInput from "@/views/repair/tickets/Components/DiscountInput.vue";
|
import DiscountInput from "@/views/repair/tickets/Components/DiscountInput.vue";
|
||||||
import item from "@/layout/components/Sidebar/Item.vue";
|
import item from "@/layout/components/Sidebar/Item.vue";
|
||||||
@ -203,10 +250,37 @@ export default {
|
|||||||
editProp: ['wares.price'],
|
editProp: ['wares.price'],
|
||||||
dialogLoading: null,
|
dialogLoading: null,
|
||||||
selectRow:[],
|
selectRow:[],
|
||||||
imageUrls: []
|
imageUrls: [],
|
||||||
|
settingDialog: false,
|
||||||
|
settingForm: {
|
||||||
|
safeName: null,
|
||||||
|
safeContact: null,
|
||||||
|
safeMobile: null,
|
||||||
|
toSafe: null,
|
||||||
|
id: null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async doSetting(){
|
||||||
|
try {
|
||||||
|
await updateSafe(this.settingForm)
|
||||||
|
this.settingDialog = false
|
||||||
|
this.$modal.msgSuccess("设置成功")
|
||||||
|
await this.open(this.formData)
|
||||||
|
}catch{}
|
||||||
|
},
|
||||||
|
async handleSetting(){
|
||||||
|
try {
|
||||||
|
const res = await getById(this.formData.id)
|
||||||
|
this.settingForm.id = this.formData.id
|
||||||
|
this.settingForm.toSafe = res.data.toSafe
|
||||||
|
this.settingForm.safeName = res.data.safeName
|
||||||
|
this.settingForm.safeContact = res.data.safeContact
|
||||||
|
this.settingForm.safeMobile = res.data.safeMobile
|
||||||
|
this.settingDialog = true
|
||||||
|
}catch{}
|
||||||
|
},
|
||||||
handleSuccess(){
|
handleSuccess(){
|
||||||
this.open(this.formData)
|
this.open(this.formData)
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user