作者 张晓杰

物料表下拉修改追加规格型号

... ... @@ -23,8 +23,8 @@
<a-col :span="24">
<a-form-model-item label="品名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productName">
<a-input v-model="model.productName" placeholder="请输入品名" v-if="model.chooseStatus ==1"></a-input>
<a-select size="small" v-model="model.productName" placeholder="请选择品名" allowClear @change = "handleChange" v-if="model.chooseStatus ==0">
<a-select-option v-for="(item,index) in materialOptions" :key="index" :value="item.partNumber" :channel="item">{{ item.productName }}</a-select-option>
<a-select size="small" v-model="model.productName" placeholder="请选择品名" allowClear show-search :filter-option="filterOption" @change = "handleChange" v-if="model.chooseStatus ==0">
<a-select-option v-for="(item,index) in materialOptions" :key="index" :value="item.partNumber" :channel="item">{{ item.productName }} - {{ item.spec }} - {{ item.type }}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
... ... @@ -240,6 +240,11 @@ export default {
this.isBianhaoDisabled = false
}
},
filterOption(input, option) {
return (
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
);
},
loadTree(){
httpAction(this.url.listAllMaterial,null, "get").then((res) => {
if (res.success) {
... ...
... ... @@ -59,7 +59,7 @@
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" -->
<a-table
ref="table"
size="middle"
... ... @@ -71,7 +71,7 @@
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}"
:customRow="clickThenSelect"
@change="handleMyTableChange">
<template slot="dispatchedWorkingHoursSlot" slot-scope="text,record">
... ...
... ... @@ -172,7 +172,7 @@ export default {
// 触发表单验证
this.$refs.form.validate(valid => {
if (valid) {
console.log(this.model)
console.log('this.model',this.model)
// return
that.confirmLoading = true;
let httpurl = this.url.edit;
... ...
... ... @@ -53,9 +53,9 @@
></j-super-query>
<a-button type="primary" @click="selectup(salaryMonth)" icon="search">计算</a-button>
<a-button type="primary" @click="downloadFile2('工资导入.xlsx')" download="工资导入.xlsx">导入模版下载</a-button>
<a href="https://feite-1300636907.cos.ap-chongqing.myqcloud.com/工资导入.xlsx" download="工资导入.xlsx"
<!-- <a href="https://feite-1300636907.cos.ap-chongqing.myqcloud.com/工资导入.xlsx" download="工资导入.xlsx"
>下载工资导入文件</a
>
> -->
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
... ... @@ -256,7 +256,7 @@ export default {
let token = Vue.ls.get(ACCESS_TOKEN)
console.log(token)
// 发起文件下载请求
const response = await fetch(`http://localhost:8080/jeecg-boot/salary/calculation/download/${filePath}`, {
const response = await fetch(Vue.prototype.API_BASE_URL + `/salary/calculation/download/${filePath}`, {
method: 'GET',
mode: 'cors',
headers: {
... ...
... ... @@ -24,8 +24,8 @@
<a-col :span="24">
<a-form-model-item label="外购件名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productName">
<a-input v-model="model.productName" placeholder="请输入外购件名称" v-if="model.chooseStatus ==1"></a-input>
<a-select size="small" v-model="model.productName" placeholder="请选择外购件" allowClear @change = "handleChange" v-if="model.chooseStatus ==0">
<a-select-option v-for="(item,index) in materialOptions" :key="index" :value="item.partNumber" :channel="item">{{ item.productName }}</a-select-option>
<a-select size="small" v-model="model.productName" placeholder="请选择外购件" show-search :filter-option="filterOption" allowClear @change = "handleChange" v-if="model.chooseStatus ==0" >
<a-select-option v-for="(item,index) in materialOptions" :key="index" :value="item.partNumber" :channel="item">{{ item.productName }} - {{ item.spec }} - {{ item.type }}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
... ... @@ -139,9 +139,9 @@ export default {
type: [
{ required: true, message: '请输入型号!' },
],
danwei: [
{ required: true, message: '请输入单位!' },
],
// danwei: [
// { required: true, message: '请输入单位!' },
// ],
num: [
{ required: true, message: '请输入数量!' },
],
... ... @@ -183,10 +183,16 @@ export default {
this.visible = true;
this.loadTree()
},
filterOption(input, option) {
return (
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
);
},
loadTree(){
httpAction(this.url.listAllMaterial,null, "get").then((res) => {
if (res.success) {
this.materialOptions = res.result
console.log('materialOptions',this.materialOptions)
} else {
// that.$message.warning(res.message);
}
... ...