|
@@ -75,11 +75,11 @@ export default {
|
|
|
return false;
|
|
|
},
|
|
|
},
|
|
|
- copy:{
|
|
|
- type:Boolean,
|
|
|
- default:() =>{
|
|
|
- return false
|
|
|
- }
|
|
|
+ copy: {
|
|
|
+ type: Boolean,
|
|
|
+ default: () => {
|
|
|
+ return false;
|
|
|
+ },
|
|
|
},
|
|
|
// 需映射源数据
|
|
|
source: Object,
|
|
@@ -134,7 +134,7 @@ export default {
|
|
|
},
|
|
|
// open dialog
|
|
|
async open() {
|
|
|
- if(!this.disabled){
|
|
|
+ if (!this.disabled) {
|
|
|
this.visible = true;
|
|
|
await this.useReset();
|
|
|
}
|
|
@@ -157,19 +157,15 @@ export default {
|
|
|
// 处理新增字段无法映射
|
|
|
let that = this;
|
|
|
|
|
|
- this.TableColumnTemp.forEach(({item,attr}) =>{
|
|
|
-
|
|
|
- that.data = that.data.map(d =>{
|
|
|
-
|
|
|
- if(!attr.is && attr.formatter){
|
|
|
+ this.TableColumnTemp.forEach(({ item, attr }) => {
|
|
|
+ that.data = that.data.map((d) => {
|
|
|
+ if (!attr.is && attr.formatter) {
|
|
|
d[item.key] = attr.formatter(d);
|
|
|
}
|
|
|
|
|
|
return d;
|
|
|
-
|
|
|
- })
|
|
|
-
|
|
|
- })
|
|
|
+ });
|
|
|
+ });
|
|
|
this.page.total = total;
|
|
|
}
|
|
|
} catch (err) {
|
|
@@ -188,6 +184,7 @@ export default {
|
|
|
search: "",
|
|
|
...queryParams(source),
|
|
|
};
|
|
|
+ console.log(source, "source");
|
|
|
await this.fetchList(this.model, this.page);
|
|
|
},
|
|
|
// query
|
|
@@ -204,18 +201,16 @@ export default {
|
|
|
},
|
|
|
// confirm
|
|
|
useConfirm(prop) {
|
|
|
-
|
|
|
const { multiple } = this.$props;
|
|
|
|
|
|
this.selectData = [...prop];
|
|
|
- console.log(this.selectData,'this.selectData');
|
|
|
-
|
|
|
+ console.log(this.selectData, "this.selectData");
|
|
|
+
|
|
|
this.useUpdate(multiple ? prop : prop[0]);
|
|
|
|
|
|
this.emitChange(this.selectData);
|
|
|
this.lastSelectData = deepCopy(this.selectData);
|
|
|
this.hide();
|
|
|
-
|
|
|
},
|
|
|
// delete
|
|
|
useDelete(prop) {
|
|
@@ -270,43 +265,37 @@ export default {
|
|
|
|
|
|
this.model = {
|
|
|
...this.model,
|
|
|
- search:prop,
|
|
|
- type:type,
|
|
|
+ search: prop,
|
|
|
+ type: type,
|
|
|
...queryParams(source),
|
|
|
- }
|
|
|
- //
|
|
|
+ };
|
|
|
+ //
|
|
|
await this.fetchList(this.model, this.page);
|
|
|
await cb(this.data);
|
|
|
} else {
|
|
|
cb([]);
|
|
|
}
|
|
|
},
|
|
|
- async handleChange(){
|
|
|
+ async handleChange() {
|
|
|
// 物料赋值'MATERIAL_PARAM'
|
|
|
const { type, source } = this.$props;
|
|
|
- if(type === 'MATERIAL_PARAM'){
|
|
|
-
|
|
|
+ if (type === "MATERIAL_PARAM") {
|
|
|
let materialCodeList = this.innerValue.split(/,|,|\s+/);
|
|
|
-
|
|
|
+
|
|
|
try {
|
|
|
- let { code, rows } = await REFER( {
|
|
|
+ let { code, rows } = await REFER({
|
|
|
materialCodeList,
|
|
|
- type,
|
|
|
- })
|
|
|
+ type,
|
|
|
+ });
|
|
|
|
|
|
- if(code == 200){
|
|
|
+ if (code == 200) {
|
|
|
// this.$emit("change",rows, type, source);
|
|
|
}
|
|
|
- } catch (error) {
|
|
|
-
|
|
|
- }
|
|
|
+ } catch (error) {}
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- created() {
|
|
|
-
|
|
|
+ },
|
|
|
},
|
|
|
+ created() {},
|
|
|
mounted() {},
|
|
|
destroyed() {},
|
|
|
};
|
|
@@ -325,7 +314,7 @@ export default {
|
|
|
@change="handleChange"
|
|
|
@keyup.enter.native="handleChange"
|
|
|
>
|
|
|
- <!-- suffix -->
|
|
|
+ <!-- suffix -->
|
|
|
<!-- <el-button
|
|
|
:disabled="disabled"
|
|
|
slot="append"
|
|
@@ -370,7 +359,7 @@ export default {
|
|
|
</p>
|
|
|
</template>
|
|
|
</el-autocomplete>
|
|
|
-
|
|
|
+
|
|
|
<el-dialog
|
|
|
:title="`${title}(${multiple ? '多选' : '单选'})`"
|
|
|
:width="width"
|
|
@@ -396,8 +385,12 @@ export default {
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button @click="useQuery" size="mini" >搜 索</el-button>
|
|
|
- <el-button icon="el-icon-refresh" @click="useReset" size="mini"></el-button>
|
|
|
+ <el-button @click="useQuery" size="mini">搜 索</el-button>
|
|
|
+ <el-button
|
|
|
+ icon="el-icon-refresh"
|
|
|
+ @click="useReset"
|
|
|
+ size="mini"
|
|
|
+ ></el-button>
|
|
|
</el-form-item>
|
|
|
<el-table
|
|
|
ref="multipleTable"
|
|
@@ -418,7 +411,7 @@ export default {
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- v-for="({item,attr}, index) in TableColumnTemp"
|
|
|
+ v-for="({ item, attr }, index) in TableColumnTemp"
|
|
|
:key="index"
|
|
|
:prop="item.key"
|
|
|
:label="item.title"
|
|
@@ -452,7 +445,6 @@ export default {
|
|
|
<el-button :size="size" @click="useCancel(lastSelectData)">
|
|
|
取 消
|
|
|
</el-button>
|
|
|
-
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<div
|