更新代码

This commit is contained in:
‘937886381’
2023-06-28 14:21:52 +08:00
parent 6489dcc55c
commit 460cca785b
12 changed files with 923 additions and 215 deletions

View File

@@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-02-14 15:02:26
* @LastEditTime: 2023-03-29 09:09:20
* @LastEditTime: 2023-06-26 09:44:09
* @LastEditors: zhp
* @Description:
-->
@@ -16,14 +16,21 @@
<el-form-item prop="specification" :label="$t('basic.specification')">
<el-input v-model="dataForm.specification" :placeholder="$t('basic.specification')"></el-input>
</el-form-item>
<el-form-item prop="controlName" :label="$t('basic.name')">
<el-input v-model="dataForm.controlName" :placeholder="$t('basic.name')"></el-input>
<el-form-item prop="incomingInspection" :label="$t('basic.stock')">
<el-switch v-model="dataForm.incomingInspection" :active-value="1" :inactive-value="0">
</el-switch>
</el-form-item>
<el-form-item prop="controlName" :label="$t('basic.name')">
<el-input v-model="dataForm.controlName" :placeholder="$t('basic.name')"></el-input>
<el-form-item prop="finishInspection" :label="$t('basic.stock')">
<el-switch v-model="dataForm.finishInspection" :active-value="1" :inactive-value="0">
</el-switch>
</el-form-item>
<el-form-item prop="controlName" :label="$t('basic.name')">
<el-input v-model="dataForm.controlName" :placeholder="$t('basic.name')"></el-input>
<el-form-item prop="outInspection" :label="$t('basic.shipment')">
<el-switch v-model="dataForm.outInspection" :active-value="1" :inactive-value="0">
</el-switch>
</el-form-item>
<el-form-item prop="processInspection" :label="$t('basic.course')">
<el-switch v-model="dataForm.processInspection" :active-value="1" :inactive-value="0">
</el-switch>
</el-form-item>
<el-form-item prop="customerTypeStatus" :label="$t('basic.status')">
<el-select v-model="dataForm.customerTypeStatus" :placeholder="$t('basic.status')">
@@ -59,7 +66,11 @@ export default {
id: "",
controlCode:null,
controlName:null,
customerTypeStatus:null
customerTypeStatus: null,
finishInspection: null,
incomingInspection: null,
outInspection: null,
processInspection: null,
},
};
},

View File

@@ -7,16 +7,10 @@
-->
<template>
<span>
<el-radio v-model="injectData.incomingInspection" :label="1"
>进货检验</el-radio
>
<el-radio v-model="injectData.processInspection" :label="1"
>过程检验</el-radio
>
<el-radio v-model="injectData.finishInspection" :label="1"
>成品检验</el-radio
>
<el-radio v-model="injectData.outInspection" :label="1">出货检验</el-radio>
<el-radio v-model="injectData.incomingInspection" :label="1">{{ $t('basic.stock') }}</el-radio>
<el-radio v-model="injectData.processInspection" :label="1">{{ $t('basic.course') }}</el-radio>
<el-radio v-model="injectData.finishInspection" :label="1">{{ $t('basic.finishedProduct') }}</el-radio>
<el-radio v-model="injectData.outInspection" :label="1">{{ $t('basic.shipment') }}</el-radio>
</span>
</template>

View File

@@ -0,0 +1,218 @@
<!--
* @Author: zhp
* @Date: 2023-02-14 15:02:26
* @LastEditTime: 2023-06-26 15:01:44
* @LastEditors: zhp
* @Description:
-->
<template>
<el-transfer v-model="chooseData" :titles="['用户列表', '团队成员']" :data="notChooseData"></el-transfer>
</template>
<script>
import debounce from "lodash/debounce";
import basicAdd from "@/mixins/basic-add";
export default {
mixins: [basicAdd],
data() {
// const generateData = _ => {
// const data = [];
// const cities = ['上海', '北京', '广州', '深圳', '南京', '西安', '成都'];
// const pinyin = ['shanghai', 'beijing', 'guangzhou', 'shenzhen', 'nanjing', 'xian', 'chengdu'];
// cities.forEach((city, index) => {
// data.push({
// label: city,
// key: index,
// pinyin: pinyin[index]
// });
// });
// return data;
// }
return {
notChooseData:[],
chooseData: [],
urlOptions: {
submitURL: "/basic/qmsCustomer",
getCustomerPageListURL: "/basic/qmsCustomerType/page",
infoURL: "/basic/qmsCustomer/{id}",
getCodeURL: '/basic/qmsCustomer/getCode',
getTeamMemberURL: '/basic/qmsTeamMember/page',
getUserListURL: '/sys/user/page',
editTeamMemberListURL: '/basic/qmsTeamMember'
},
options: [{
value: 0,
label: '不可用'
},
{
value: 1,
label: '可用'
}],
listQuery: {
limit: 999,
page:1
},
visible: false,
customerTypeList: {},
teamId: null,
};
},
computed: {
dataRule() {
return {
// dictLabel: [
// {
// required: true,
// message: this.$t("validate.required"),
// trigger: "blur",
// },
// ],
// dictValue: [
// {
// required: true,
// message: this.$t("validate.required"),
// trigger: "blur",
// },
// ],
// sort: [
// {
// required: true,
// message: this.$t("validate.required"),
// trigger: "blur",
// },
// ],
};
},
},
methods: {
init(id,) {
this.teamId = id || ""
// this.dataForm.dictTypeId = dictTypeId || "";
this.$http
.get(this.urlOptions.getTeamMemberURL, {
params: {
limit: 999,
page: 1,
teamId: id
}
})
.then(({ data: res }) => {
// this.dataListLoading = false;
if (res.code === 0) {
if (res.data.list.length > 0) {
var data = res.data.list
for (let i = 0; i < data.length; i++) {
this.chooseData.push(data[i].userId)
}
}
}
})
this.$http
.get(this.urlOptions.getUserListURL, {
params: {
limit: 999,
page: 1,
}
})
.then(({ data: res }) => {
// this.dataListLoading = false;
if (res.code === 0) {
this.notChooseData = res.data.list.map((item) => {
return {
key: item.id,
label: item.username
}
})
}
})
this.visible = true;
// this.$nextTick(() => {
// // this.$refs["dataForm"].resetFields();
// if (this.dataForm.id) {
// // console.log(1111);
// this.getInfo();
// } else {
// this.getCode()
// }
// });
},
// getCode() {
// // console.log(111111);
// this.$http
// .post(this.urlOptions.getCodeURL)
// .then(({ data: res }) => {
// if (res.code === 0) {
// console.log(res);
// this.dataForm.customerCode = res.data
// }
// })
// .catch(() => {
// });
// },
// 获取信息
// getInfo() {
// this.$http
// .get(`/basic/qmsCustomer/${this.dataForm.id}`)
// .then(({ data: res }) => {
// if (res.code !== 0) {
// return this.$message.error(res.msg);
// }
// this.dataForm = {
// ...this.dataForm,
// ...res.data,
// };
// })
// .catch(() => { });
// },
// 表单提交
dataFormSubmit() {
let ids = this.chooseData
ids.unshift(this.teamId)
this.$http.put(this.urlOptions.editTeamMemberListURL,ids)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.$message({
message: this.$t("prompt.success"),
type: "success",
duration: 500,
onClose: () => {
this.visible = false
this.$emit("refreshDataList")
},
});
})
.catch(() => { })
},
// dataFormSubmitHandle: debounce(
// function () {
// this.$refs["dataForm"].validate((valid) => {
// if (!valid) {
// return false;
// }
// this.$http[!this.dataForm.id ? "post" : "put"](this.urlOptions.submitURL, this.dataForm)
// .then(({ data: res }) => {
// if (res.code !== 0) {
// return this.$message.error(res.msg);
// }
// this.$message({
// message: this.$t("prompt.success"),
// type: "success",
// duration: 500,
// onClose: () => {
// this.visible = false;
// console.log(1111);
// this.$emit("successSubmit");
// },
// });
// })
// .catch(() => { });
// });
// },
// 1000,
// { leading: true, trailing: false }
// ),
},
};
</script>

View File

@@ -223,7 +223,7 @@ export default {
})
.catch(() => { });
} else if (val.type === 'edit') {
this.addOrUpdateVisible = true
this.addOrUpdateVisible = true
this.addOrEditTitle = this.$t('edit')
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);

View File

@@ -16,7 +16,7 @@
<!-- 弹窗, 新增 / 修改 -->
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" @cancel="handleCancel"
@confirm="handleConfirm" :before-close="handleCancel">
<customer-type-add ref="addOrUpdate" @successSubmit="successSubmit"></customer-type-add>
<customer-type-add ref="addOrUpdate" @refreshDataList="successSubmit"></customer-type-add>
<!-- <el-row slot="footer" type="flex" justify="end"> </el-row> -->
</base-dialog>
<base-dialog :dialogTitle="searchOrEditTitle" :dialogVisible="searchOrUpdateVisible" @cancel="handleSearchCancel"

View File

@@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-02-21 14:30:17
* @LastEditTime: 2023-06-20 15:37:17
* @LastEditTime: 2023-06-26 15:32:36
* @LastEditors: zhp
* @Description:
-->
@@ -15,8 +15,8 @@
<el-button type="primary" size="small" @click="conditionSearch">{{ $t("conditionSearch")}}}</el-button>
</el-badge>
</SearchBar>
<base-table id="palletTable" :table-props="tableProps" :page="listQuery.page" ref="palletTable1"
:limit="listQuery.limit" :table-data="tableData">
<base-table highlight-current-row id="palletTable" :table-props="tableProps" :page="listQuery.page"
@current-change="handleCurrentChange" ref="palletTable1" :limit="listQuery.limit" :table-data="tableData">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="100" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
@@ -49,23 +49,18 @@
</el-col>
<el-col :span="10">
<div class="mod-sys__user">
<SearchBar :formConfigs="formConfigMember" ref="ruleForm" @headBtnClick="buttonClick">
<SearchBar :formConfigs="formConfigMember" ref="ruleForm" @headBtnClick="teamMemberButtonClick">
</SearchBar>
<base-table id="palletTable" :table-props="tableProps" :page="listQuery.page" ref="palletTable1"
:limit="listQuery.limit" :table-data="tableData">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="100" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" />
<base-table id="palletTable" :table-props="depProps" ref="palletTable1" :table-data="teamMemberData">
</base-table>
<pagination :limit.sync="listQuery.limit" :page.sync="listQuery.page" :total="listQuery.total"
@pagination="getDataList" />
<!-- 弹窗, 新增 / 修改 -->
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" @cancel="handleCancel"
@confirm="handleConfirm" :before-close="handleCancel">
<team-add ref="addOrUpdate" @refreshDataList="successSubmit"></team-add>
<base-dialog :dialogTitle="teamMemberOrEditTitle" :dialogVisible="teamMemberOrUpdateVisible"
@cancel="handleTeamMemberCancel" @confirm="handleTeamMemberConfirm" :before-close="handleTeamMemberCancel">
<teamMember-add ref="teamMemberOrUpdate" @refreshDataList="successTeamMemberSubmit"></teamMember-add>
<!-- <el-row slot="footer" type="flex" justify="end"> </el-row> -->
</base-dialog>
</div>
</el-col>""
</el-col>""
</el-row>
</el-card>
</template>
@@ -74,12 +69,12 @@
import basicPage from "@/mixins/basic-page";
import basicSearch from "@/mixins/basic-search";
import teamAdd from "./components/team-add";
import teamMemberAdd from './components/teamMember-add'
import teamSearch from "./components/teamSearch.vue";
import Cookies from 'js-cookie'
import qs from 'qs'
// import radio from "./components/radio.vue";
import i18n from "@/i18n";
// import i18n from "@/i18n";
const tableProps = [
{
prop: "teamCode",
@@ -98,6 +93,16 @@ const tableProps = [
label: i18n.t('basic.remark')
},
];
const depProps = [
{
prop: "departName",
label: i18n.t('basic.departName')
},
{
prop: "userName",
label: i18n.t('basic.userName')
}
];
const tableBtn = [
{
type: "edit",
@@ -116,11 +121,17 @@ export default {
getDataListURL: "/basic/qmsTeam/page",
deleteURL: "/basic/qmsTeam",
exportURL: "/basic/qmsTeam/export",
teamMemberURL: '/basic/qmsTeamMember/page'
},
tableProps,
depProps,
teamId:null,
teamMemberData: [],
teamMemberOrEditTitle:'',
tableBtn,
productData: {},
addOrUpdateVisible: false,
teamMemberOrUpdateVisible:false,
searchOrEditTitle: "",
addOrEditTitle: '',
searchOrUpdateVisible: false,
@@ -156,7 +167,14 @@ export default {
name: i18n.t('export'),
color: "primary",
// plain: true,
}
},
{
type: "button",
btnName: "取消选中",
name: "cancel",
color: "primary",
// plain: true,
},
],
formConfigMember: [
// {
@@ -180,14 +198,37 @@ export default {
},
components: {
teamAdd,
teamMemberAdd,
teamSearch
},
// mounted() {
// this.getDepData()
// },
methods: {
//search-bar点击
handleProductCancel() {
this.productOrUpdateVisible = false;
this.productOrEditTitle = "";
},
setCurrent(index) {
this.$refs.palletTable1.setCurrent("palletTable", index)
console.log(index)
},
handleCurrentChange(val) {
this.teamId = val.newVal.id
this.$http.get(this.urlOptions.teamMemberURL, {
params: {
limit: 999,
page: 1,
teamId:val.newVal.id
}
}).then(({ data: res } ) => {
console.log(res)
if (res && res.code === 0) {
this.teamMemberData = res.data.list
}
})
},
// handleSearchCancel() {
// this.searchOrEditTitle = "";
// this.searchOrUpdateVisible = false;
@@ -268,7 +309,7 @@ export default {
} else {
this.$message.error(data.msg);
}
});
})
})
.catch(() => { });
} else if (val.type === 'edit') {
@@ -279,6 +320,41 @@ export default {
});
}
},
successTeamMemberSubmit() {
this.handleTeamMemberCancel()
this.$http.get(this.urlOptions.teamMemberURL, {
params: {
limit: 999,
page: 1,
teamId: this.teamId
}
}).then(({ data: res } ) => {
if (res && res.code === 0) {
this.teamMemberData = res.data.list
}
});
},
handleTeamMemberCancel() {
this.teamMemberOrUpdateVisible = false
this.teamMemberOrEditTitle = ''
},
teamMemberButtonClick(val) {
console.log(val);
switch (val.btnName) {
case "change":
this.teamMemberOrEditTitle = '修改团队成员'
this.teamMemberOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.teamMemberOrUpdate.init(this.teamId)
});
break;
default:
console.log(val);
}
},
handleTeamMemberConfirm() {
this.$refs.teamMemberOrUpdate.dataFormSubmit()
},
buttonClick(val) {
console.log(val);
switch (val.btnName) {
@@ -301,6 +377,9 @@ export default {
this.$refs.addOrUpdate.init();
});
break;
case "cancel":
this.$refs.palletTable1.setCurrent("palletTable", -1);
break;
// case "correlation":
// this.productOrEditTitle = "产品";
// this.productOrUpdateVisible = true;

View File

@@ -1,50 +1,26 @@
<!--
* @Author: zhp
* @Date: 2023-01-11 09:24:58
* @LastEditTime: 2023-01-12 09:46:23
* @LastEditTime: 2023-06-26 13:39:19
* @LastEditors: zhp
* @Description:
-->
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__user">
<SearchBar
:formConfigs="formConfig"
ref="ruleForm"
@headBtnClick="buttonClick"
>
<el-button type="primary" size="small" plain>导入</el-button>
</SearchBar>
<base-table
:table-props="tableProps"
:page="listQuery.page"
:limit="listQuery.limit"
:table-data="tableData"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
<SearchBar :formConfigs="formConfig" ref="ruleForm" @headBtnClick="buttonClick">
<!-- <el-button type="primary" size="small" plain>导入</el-button> -->
</SearchBar>
<base-table :table-props="tableProps" :page="listQuery.page" :limit="listQuery.limit" :table-data="tableData">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="100" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.limit"
:page.sync="listQuery.page"
:total="listQuery.total"
@pagination="getDataList"
/>
<pagination :limit.sync="listQuery.limit" :page.sync="listQuery.page" :total="listQuery.total"
@pagination="getDataList" />
<!-- 弹窗, 新增 / 修改 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<!-- <add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update> -->
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" @cancel="handleCancel"
@confirm="handleConfirm" :before-close="handleCancel">
<teamMember-add ref="addOrUpdate" @successSubmit="successSubmit"></teamMember-add>
</base-dialog>
</div>
</el-card>
@@ -52,7 +28,7 @@
<script>
import basicPage from "@/mixins/basic-page";
// import AddOrUpdate from './params-add-or-update'
import teamMemberAdd from './components/teamMember-add'
import i18n from "@/i18n";
const tableProps = [
{
@@ -83,7 +59,7 @@ export default {
data() {
return {
urlOptions: {
getDataListURL: "/basic/qmsControlMode/page",
getDataListURL: "/basic/qmsTeamMember/page",
deleteURL: "/basic/qmsControlMode",
},
tableProps,
@@ -103,14 +79,13 @@ export default {
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
],
};
},
// components: {
// AddOrUpdate,
// },
components: {
teamMemberAdd,
},
methods:{
//search-bar点击
buttonClick(val) {