1.searchSelect组件调整为页面缓存数据。
This commit is contained in:
parent
10a7c5e372
commit
14b5f68377
|
@ -1,13 +1,34 @@
|
||||||
// searchData.js - 搜索配置的独立模块
|
// searchData.js - 搜索配置的独立模块
|
||||||
|
|
||||||
export const selectConfigs =[
|
export const selectConfigs =[
|
||||||
// 磅点选择
|
// 出厂入厂磅
|
||||||
{
|
{
|
||||||
key: 'truepound',
|
key: 'outinpound',
|
||||||
|
params: 't_data_truepound;id;concat(name,\' \',usrcode)',
|
||||||
|
where: "poundtype = '1' or poundtype = '2'",
|
||||||
|
orderby: 'usrcode asc'
|
||||||
|
},
|
||||||
|
// 倒短
|
||||||
|
{
|
||||||
|
key: 'shortdispound',
|
||||||
params: 't_data_truepound;id;concat(name,\' \',usrcode)',
|
params: 't_data_truepound;id;concat(name,\' \',usrcode)',
|
||||||
where: 'poundtype = \'3\'',
|
where: 'poundtype = \'3\'',
|
||||||
orderby: 'usrcode asc'
|
orderby: 'usrcode asc'
|
||||||
},
|
},
|
||||||
|
// 铁水
|
||||||
|
{
|
||||||
|
key: 'moltenironpound',
|
||||||
|
params: 't_data_truepound;id;concat(name,\' \',usrcode)',
|
||||||
|
where: 'poundtype = \'4\'',
|
||||||
|
orderby: 'usrcode asc'
|
||||||
|
},
|
||||||
|
// 成品
|
||||||
|
{
|
||||||
|
key: 'steelpound',
|
||||||
|
params: 't_data_truepound;id;concat(name,\' \',usrcode)',
|
||||||
|
where: 'poundtype = \'5\'',
|
||||||
|
orderby: 'usrcode asc'
|
||||||
|
},
|
||||||
// 业务磅点
|
// 业务磅点
|
||||||
{
|
{
|
||||||
key: 'buspound',
|
key: 'buspound',
|
||||||
|
|
|
@ -14,9 +14,7 @@
|
||||||
<!-- />-->
|
<!-- />-->
|
||||||
<!-- </el-select>-->
|
<!-- </el-select>-->
|
||||||
<search-select v-model="queryParams.poundid"
|
<search-select v-model="queryParams.poundid"
|
||||||
params = "t_data_truepound;id;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('moltenironpound')"
|
||||||
where="poundtype = '4'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
></search-select>
|
></search-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -73,9 +71,7 @@
|
||||||
<!-- />-->
|
<!-- />-->
|
||||||
<!-- </el-select>-->
|
<!-- </el-select>-->
|
||||||
<search-select v-model="queryPageParams.mstBill.recunitid"
|
<search-select v-model="queryPageParams.mstBill.recunitid"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('recunit')"
|
||||||
where="type = 'receivingCompany'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
clearable
|
clearable
|
||||||
></search-select>
|
></search-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -89,9 +85,7 @@
|
||||||
<!-- @keyup.enter.native="handleQuery"-->
|
<!-- @keyup.enter.native="handleQuery"-->
|
||||||
<!-- />-->
|
<!-- />-->
|
||||||
<search-select v-model="queryPageParams.mstBill.itmcode"
|
<search-select v-model="queryPageParams.mstBill.itmcode"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('itmcode')"
|
||||||
where="type = 'productName'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
clearable
|
clearable
|
||||||
></search-select>
|
></search-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -101,9 +95,7 @@
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="发货单位" prop="sendunitid">
|
<el-form-item label="发货单位" prop="sendunitid">
|
||||||
<search-select v-model="queryPageParams.mstBill.sendunitid"
|
<search-select v-model="queryPageParams.mstBill.sendunitid"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('sendunit')"
|
||||||
where="type = 'shippingCompany'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
clearable
|
clearable
|
||||||
></search-select>
|
></search-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -111,9 +103,7 @@
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="生产班组" prop="trnunitid">
|
<el-form-item label="生产班组" prop="trnunitid">
|
||||||
<search-select v-model="queryPageParams.mstBill.trnunitid"
|
<search-select v-model="queryPageParams.mstBill.trnunitid"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('trnunit')"
|
||||||
where="type = 'teamOrCarrier'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
clearable
|
clearable
|
||||||
></search-select>
|
></search-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -153,9 +143,7 @@
|
||||||
<search-select
|
<search-select
|
||||||
:disabled = "true"
|
:disabled = "true"
|
||||||
v-model="scope.row.itmcode"
|
v-model="scope.row.itmcode"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('itmcode')"
|
||||||
where="type = 'productName'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
class="search-select-custom-disabled"
|
class="search-select-custom-disabled"
|
||||||
></search-select>
|
></search-select>
|
||||||
</template>
|
</template>
|
||||||
|
@ -168,9 +156,7 @@
|
||||||
<search-select
|
<search-select
|
||||||
:disabled = "true"
|
:disabled = "true"
|
||||||
v-model="scope.row.sendunitid"
|
v-model="scope.row.sendunitid"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('sendunit')"
|
||||||
where="type = 'shippingCompany'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
class="search-select-custom-disabled"
|
class="search-select-custom-disabled"
|
||||||
></search-select>
|
></search-select>
|
||||||
</template>
|
</template>
|
||||||
|
@ -180,9 +166,7 @@
|
||||||
<search-select
|
<search-select
|
||||||
:disabled = "true"
|
:disabled = "true"
|
||||||
v-model="scope.row.recunitid"
|
v-model="scope.row.recunitid"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('recunit')"
|
||||||
where="type = 'receivingCompany'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
class="search-select-custom-disabled"
|
class="search-select-custom-disabled"
|
||||||
></search-select>
|
></search-select>
|
||||||
</template>
|
</template>
|
||||||
|
@ -192,9 +176,7 @@
|
||||||
<search-select
|
<search-select
|
||||||
:disabled = "true"
|
:disabled = "true"
|
||||||
v-model="scope.row.trnunitid"
|
v-model="scope.row.trnunitid"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('trnunit')"
|
||||||
where="type = 'teamOrCarrier'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
class="search-select-custom-disabled"
|
class="search-select-custom-disabled"
|
||||||
></search-select>
|
></search-select>
|
||||||
</template>
|
</template>
|
||||||
|
@ -236,9 +218,7 @@
|
||||||
<search-select
|
<search-select
|
||||||
:disabled = "true"
|
:disabled = "true"
|
||||||
v-model="scope.row.appliid"
|
v-model="scope.row.appliid"
|
||||||
params = "t_data_poundmst;id;usrcode"
|
:options = "getOptionsByKey('appli')"
|
||||||
where=""
|
|
||||||
orderby="usrcode asc"
|
|
||||||
class="search-select-custom-disabled"
|
class="search-select-custom-disabled"
|
||||||
></search-select>
|
></search-select>
|
||||||
</template>
|
</template>
|
||||||
|
@ -252,9 +232,7 @@
|
||||||
<search-select
|
<search-select
|
||||||
:disabled = "true"
|
:disabled = "true"
|
||||||
v-model="scope.row.sendunitid"
|
v-model="scope.row.sendunitid"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('sendunit')"
|
||||||
where="type = 'shippingCompany'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
class="search-select-custom-disabled"
|
class="search-select-custom-disabled"
|
||||||
></search-select>
|
></search-select>
|
||||||
</template>
|
</template>
|
||||||
|
@ -264,9 +242,7 @@
|
||||||
<search-select
|
<search-select
|
||||||
:disabled = "true"
|
:disabled = "true"
|
||||||
v-model="scope.row.recunitid"
|
v-model="scope.row.recunitid"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('recunit')"
|
||||||
where="type = 'receivingCompany'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
class="search-select-custom-disabled"
|
class="search-select-custom-disabled"
|
||||||
></search-select>
|
></search-select>
|
||||||
</template>
|
</template>
|
||||||
|
@ -276,9 +252,7 @@
|
||||||
<search-select
|
<search-select
|
||||||
:disabled = "true"
|
:disabled = "true"
|
||||||
v-model="scope.row.itmcode"
|
v-model="scope.row.itmcode"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('itmcode')"
|
||||||
where="type = 'productName'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
class="search-select-custom-disabled"
|
class="search-select-custom-disabled"
|
||||||
></search-select>
|
></search-select>
|
||||||
</template>
|
</template>
|
||||||
|
@ -359,9 +333,7 @@
|
||||||
<search-select
|
<search-select
|
||||||
:disabled = "true"
|
:disabled = "true"
|
||||||
v-model="scope.row.appliid"
|
v-model="scope.row.appliid"
|
||||||
params = "t_data_poundmst;id;usrcode"
|
:options = "getOptionsByKey('appli')"
|
||||||
where=""
|
|
||||||
orderby="usrcode asc"
|
|
||||||
class="search-select-custom-disabled"
|
class="search-select-custom-disabled"
|
||||||
></search-select>
|
></search-select>
|
||||||
</template>
|
</template>
|
||||||
|
@ -373,9 +345,7 @@
|
||||||
<search-select
|
<search-select
|
||||||
:disabled = "true"
|
:disabled = "true"
|
||||||
v-model="scope.row.sendunitid"
|
v-model="scope.row.sendunitid"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('sendunit')"
|
||||||
where="type = 'shippingCompany'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
class="search-select-custom-disabled"
|
class="search-select-custom-disabled"
|
||||||
></search-select>
|
></search-select>
|
||||||
</template>
|
</template>
|
||||||
|
@ -385,9 +355,7 @@
|
||||||
<search-select
|
<search-select
|
||||||
:disabled = "true"
|
:disabled = "true"
|
||||||
v-model="scope.row.recunitid"
|
v-model="scope.row.recunitid"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('recunit')"
|
||||||
where="type = 'receivingCompany'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
class="search-select-custom-disabled"
|
class="search-select-custom-disabled"
|
||||||
></search-select>
|
></search-select>
|
||||||
</template>
|
</template>
|
||||||
|
@ -397,9 +365,7 @@
|
||||||
<search-select
|
<search-select
|
||||||
:disabled = "true"
|
:disabled = "true"
|
||||||
v-model="scope.row.trnunitid"
|
v-model="scope.row.trnunitid"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('trnunit')"
|
||||||
where="type = 'teamOrCarrier'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
class="search-select-custom-disabled"
|
class="search-select-custom-disabled"
|
||||||
></search-select>
|
></search-select>
|
||||||
</template>
|
</template>
|
||||||
|
@ -409,9 +375,7 @@
|
||||||
<search-select
|
<search-select
|
||||||
:disabled = "true"
|
:disabled = "true"
|
||||||
v-model="scope.row.itmcode"
|
v-model="scope.row.itmcode"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('itmcode')"
|
||||||
where="type = 'productName'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
class="search-select-custom-disabled"
|
class="search-select-custom-disabled"
|
||||||
></search-select>
|
></search-select>
|
||||||
</template>
|
</template>
|
||||||
|
@ -480,9 +444,7 @@
|
||||||
<el-col :span="18">
|
<el-col :span="18">
|
||||||
<el-form-item prop="carno" label-width="40">
|
<el-form-item prop="carno" label-width="40">
|
||||||
<search-select v-model="queryParams.carno"
|
<search-select v-model="queryParams.carno"
|
||||||
params = "t_data_pounddata;usrcode;usrcode"
|
:options = "getOptionsByKey('carno')"
|
||||||
where="type = 'plateNumber'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
></search-select>
|
></search-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -528,10 +490,7 @@
|
||||||
<el-form-item label="业务磅点" prop="poundid">
|
<el-form-item label="业务磅点" prop="poundid">
|
||||||
<search-select
|
<search-select
|
||||||
v-model="mstBillFormData.mstBillForm.poundid"
|
v-model="mstBillFormData.mstBillForm.poundid"
|
||||||
params="t_data_buspound;id;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('buspound')"
|
||||||
where = ""
|
|
||||||
orderby="usrcode asc"
|
|
||||||
:clearable = "true"
|
|
||||||
:disabled = "true"
|
:disabled = "true"
|
||||||
></search-select>
|
></search-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -541,9 +500,7 @@
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<el-form-item label="发货单位" prop="sendunitid">
|
<el-form-item label="发货单位" prop="sendunitid">
|
||||||
<search-select v-model="mstBillFormData.mstBillForm.sendunitid"
|
<search-select v-model="mstBillFormData.mstBillForm.sendunitid"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('sendunit')"
|
||||||
where="type = 'shippingCompany'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
clearable
|
clearable
|
||||||
></search-select>
|
></search-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -551,9 +508,7 @@
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="品名" prop="itmcode">
|
<el-form-item label="品名" prop="itmcode">
|
||||||
<search-select v-model="mstBillFormData.mstBillForm.itmcode"
|
<search-select v-model="mstBillFormData.mstBillForm.itmcode"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('itmcode')"
|
||||||
where="type = 'productName'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
clearable
|
clearable
|
||||||
></search-select>
|
></search-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -563,9 +518,7 @@
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<el-form-item label="收货单位" prop="recunitid">
|
<el-form-item label="收货单位" prop="recunitid">
|
||||||
<search-select v-model="mstBillFormData.mstBillForm.recunitid"
|
<search-select v-model="mstBillFormData.mstBillForm.recunitid"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('recunit')"
|
||||||
where="type = 'receivingCompany'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
clearable
|
clearable
|
||||||
></search-select>
|
></search-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -580,9 +533,7 @@
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<el-form-item label="班组/承运" prop="trnunitid">
|
<el-form-item label="班组/承运" prop="trnunitid">
|
||||||
<search-select v-model="mstBillFormData.mstBillForm.trnunitid"
|
<search-select v-model="mstBillFormData.mstBillForm.trnunitid"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('trnunit')"
|
||||||
where="type = 'teamOrCarrier'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
clearable
|
clearable
|
||||||
></search-select>
|
></search-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -610,9 +561,7 @@
|
||||||
<el-form-item label="主榜单编号" prop="usrcode" readonly>
|
<el-form-item label="主榜单编号" prop="usrcode" readonly>
|
||||||
<!-- <el-input v-model="mstBillFormData.mstBillForm.usrcode" placeholder="请输入主榜单编号" />-->
|
<!-- <el-input v-model="mstBillFormData.mstBillForm.usrcode" placeholder="请输入主榜单编号" />-->
|
||||||
<search-select v-model="poundBillDetailFormData.poundBillDetailForm.appliid"
|
<search-select v-model="poundBillDetailFormData.poundBillDetailForm.appliid"
|
||||||
params = "t_data_poundmst;id;usrcode"
|
:options = "getOptionsByKey('appli')"
|
||||||
where=""
|
|
||||||
orderby="usrcode asc"
|
|
||||||
disabled
|
disabled
|
||||||
class="search-select-custom-disabled"
|
class="search-select-custom-disabled"
|
||||||
></search-select>
|
></search-select>
|
||||||
|
@ -626,9 +575,7 @@
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="发货单位" prop="sendunitid">
|
<el-form-item label="发货单位" prop="sendunitid">
|
||||||
<search-select v-model="poundBillDetailFormData.poundBillDetailForm.sendunitid"
|
<search-select v-model="poundBillDetailFormData.poundBillDetailForm.sendunitid"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('sendunit')"
|
||||||
where="type = 'shippingCompany'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
></search-select>
|
></search-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -637,18 +584,14 @@
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<el-form-item label="收货单位" prop="recunitid">
|
<el-form-item label="收货单位" prop="recunitid">
|
||||||
<search-select v-model="poundBillDetailFormData.poundBillDetailForm.recunitid"
|
<search-select v-model="poundBillDetailFormData.poundBillDetailForm.recunitid"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('recunit')"
|
||||||
where="type = 'receivingCompany'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
></search-select>
|
></search-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="品名" prop="itmcode">
|
<el-form-item label="品名" prop="itmcode">
|
||||||
<search-select v-model="poundBillDetailFormData.poundBillDetailForm.itmcode"
|
<search-select v-model="poundBillDetailFormData.poundBillDetailForm.itmcode"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('itmcode')"
|
||||||
where="type = 'productName'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
></search-select>
|
></search-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -713,7 +656,10 @@ import {
|
||||||
updateTransPoundbill
|
updateTransPoundbill
|
||||||
} from "@/api/measurement/bill/poundbill";
|
} from "@/api/measurement/bill/poundbill";
|
||||||
import {getCarnoEmpwgtData} from "@/api/measurement/basedata/empwgtdata";
|
import {getCarnoEmpwgtData} from "@/api/measurement/basedata/empwgtdata";
|
||||||
|
//引入searchSelect方法
|
||||||
|
import { getSearchSelectData } from "@/api/tool/gen.js";
|
||||||
|
//引入searchData组件
|
||||||
|
import {selectConfigs} from "@/components/SearchSelect/searchdata.js";
|
||||||
export default {
|
export default {
|
||||||
name: "Moltenironpound",
|
name: "Moltenironpound",
|
||||||
components: {SearchSelect},
|
components: {SearchSelect},
|
||||||
|
@ -839,10 +785,16 @@ export default {
|
||||||
thisSelectedRow:{},
|
thisSelectedRow:{},
|
||||||
isWght:true,
|
isWght:true,
|
||||||
},
|
},
|
||||||
|
//关于searchSelect的参数数据
|
||||||
|
searchData: {
|
||||||
|
optionsMap: {},
|
||||||
|
selectConfigs:selectConfigs
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
// this.getList()
|
// this.getList()
|
||||||
|
this.loadAllSelectOptions();
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
//监听磅点变化
|
//监听磅点变化
|
||||||
|
@ -1261,7 +1213,33 @@ export default {
|
||||||
}
|
}
|
||||||
//触发完成方法
|
//触发完成方法
|
||||||
await complete(this.mstBillFormData.selectedIds[0])
|
await complete(this.mstBillFormData.selectedIds[0])
|
||||||
}
|
},
|
||||||
|
|
||||||
|
//searchSelect相关方法
|
||||||
|
buildCacheKey({ params, where, groupby = '', orderby = '' }) {
|
||||||
|
return `${params}|${where}|${groupby}|${orderby}`;
|
||||||
|
},
|
||||||
|
async loadAllSelectOptions() {
|
||||||
|
for (const cfg of this.searchData.selectConfigs) {
|
||||||
|
const key = this.buildCacheKey(cfg);
|
||||||
|
if (!this.searchData.optionsMap[key]) {
|
||||||
|
const [tableName, value, label] = cfg.params.split(';');
|
||||||
|
const res = await getSearchSelectData({
|
||||||
|
tableName: tableName,
|
||||||
|
value: value,
|
||||||
|
label: label,
|
||||||
|
where: cfg.where,
|
||||||
|
groupby: cfg.groupby,
|
||||||
|
orderby: cfg.orderby
|
||||||
|
});
|
||||||
|
this.$set(this.searchData.optionsMap, key, res.code === 200 ? res.data : []);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getOptionsByKey(key) {
|
||||||
|
const cfg = this.searchData.selectConfigs.find(c => c.key === key);
|
||||||
|
return this.searchData.optionsMap[this.buildCacheKey(cfg)] || [];
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<!-- />-->
|
<!-- />-->
|
||||||
<!-- </el-select>-->
|
<!-- </el-select>-->
|
||||||
<search-select v-model="queryParams.poundid"
|
<search-select v-model="queryParams.poundid"
|
||||||
:options="getOptionsByKey('truepound')"
|
:options="getOptionsByKey('outinpound')"
|
||||||
></search-select>
|
></search-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<!-- />-->
|
<!-- />-->
|
||||||
<!-- </el-select>-->
|
<!-- </el-select>-->
|
||||||
<search-select v-model="queryParams.poundid"
|
<search-select v-model="queryParams.poundid"
|
||||||
:options="this.getOptionsByKey('truepound')"
|
:options="this.getOptionsByKey('shortdispound')"
|
||||||
></search-select>
|
></search-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -882,74 +882,6 @@ export default {
|
||||||
isWght:true,
|
isWght:true,
|
||||||
},
|
},
|
||||||
//关于searchSelect的参数数据
|
//关于searchSelect的参数数据
|
||||||
searchData111:{
|
|
||||||
optionsMap:{},
|
|
||||||
selectConfigs:[
|
|
||||||
//磅点选择
|
|
||||||
{
|
|
||||||
key: 'truepound',
|
|
||||||
params: 't_data_truepound;id;concat(name,\' \',usrcode)',
|
|
||||||
where: 'poundtype = \'3\'',
|
|
||||||
orderby: 'usrcode asc'
|
|
||||||
},
|
|
||||||
//业务磅点
|
|
||||||
{
|
|
||||||
key: 'buspound',
|
|
||||||
params: "t_data_buspound;id;concat(name,' ',usrcode)",
|
|
||||||
where: '',
|
|
||||||
orderby: 'usrcode asc'
|
|
||||||
},
|
|
||||||
//车号
|
|
||||||
{
|
|
||||||
key: 'carno',
|
|
||||||
params : "t_data_pounddata;usrcode;usrcode",
|
|
||||||
where : "type = 'plateNumber'",
|
|
||||||
orderby : "usrcode asc"
|
|
||||||
},
|
|
||||||
//司机
|
|
||||||
{
|
|
||||||
key: 'cardriver',
|
|
||||||
params : "t_data_pounddata;usrcode;usrcode",
|
|
||||||
where : "type = 'driverName'",
|
|
||||||
orderby : "usrcode asc"
|
|
||||||
},
|
|
||||||
//品名
|
|
||||||
{
|
|
||||||
key: 'itmcode',
|
|
||||||
params : "t_data_pounddata;usrcode;concat(name,' ',usrcode)",
|
|
||||||
where : "type = 'productName'",
|
|
||||||
orderby : "usrcode asc"
|
|
||||||
},
|
|
||||||
//收货单位
|
|
||||||
{
|
|
||||||
key: 'recunit',
|
|
||||||
params : "t_data_pounddata;usrcode;concat(name,' ',usrcode)",
|
|
||||||
where : "type = 'receivingCompany'",
|
|
||||||
orderby : "usrcode asc"
|
|
||||||
},
|
|
||||||
//承运单位
|
|
||||||
{
|
|
||||||
key: 'trnunit',
|
|
||||||
params : "t_data_pounddata;usrcode;concat(name,' ',usrcode)",
|
|
||||||
where : "type = 'teamOrCarrier'",
|
|
||||||
orderby : "usrcode asc"
|
|
||||||
},
|
|
||||||
//发货单位
|
|
||||||
{
|
|
||||||
key: 'sendunit',
|
|
||||||
params : "t_data_pounddata;usrcode;concat(name,' ',usrcode)",
|
|
||||||
where : "type = 'shippingCompany'",
|
|
||||||
orderby : "usrcode asc"
|
|
||||||
},
|
|
||||||
//主榜单号
|
|
||||||
{
|
|
||||||
key: 'appli',
|
|
||||||
params : "t_data_poundmst;id;usrcode",
|
|
||||||
where : "",
|
|
||||||
orderby : "usrcode asc"
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
searchData: {
|
searchData: {
|
||||||
optionsMap: {},
|
optionsMap: {},
|
||||||
selectConfigs:selectConfigs
|
selectConfigs:selectConfigs
|
||||||
|
|
|
@ -6,9 +6,7 @@
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="磅点" prop="poundid" label-width="40">
|
<el-form-item label="磅点" prop="poundid" label-width="40">
|
||||||
<search-select v-model="queryParams.poundid"
|
<search-select v-model="queryParams.poundid"
|
||||||
params = "t_data_truepound;id;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('steelpound')"
|
||||||
where="poundtype = '5'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
></search-select>
|
></search-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -85,9 +83,7 @@
|
||||||
<search-select
|
<search-select
|
||||||
:disabled = "true"
|
:disabled = "true"
|
||||||
v-model="scope.row.itmcode"
|
v-model="scope.row.itmcode"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('itmcode')"
|
||||||
where="type = 'productName'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
class="search-select-custom-disabled"
|
class="search-select-custom-disabled"
|
||||||
></search-select>
|
></search-select>
|
||||||
</template>
|
</template>
|
||||||
|
@ -99,9 +95,7 @@
|
||||||
<search-select
|
<search-select
|
||||||
:disabled = "true"
|
:disabled = "true"
|
||||||
v-model="scope.row.sendunitid"
|
v-model="scope.row.sendunitid"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('sendunit')"
|
||||||
where="type = 'shippingCompany'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
class="search-select-custom-disabled"
|
class="search-select-custom-disabled"
|
||||||
></search-select>
|
></search-select>
|
||||||
</template>
|
</template>
|
||||||
|
@ -111,9 +105,7 @@
|
||||||
<search-select
|
<search-select
|
||||||
:disabled = "true"
|
:disabled = "true"
|
||||||
v-model="scope.row.recunitid"
|
v-model="scope.row.recunitid"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('recunit')"
|
||||||
where="type = 'receivingCompany'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
class="search-select-custom-disabled"
|
class="search-select-custom-disabled"
|
||||||
></search-select>
|
></search-select>
|
||||||
</template>
|
</template>
|
||||||
|
@ -123,9 +115,7 @@
|
||||||
<search-select
|
<search-select
|
||||||
:disabled = "true"
|
:disabled = "true"
|
||||||
v-model="scope.row.trnunitid"
|
v-model="scope.row.trnunitid"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('trnunit')"
|
||||||
where="type = 'teamOrCarrier'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
class="search-select-custom-disabled"
|
class="search-select-custom-disabled"
|
||||||
></search-select>
|
></search-select>
|
||||||
</template>
|
</template>
|
||||||
|
@ -173,9 +163,7 @@
|
||||||
<search-select
|
<search-select
|
||||||
:disabled = "true"
|
:disabled = "true"
|
||||||
v-model="scope.row.appliid"
|
v-model="scope.row.appliid"
|
||||||
params = "t_data_poundmst;id;usrcode"
|
:options = "getOptionsByKey('appli')"
|
||||||
where=""
|
|
||||||
orderby="usrcode asc"
|
|
||||||
class="search-select-custom-disabled"
|
class="search-select-custom-disabled"
|
||||||
></search-select>
|
></search-select>
|
||||||
</template>
|
</template>
|
||||||
|
@ -287,10 +275,7 @@
|
||||||
<el-form-item label="业务磅点" prop="poundid">
|
<el-form-item label="业务磅点" prop="poundid">
|
||||||
<search-select
|
<search-select
|
||||||
v-model="mstBillFormData.mstBillForm.poundid"
|
v-model="mstBillFormData.mstBillForm.poundid"
|
||||||
params="t_data_buspound;id;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('buspound')"
|
||||||
where = ""
|
|
||||||
orderby="usrcode asc"
|
|
||||||
:clearable = "true"
|
|
||||||
:disabled = "true"
|
:disabled = "true"
|
||||||
></search-select>
|
></search-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -300,9 +285,7 @@
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<el-form-item label="发货单位" prop="sendunitid">
|
<el-form-item label="发货单位" prop="sendunitid">
|
||||||
<search-select v-model="mstBillFormData.mstBillForm.sendunitid"
|
<search-select v-model="mstBillFormData.mstBillForm.sendunitid"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('sendunit')"
|
||||||
where="type = 'shippingCompany'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
clearable
|
clearable
|
||||||
></search-select>
|
></search-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -310,9 +293,7 @@
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="品名" prop="itmcode">
|
<el-form-item label="品名" prop="itmcode">
|
||||||
<search-select v-model="mstBillFormData.mstBillForm.itmcode"
|
<search-select v-model="mstBillFormData.mstBillForm.itmcode"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('itmcode')"
|
||||||
where="type = 'productName'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
clearable
|
clearable
|
||||||
></search-select>
|
></search-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -322,9 +303,7 @@
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<el-form-item label="收货单位" prop="recunitid">
|
<el-form-item label="收货单位" prop="recunitid">
|
||||||
<search-select v-model="mstBillFormData.mstBillForm.recunitid"
|
<search-select v-model="mstBillFormData.mstBillForm.recunitid"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('recunit')"
|
||||||
where="type = 'receivingCompany'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
clearable
|
clearable
|
||||||
></search-select>
|
></search-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -382,9 +361,7 @@
|
||||||
<el-form-item label="主榜单编号" prop="usrcode" readonly>
|
<el-form-item label="主榜单编号" prop="usrcode" readonly>
|
||||||
<!-- <el-input v-model="mstBillFormData.mstBillForm.usrcode" placeholder="请输入主榜单编号" />-->
|
<!-- <el-input v-model="mstBillFormData.mstBillForm.usrcode" placeholder="请输入主榜单编号" />-->
|
||||||
<search-select v-model="poundBillDetailFormData.poundBillDetailForm.appliid"
|
<search-select v-model="poundBillDetailFormData.poundBillDetailForm.appliid"
|
||||||
params = "t_data_poundmst;id;usrcode"
|
:options = "getOptionsByKey('appli')"
|
||||||
where=""
|
|
||||||
orderby="usrcode asc"
|
|
||||||
disabled
|
disabled
|
||||||
class="search-select-custom-disabled"
|
class="search-select-custom-disabled"
|
||||||
></search-select>
|
></search-select>
|
||||||
|
@ -402,9 +379,7 @@
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="品名" prop="itmcode">
|
<el-form-item label="品名" prop="itmcode">
|
||||||
<search-select v-model="poundBillDetailFormData.poundBillDetailForm.itmcode"
|
<search-select v-model="poundBillDetailFormData.poundBillDetailForm.itmcode"
|
||||||
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
|
:options = "getOptionsByKey('itmcode')"
|
||||||
where="type = 'productName'"
|
|
||||||
orderby="usrcode asc"
|
|
||||||
></search-select>
|
></search-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -448,6 +423,10 @@ import SearchSelect from "@/components/SearchSelect";
|
||||||
import {addPoundmst, getNumber, getPoundmst, listPoundmst, updatePoundmst,complete} from "@/api/measurement/bill/poundmst";
|
import {addPoundmst, getNumber, getPoundmst, listPoundmst, updatePoundmst,complete} from "@/api/measurement/bill/poundmst";
|
||||||
import {addTransPoundbill, getNumber as getPoundBillNumber,getMaxBundleNo, listPoundbill,addSteelPoundbill} from "@/api/measurement/bill/poundbill";
|
import {addTransPoundbill, getNumber as getPoundBillNumber,getMaxBundleNo, listPoundbill,addSteelPoundbill} from "@/api/measurement/bill/poundbill";
|
||||||
import Decimal from "decimal.js";
|
import Decimal from "decimal.js";
|
||||||
|
//引入searchSelect方法
|
||||||
|
import { getSearchSelectData } from "@/api/tool/gen.js";
|
||||||
|
//引入searchData组件
|
||||||
|
import {selectConfigs} from "@/components/SearchSelect/searchdata.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Steelpound",
|
name: "Steelpound",
|
||||||
|
@ -568,11 +547,17 @@ export default {
|
||||||
autoPound:false,
|
autoPound:false,
|
||||||
isWeighing: false, // 是否已完成一次称重
|
isWeighing: false, // 是否已完成一次称重
|
||||||
weightTimer: null // 定时器引用
|
weightTimer: null // 定时器引用
|
||||||
}
|
},
|
||||||
|
//关于searchSelect的参数数据
|
||||||
|
searchData: {
|
||||||
|
optionsMap: {},
|
||||||
|
selectConfigs:selectConfigs
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
// this.getList()
|
// this.getList()
|
||||||
|
this.loadAllSelectOptions();
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
//监听磅点变化
|
//监听磅点变化
|
||||||
|
@ -985,7 +970,32 @@ export default {
|
||||||
}
|
}
|
||||||
//触发完成方法
|
//触发完成方法
|
||||||
await complete(this.mstBillFormData.selectedIds[0])
|
await complete(this.mstBillFormData.selectedIds[0])
|
||||||
}
|
},
|
||||||
|
//searchSelect相关方法
|
||||||
|
buildCacheKey({ params, where, groupby = '', orderby = '' }) {
|
||||||
|
return `${params}|${where}|${groupby}|${orderby}`;
|
||||||
|
},
|
||||||
|
async loadAllSelectOptions() {
|
||||||
|
for (const cfg of this.searchData.selectConfigs) {
|
||||||
|
const key = this.buildCacheKey(cfg);
|
||||||
|
if (!this.searchData.optionsMap[key]) {
|
||||||
|
const [tableName, value, label] = cfg.params.split(';');
|
||||||
|
const res = await getSearchSelectData({
|
||||||
|
tableName: tableName,
|
||||||
|
value: value,
|
||||||
|
label: label,
|
||||||
|
where: cfg.where,
|
||||||
|
groupby: cfg.groupby,
|
||||||
|
orderby: cfg.orderby
|
||||||
|
});
|
||||||
|
this.$set(this.searchData.optionsMap, key, res.code === 200 ? res.data : []);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getOptionsByKey(key) {
|
||||||
|
const cfg = this.searchData.selectConfigs.find(c => c.key === key);
|
||||||
|
return this.searchData.optionsMap[this.buildCacheKey(cfg)] || [];
|
||||||
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue