|
|
@ -3,14 +3,14 @@ |
|
|
<!-- 查询条件 --> |
|
|
<!-- 查询条件 --> |
|
|
<el-form :inline="true" label-position="top" class="search-form-inline"> |
|
|
<el-form :inline="true" label-position="top" class="search-form-inline"> |
|
|
<div class="search-row"> |
|
|
<div class="search-row"> |
|
|
<el-form-item class="search-item"> |
|
|
|
|
|
|
|
|
<el-form-item v-if="!isSupplierPageMode" class="search-item"> |
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(520)"><a href="#">供应商编码</a></span> |
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(520)"><a href="#">供应商编码</a></span> |
|
|
<el-input v-model="searchData.supplierNo" style="width: 120px" @keyup.enter.native="getMainData"/> |
|
|
<el-input v-model="searchData.supplierNo" style="width: 120px" @keyup.enter.native="getMainData"/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="供应商名称" class="search-item"> |
|
|
|
|
|
|
|
|
<el-form-item v-if="!isSupplierPageMode" label="供应商名称" class="search-item"> |
|
|
<el-input v-model="searchData.supplierName" style="width: 250px" @keyup.enter.native="getMainData"/> |
|
|
<el-input v-model="searchData.supplierName" style="width: 250px" @keyup.enter.native="getMainData"/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item class="search-item"> |
|
|
|
|
|
|
|
|
<el-form-item v-if="!isSupplierPageMode" class="search-item"> |
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(530, 'mainPlanner')"><a href="#">Planner</a></span> |
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(530, 'mainPlanner')"><a href="#">Planner</a></span> |
|
|
<el-input v-model="searchData.planner" clearable style="width: 120px" @keyup.enter.native="getMainData"/> |
|
|
<el-input v-model="searchData.planner" clearable style="width: 120px" @keyup.enter.native="getMainData"/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
@ -40,11 +40,11 @@ |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="search-row"> |
|
|
<div class="search-row"> |
|
|
<el-form-item class="search-item"> |
|
|
|
|
|
|
|
|
<el-form-item v-if="!isSupplierPageMode" class="search-item"> |
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(2016, 'createBy')"><a href="#">申请人员</a></span> |
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(2016, 'createBy')"><a href="#">申请人员</a></span> |
|
|
<el-input v-model="searchData.createBy" clearable style="width: 120px" @keyup.enter.native="getMainData"/> |
|
|
<el-input v-model="searchData.createBy" clearable style="width: 120px" @keyup.enter.native="getMainData"/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item class="search-item"> |
|
|
|
|
|
|
|
|
<el-form-item v-if="!isSupplierPageMode" class="search-item"> |
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(2016, 'qcOperator')"><a href="#">QC人员</a></span> |
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(2016, 'qcOperator')"><a href="#">QC人员</a></span> |
|
|
<el-input v-model="searchData.qcOperator" clearable style="width: 120px" @keyup.enter.native="getMainData"/> |
|
|
<el-input v-model="searchData.qcOperator" clearable style="width: 120px" @keyup.enter.native="getMainData"/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
@ -58,7 +58,7 @@ |
|
|
<el-date-picker v-model="searchData.needInspectDateEnd" type="date" value-format="yyyy-MM-dd" placeholder="结束" style="width: 150px"/> |
|
|
<el-date-picker v-model="searchData.needInspectDateEnd" type="date" value-format="yyyy-MM-dd" placeholder="结束" style="width: 150px"/> |
|
|
</div> |
|
|
</div> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="计划验货日期" class="search-item"> |
|
|
|
|
|
|
|
|
<el-form-item v-if="!isSupplierPageMode" label="计划验货日期" class="search-item"> |
|
|
<div class="date-range"> |
|
|
<div class="date-range"> |
|
|
<el-date-picker v-model="searchData.planStartDate" type="date" value-format="yyyy-MM-dd" placeholder="开始" style="width: 150px"/> |
|
|
<el-date-picker v-model="searchData.planStartDate" type="date" value-format="yyyy-MM-dd" placeholder="开始" style="width: 150px"/> |
|
|
<span class="split">-</span> |
|
|
<span class="split">-</span> |
|
|
@ -230,7 +230,7 @@ |
|
|
|
|
|
|
|
|
<el-row :gutter="10"> |
|
|
<el-row :gutter="10"> |
|
|
<el-col :span="6"> |
|
|
<el-col :span="6"> |
|
|
<el-form-item prop="supplierNo"><span slot="label" :class="{ 'choose-label': !isEditDialogMode }" @click="!isEditDialogMode && openPoSupplierDialog()">供应商编码</span> |
|
|
|
|
|
|
|
|
<el-form-item prop="supplierNo"><span slot="label" :class="{ 'choose-label': !isEditDialogMode && !isSupplierPageMode }" @click="!isEditDialogMode && !isSupplierPageMode && openPoSupplierDialog()">供应商编码</span> |
|
|
<el-input |
|
|
<el-input |
|
|
v-model="addFormData.supplierNo" |
|
|
v-model="addFormData.supplierNo" |
|
|
readonly |
|
|
readonly |
|
|
@ -245,7 +245,7 @@ |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="8"> |
|
|
<el-col :span="8"> |
|
|
<el-form-item label=" " > |
|
|
<el-form-item label=" " > |
|
|
<el-button v-if="!isEditDialogMode" type="primary" size="medium" style="margin-top:13px;" @click="openOrderSupplierDialog">从订单选择供应商</el-button> |
|
|
|
|
|
|
|
|
<el-button v-if="!isEditDialogMode && !isSupplierPageMode" type="primary" size="medium" style="margin-top:13px;" @click="openOrderSupplierDialog">从订单选择供应商</el-button> |
|
|
|
|
|
|
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
@ -331,14 +331,14 @@ |
|
|
style="width: 80px" |
|
|
style="width: 80px" |
|
|
@keyup.enter.native="filterAddPoList"/> |
|
|
@keyup.enter.native="filterAddPoList"/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="供应商名称"> |
|
|
|
|
|
|
|
|
<el-form-item v-if="!isSupplierPageMode" label="供应商名称"> |
|
|
<el-input |
|
|
<el-input |
|
|
v-model="addPoFilter.supplierName" |
|
|
v-model="addPoFilter.supplierName" |
|
|
clearable |
|
|
clearable |
|
|
style="width: 100px" |
|
|
style="width: 100px" |
|
|
@keyup.enter.native="filterAddPoList"/> |
|
|
@keyup.enter.native="filterAddPoList"/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item> |
|
|
|
|
|
|
|
|
<el-form-item v-if="!isSupplierPageMode"> |
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(530, 'addPoPlanner')"><a href="#">Planner</a></span> |
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(530, 'addPoPlanner')"><a href="#">Planner</a></span> |
|
|
<el-input |
|
|
<el-input |
|
|
v-model="addPoFilter.planner" |
|
|
v-model="addPoFilter.planner" |
|
|
@ -730,9 +730,16 @@ import ComInspectionRequestPoDetailTab from './com_inspectionRequestPoDetailTab. |
|
|
import ComInspectionResultTab from './com_inspectionResultTab.vue' |
|
|
import ComInspectionResultTab from './com_inspectionResultTab.vue' |
|
|
import ComInspectionRequestAttachmentTab from './com_inspectionRequestAttachmentTab.vue' |
|
|
import ComInspectionRequestAttachmentTab from './com_inspectionRequestAttachmentTab.vue' |
|
|
import ComInspectionRequestFeeTab from './com_inspectionRequestFeeTab.vue' |
|
|
import ComInspectionRequestFeeTab from './com_inspectionRequestFeeTab.vue' |
|
|
|
|
|
import { fetchSupplierDetail } from '@/utils/supplierChooselistHelper' |
|
|
import excel from '@/utils/excel-util.js' |
|
|
import excel from '@/utils/excel-util.js' |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
|
|
|
props: { |
|
|
|
|
|
supplierMode: { |
|
|
|
|
|
type: Boolean, |
|
|
|
|
|
default: false |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
components: { |
|
|
components: { |
|
|
Chooselist, |
|
|
Chooselist, |
|
|
InspectionRequestDetail: ComInspectionRequestDetail, |
|
|
InspectionRequestDetail: ComInspectionRequestDetail, |
|
|
@ -750,6 +757,8 @@ export default { |
|
|
currentRow: {}, |
|
|
currentRow: {}, |
|
|
tagNo: '', |
|
|
tagNo: '', |
|
|
searchType: '', |
|
|
searchType: '', |
|
|
|
|
|
currentSupplierNo: '', |
|
|
|
|
|
currentSupplierName: '', |
|
|
activeTab: 'base', |
|
|
activeTab: 'base', |
|
|
// 新增弹窗相关数据 |
|
|
// 新增弹窗相关数据 |
|
|
addDialogVisible: false, |
|
|
addDialogVisible: false, |
|
|
@ -1129,6 +1138,9 @@ export default { |
|
|
computed: { |
|
|
computed: { |
|
|
isEditDialogMode () { |
|
|
isEditDialogMode () { |
|
|
return this.addDialogMode === 'edit' |
|
|
return this.addDialogMode === 'edit' |
|
|
|
|
|
}, |
|
|
|
|
|
isSupplierPageMode () { |
|
|
|
|
|
return this.supplierMode === true |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
mounted () { |
|
|
mounted () { |
|
|
@ -1137,10 +1149,72 @@ export default { |
|
|
const calculatedHeight = (window.innerHeight - 220) / 2 |
|
|
const calculatedHeight = (window.innerHeight - 220) / 2 |
|
|
this.height = calculatedHeight |
|
|
this.height = calculatedHeight |
|
|
this.detailHeight = calculatedHeight |
|
|
this.detailHeight = calculatedHeight |
|
|
this.getMainData() |
|
|
|
|
|
|
|
|
this.initPageData() |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
async initPageData () { |
|
|
|
|
|
if (!this.isSupplierPageMode) { |
|
|
|
|
|
this.getMainData() |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
const loaded = await this.loadCurrentUserSupplierContext() |
|
|
|
|
|
if (!loaded) { |
|
|
|
|
|
this.mainDataList = [] |
|
|
|
|
|
this.changeData(null) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.pageIndex = 1 |
|
|
|
|
|
this.getMainData() |
|
|
|
|
|
}, |
|
|
|
|
|
async loadCurrentUserSupplierContext () { |
|
|
|
|
|
try { |
|
|
|
|
|
const { data } = await this.$http({ |
|
|
|
|
|
url: this.$http.adornUrl('/sys/user/info'), |
|
|
|
|
|
method: 'get', |
|
|
|
|
|
params: this.$http.adornParams() |
|
|
|
|
|
}) |
|
|
|
|
|
if (!data || data.code !== 0 || !data.user) { |
|
|
|
|
|
this.$message.error((data && data.msg) || '获取当前用户信息失败') |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
const supplierNo = String(data.user.supplierNo || '').trim() |
|
|
|
|
|
if (!supplierNo) { |
|
|
|
|
|
this.$message.warning('当前账号未维护供应商编码,请先在用户维护中配置') |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
this.currentSupplierNo = supplierNo |
|
|
|
|
|
this.currentSupplierName = String(data.user.supplierName || '').trim() |
|
|
|
|
|
if (!this.currentSupplierName) { |
|
|
|
|
|
const detail = await fetchSupplierDetail(supplierNo, this.$store.state.user.site) |
|
|
|
|
|
this.currentSupplierName = detail |
|
|
|
|
|
? String(detail.supplierName || detail.supplier_name || '').trim() |
|
|
|
|
|
: '' |
|
|
|
|
|
} |
|
|
|
|
|
this.applyCurrentSupplierToSearchFilters() |
|
|
|
|
|
return true |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.error('获取当前用户供应商信息失败:', error) |
|
|
|
|
|
this.$message.error('获取当前用户供应商信息失败') |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
applyCurrentSupplierToSearchFilters () { |
|
|
|
|
|
if (!this.currentSupplierNo) { |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
this.searchData.supplierNo = this.currentSupplierNo |
|
|
|
|
|
this.searchData.supplierName = '' |
|
|
|
|
|
return true |
|
|
|
|
|
}, |
|
|
|
|
|
applyCurrentSupplierToAddForm () { |
|
|
|
|
|
if (!this.currentSupplierNo) { |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
this.$set(this.addFormData, 'supplierNo', this.currentSupplierNo) |
|
|
|
|
|
this.$set(this.addFormData, 'supplierName', this.currentSupplierName || '') |
|
|
|
|
|
return true |
|
|
|
|
|
}, |
|
|
// 统一状态判断,兼容中文和英文状态值 - rqrq |
|
|
// 统一状态判断,兼容中文和英文状态值 - rqrq |
|
|
isRowStatus (row, statusDbList) { |
|
|
isRowStatus (row, statusDbList) { |
|
|
if (!row || !Array.isArray(statusDbList) || statusDbList.length === 0) { |
|
|
if (!row || !Array.isArray(statusDbList) || statusDbList.length === 0) { |
|
|
@ -1276,6 +1350,15 @@ export default { |
|
|
|
|
|
|
|
|
// 查询数据 |
|
|
// 查询数据 |
|
|
getMainData () { |
|
|
getMainData () { |
|
|
|
|
|
if (this.isSupplierPageMode) { |
|
|
|
|
|
if (!this.currentSupplierNo && !this.applyCurrentSupplierToSearchFilters()) { |
|
|
|
|
|
this.mainDataList = [] |
|
|
|
|
|
this.totalPage = 0 |
|
|
|
|
|
this.changeData(null) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.applyCurrentSupplierToSearchFilters() |
|
|
|
|
|
} |
|
|
this.searchData.limit = this.pageSize |
|
|
this.searchData.limit = this.pageSize |
|
|
this.searchData.page = this.pageIndex |
|
|
this.searchData.page = this.pageIndex |
|
|
// 后端查询字段使用 planStartDateStr/planEndDateStr - rqrq |
|
|
// 后端查询字段使用 planStartDateStr/planEndDateStr - rqrq |
|
|
@ -1382,6 +1465,14 @@ export default { |
|
|
addInspectionRequest () { |
|
|
addInspectionRequest () { |
|
|
this.addDialogMode = 'create' |
|
|
this.addDialogMode = 'create' |
|
|
this.resetAddForm() |
|
|
this.resetAddForm() |
|
|
|
|
|
if (this.isSupplierPageMode) { |
|
|
|
|
|
if (!this.applyCurrentSupplierToAddForm()) { |
|
|
|
|
|
this.$message.warning('当前账号未维护供应商编码,请先在用户维护中配置') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.loadPoList() |
|
|
|
|
|
this.fetchSupplierAddress(this.addFormData.supplierNo) |
|
|
|
|
|
} |
|
|
this.addDialogVisible = true |
|
|
this.addDialogVisible = true |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -1464,6 +1555,9 @@ export default { |
|
|
supplierName: '', |
|
|
supplierName: '', |
|
|
planner: '' |
|
|
planner: '' |
|
|
} |
|
|
} |
|
|
|
|
|
if (this.isSupplierPageMode) { |
|
|
|
|
|
this.applyCurrentSupplierToAddForm() |
|
|
|
|
|
} |
|
|
this.pendingAutoSelectPoRow = null |
|
|
this.pendingAutoSelectPoRow = null |
|
|
if (this.$refs.addFormData) { |
|
|
if (this.$refs.addFormData) { |
|
|
this.$refs.addFormData.clearValidate() |
|
|
this.$refs.addFormData.clearValidate() |
|
|
@ -1716,6 +1810,9 @@ export default { |
|
|
|
|
|
|
|
|
// 打开新增弹窗专用供应商查询 |
|
|
// 打开新增弹窗专用供应商查询 |
|
|
openPoSupplierDialog () { |
|
|
openPoSupplierDialog () { |
|
|
|
|
|
if (this.isSupplierPageMode) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
this.poSupplierDialogVisible = true |
|
|
this.poSupplierDialogVisible = true |
|
|
this.poSupplierPageIndex = 1 |
|
|
this.poSupplierPageIndex = 1 |
|
|
this.poSupplierCurrentRow = null |
|
|
this.poSupplierCurrentRow = null |
|
|
@ -1891,6 +1988,9 @@ export default { |
|
|
|
|
|
|
|
|
// 打开“从订单选择供应商”弹框(不默认筛供应商) |
|
|
// 打开“从订单选择供应商”弹框(不默认筛供应商) |
|
|
openOrderSupplierDialog () { |
|
|
openOrderSupplierDialog () { |
|
|
|
|
|
if (this.isSupplierPageMode) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
this.orderSupplierDialogVisible = true |
|
|
this.orderSupplierDialogVisible = true |
|
|
this.orderSupplierCurrentRow = null |
|
|
this.orderSupplierCurrentRow = null |
|
|
this.orderSupplierPageIndex = 1 |
|
|
this.orderSupplierPageIndex = 1 |
|
|
@ -2560,9 +2660,6 @@ export default { |
|
|
this.applyChangeLoading = false |
|
|
this.applyChangeLoading = false |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}, |
|
|
|
|
|
created () { |
|
|
|
|
|
this.getMainData() |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|