提交代码
This commit is contained in:
41
src/views/modules/supplier/components/available.vue
Normal file
41
src/views/modules/supplier/components/available.vue
Normal file
@@ -0,0 +1,41 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-01-31 09:49:36
|
||||
* @LastEditTime: 2023-04-17 10:59:15
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<span>
|
||||
<el-tag v-if="injectData.supplierTypeStatus === 1" type="success">可用</el-tag>
|
||||
<el-tag v-else type="warning">不可用</el-tag>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { addDynamicRoute } from '@/router'
|
||||
export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 子级
|
||||
// emitClick () {
|
||||
// // 路由参数
|
||||
// const routeParams = {
|
||||
// routeName: `${this.$route.name}__${this.injectData.id}`,
|
||||
// title: `${this.$route.meta.title} - ${this.injectData.dictType}`,
|
||||
// path: 'sys/dict-data',
|
||||
// params: {
|
||||
// dictTypeId: this.injectData.id
|
||||
// }
|
||||
// }
|
||||
// // 动态路由
|
||||
// addDynamicRoute(routeParams, this.$router)
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
233
src/views/modules/supplier/components/evaluationTask-add.vue
Normal file
233
src/views/modules/supplier/components/evaluationTask-add.vue
Normal file
@@ -0,0 +1,233 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-02-14 15:02:26
|
||||
* @LastEditTime: 2023-04-19 15:29:42
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form :model="dataForm" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form-item prop="evaluationTemplateId" :label="$t('supplier.evaluationTemplateName')">
|
||||
<el-select v-model="dataForm.evaluationTemplateId" :placeholder="$t('supplier.evaluationTemplateName')"
|
||||
@change="getProductCode">
|
||||
<el-option v-for="item in templateList" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="evaluationType" :label="$t('supplier.evaluationType')">
|
||||
<el-select v-model="dataForm.evaluationType" :placeholder="$t('supplier.evaluationType')">
|
||||
<el-option v-for="item in evaluationTypeList" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="title" :label="$t('supplier.title')">
|
||||
<el-input v-model="dataForm.title" :placeholder="$t('supplier.title')">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="description" :label="$t('supplier.description')">
|
||||
<el-input v-model="dataForm.description" :placeholder="$t('supplier.description')">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="startTime" :label="$t('supplier.startTime')">
|
||||
<el-date-picker v-model="dataForm.startTime" type="datetime" format='yyyy-MM-dd HH:mm:ss'
|
||||
valueFormat='yyyy-MM-ddTHH:mm:ss' :placeholder="$t('supplier.startTime')">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item prop="evaluationPeriod" :label="$t('supplier.evaluationPeriod')">
|
||||
<el-date-picker v-model="dataForm.evaluationPeriod" type="datetime" format='yyyy-MM-dd HH:mm:ss'
|
||||
valueFormat='yyyy-MM-ddTHH:mm:ss' :placeholder="$t('supplier.evaluationPeriod')">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import debounce from "lodash/debounce";
|
||||
import basicAdd from "@/mixins/basic-add";
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
templateList:[],
|
||||
urlOptions: {
|
||||
submitURL: "/supplier/qmsEvaluationTask",
|
||||
infoURL: "/supplier/qmsEvaluationTask/{id}",
|
||||
getSupplierListURL: '/supplier/qmsSupplier/page',
|
||||
getTemplateListURL: '/supplier/qmsEvaluationTask/page'
|
||||
},
|
||||
options: [{
|
||||
value: 0,
|
||||
label: '不可用'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '可用'
|
||||
}],
|
||||
supplierList:null,
|
||||
enterpriseNatureList: [
|
||||
{
|
||||
value: 0,
|
||||
label: '私营'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '国有'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '外资'
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '其他'
|
||||
}
|
||||
],
|
||||
evaluationTypeList: [
|
||||
{
|
||||
id: 0,
|
||||
name: '年度'
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
name: '1季度'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '月度'
|
||||
}
|
||||
],
|
||||
supplierTypeList: [],
|
||||
productList:[],
|
||||
visible: false,
|
||||
listQuery: {
|
||||
limit: 999,
|
||||
page:1
|
||||
},
|
||||
dataForm: {
|
||||
id: "",
|
||||
title: null,
|
||||
supplierId: null,
|
||||
evaluationPeriod:null,
|
||||
evaluationType:null,
|
||||
evaluationTemplateId: null,
|
||||
startTime: null,
|
||||
description: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: {
|
||||
getProductCode(val) {
|
||||
this.productList.forEach(ele => {
|
||||
if (val === ele.id) {
|
||||
this.dataForm.productCode = ele.productCode
|
||||
}
|
||||
});
|
||||
},
|
||||
init(id, ) {
|
||||
this.dataForm.id = id || ""
|
||||
// this.dataForm.dictTypeId = dictTypeId || "";
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs["dataForm"].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.getInfo();
|
||||
} else {
|
||||
this.getCode()
|
||||
}
|
||||
});
|
||||
},
|
||||
getCode() {
|
||||
this.$http
|
||||
.get(this.urlOptions.getSupplierListURL, { params: this.listQuery })
|
||||
.then(({ data: res }) => {
|
||||
if (res.code === 0) {
|
||||
console.log(res.data);
|
||||
this.supplierList = res.data.list
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
})
|
||||
this.$http
|
||||
.get(this.urlOptions.getTemplateListURL, { params: this.listQuery })
|
||||
.then(({ data: res }) => {
|
||||
if (res.code === 0) {
|
||||
console.log(res.data);
|
||||
this.templateList = res.data.list
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
})
|
||||
},
|
||||
// 获取信息
|
||||
getInfo() {
|
||||
this.$http
|
||||
.get(`/supplier/qmsEvaluationTask/${this.dataForm.id}`)
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.dataForm = {
|
||||
...this.dataForm,
|
||||
...res.data,
|
||||
};
|
||||
})
|
||||
.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
|
||||
this.$emit("successSubmit")
|
||||
},
|
||||
})
|
||||
})
|
||||
.catch(() => {});
|
||||
});
|
||||
},
|
||||
1000,
|
||||
{ leading: true, trailing: false }
|
||||
),
|
||||
},
|
||||
};
|
||||
</script>
|
||||
78
src/views/modules/supplier/components/innerTable.vue
Normal file
78
src/views/modules/supplier/components/innerTable.vue
Normal file
@@ -0,0 +1,78 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-04-18 09:19:02
|
||||
* @LastEditTime: 2023-04-18 14:24:53
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-popover placement="right" width="400" trigger="click">
|
||||
<base-table id="palletTable" :table-props="tableProps" ref="palletTable1"
|
||||
:table-data="tableData" >
|
||||
</base-table>
|
||||
<i slot="reference" class="el-icon-plus" @click="showInnerTable(injectData.id)"/>
|
||||
</el-popover>
|
||||
</template>
|
||||
<script>
|
||||
import i18n from "@/i18n"
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "contact",
|
||||
label: i18n.t('supplier.contact'),
|
||||
},
|
||||
{
|
||||
prop: "contactEmail",
|
||||
label: i18n.t('supplier.contactEmail')
|
||||
},
|
||||
{
|
||||
prop: "contactPhone",
|
||||
label: i18n.t('supplier.contactPhone')
|
||||
},
|
||||
{
|
||||
prop: "enterpriseNature",
|
||||
label: i18n.t('supplier.enterpriseNature')
|
||||
},
|
||||
{
|
||||
prop: "industry",
|
||||
label: i18n.t('supplier.industry')
|
||||
},
|
||||
{
|
||||
prop: "productService",
|
||||
label: i18n.t('supplier.productService')
|
||||
}
|
||||
];
|
||||
export default {
|
||||
name: 'InnerTable',
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
itemProp: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableProps,
|
||||
list: this.injectData,
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showInnerTable(id) {
|
||||
console.log(id)
|
||||
this.tableData = [
|
||||
{
|
||||
contact: this.injectData.contact,
|
||||
contactEmail: this.injectData.contactEmail,
|
||||
contactPhone: this.injectData.contactPhone,
|
||||
enterpriseNature: this.injectData.enterpriseNature,
|
||||
industry: this.injectData.industry,
|
||||
productService: this.injectData.productService
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
45
src/views/modules/supplier/components/inputArea.vue
Normal file
45
src/views/modules/supplier/components/inputArea.vue
Normal file
@@ -0,0 +1,45 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-04-18 09:11:41
|
||||
* @LastEditTime: 2023-04-18 09:11:41
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="tableInner">
|
||||
<el-input v-model="list[itemProp]" @blur="changeInput" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'InputArea',
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
itemProp: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: this.injectData
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeInput() {
|
||||
console.log(this.list)
|
||||
this.$emit('emitData', this.list)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="css">
|
||||
.tableInner .el-input__inner {
|
||||
border: none;
|
||||
padding: 0;
|
||||
height: 33px;
|
||||
}
|
||||
</style>
|
||||
68
src/views/modules/supplier/components/planBtn.vue
Normal file
68
src/views/modules/supplier/components/planBtn.vue
Normal file
@@ -0,0 +1,68 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-01-31 09:49:36
|
||||
* @LastEditTime: 2023-04-04 14:56:08
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<span>
|
||||
<el-button type="text" @click="emitClick()">同步所有关联产品</el-button>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { addDynamicRoute } from '@/router'
|
||||
export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
syncURL: "/basic/qmsProduct/connectAllProduct"
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 子级
|
||||
emitClick() {
|
||||
const data = {
|
||||
id: this.injectData.id,
|
||||
finishInspection: this.injectData.finishInspection,
|
||||
incomingInspection: this.injectData.incomingInspection,
|
||||
outInspection: this.injectData.outInspection,
|
||||
processInspection: this.injectData.outInspection
|
||||
}
|
||||
this.$http.put(this.urlOptions.syncURL, { data }).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
// 路由参数
|
||||
// const routeParams = {
|
||||
// routeName: `${this.$route.name}__${this.injectData.id}`,
|
||||
// title: `${this.$route.meta.title} - ${this.injectData.dictType}`,
|
||||
// path: 'sys/dict-data',
|
||||
// params: {
|
||||
// dictTypeId: this.injectData.id
|
||||
// }
|
||||
// }
|
||||
// 动态路由
|
||||
// addDynamicRoute(routeParams, this.$router)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
221
src/views/modules/supplier/components/poorLaunch-add.vue
Normal file
221
src/views/modules/supplier/components/poorLaunch-add.vue
Normal file
@@ -0,0 +1,221 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-02-14 15:02:26
|
||||
* @LastEditTime: 2023-04-19 14:20:14
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form :model="dataForm" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form-item prop="productId" :label="$t('supplier.materialName')">
|
||||
<el-select v-model="dataForm.productId" :placeholder="$t('supplier.materialName')" @change="getProductCode">
|
||||
<el-option v-for="item in productList" :key="item.id" :label="item.productName" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="productCode" :label="$t('supplier.materialCode')">
|
||||
<el-input v-model="dataForm.productCode" :placeholder="$t('supplier.materialCode')" disabled>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="supplierId" :label="$t('supplier.supplierName')">
|
||||
<el-select v-model="dataForm.supplierId" :placeholder="$t('supplier.supplierName')">
|
||||
<el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="supplierBatch" :label="$t('supplier.supplierBatch')">
|
||||
<el-input v-model="dataForm.supplierBatch" :placeholder="$t('supplier.supplierBatch')">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="offlineTime" :label="$t('supplier.offlineTime')">
|
||||
<el-date-picker v-model="dataForm.offlineTime" type="datetime" format='yyyy-MM-dd HH:mm:ss'
|
||||
valueFormat='yyyy-MM-ddTHH:mm:ss' :placeholder="$t('supplier.offlineTime')">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item prop="defectiveQuantity" :label="$t('supplier.defectiveQuantity')">
|
||||
<el-input v-model="dataForm.defectiveQuantity" :placeholder="$t('supplier.defectiveQuantity')">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="undesirablePhenomena" :label="$t('supplier.undesirablePhenomena')">
|
||||
<el-input v-model="dataForm.undesirablePhenomena" :placeholder="$t('supplier.undesirablePhenomena')">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import debounce from "lodash/debounce";
|
||||
import basicAdd from "@/mixins/basic-add";
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
submitURL: "/supplier/qmsPoorLaunch",
|
||||
infoURL: "/supplier/qmsPoorLaunch/{id}",
|
||||
getProductListURL: '/basic/qmsProduct/page',
|
||||
getSupplierListURL: '/supplier/qmsSupplier/page'
|
||||
},
|
||||
options: [{
|
||||
value: 0,
|
||||
label: '不可用'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '可用'
|
||||
}],
|
||||
supplierList:null,
|
||||
enterpriseNatureList: [
|
||||
{
|
||||
value: 0,
|
||||
label: '私营'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '国有'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '外资'
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '其他'
|
||||
}
|
||||
],
|
||||
|
||||
supplierTypeList: [],
|
||||
productList:[],
|
||||
visible: false,
|
||||
listQuery: {
|
||||
limit: 999,
|
||||
page:1
|
||||
},
|
||||
dataForm: {
|
||||
id: "",
|
||||
productId: null,
|
||||
supplierId: null,
|
||||
supplierBatch:null,
|
||||
productCode:null,
|
||||
offlineTime: null,
|
||||
defectiveQuantity: null,
|
||||
undesirablePhenomena: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: {
|
||||
getProductCode(val) {
|
||||
this.productList.forEach(ele => {
|
||||
if (val === ele.id) {
|
||||
this.dataForm.productCode = ele.productCode
|
||||
}
|
||||
});
|
||||
},
|
||||
init(id, ) {
|
||||
this.dataForm.id = id || ""
|
||||
// this.dataForm.dictTypeId = dictTypeId || "";
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs["dataForm"].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.getInfo();
|
||||
} else {
|
||||
this.getCode()
|
||||
}
|
||||
});
|
||||
},
|
||||
getCode() {
|
||||
this.$http
|
||||
.get(this.urlOptions.getSupplierListURL, { params: this.listQuery })
|
||||
.then(({ data: res }) => {
|
||||
if (res.code === 0) {
|
||||
console.log(res.data);
|
||||
this.supplierList = res.data.list
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
})
|
||||
this.$http
|
||||
.get(this.urlOptions.getProductListURL, { params: this.listQuery })
|
||||
.then(({ data: res }) => {
|
||||
if (res.code === 0) {
|
||||
this.productList = res.data.list
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
})
|
||||
},
|
||||
// 获取信息
|
||||
getInfo() {
|
||||
this.$http
|
||||
.get(`/supplier/qmsPoorLaunch/${this.dataForm.id}`)
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.dataForm = {
|
||||
...this.dataForm,
|
||||
...res.data,
|
||||
};
|
||||
})
|
||||
.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: () => {
|
||||
console.log(1111);
|
||||
this.visible = false;
|
||||
this.$emit("successSubmit");
|
||||
},
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
});
|
||||
},
|
||||
1000,
|
||||
{ leading: true, trailing: false }
|
||||
),
|
||||
},
|
||||
};
|
||||
</script>
|
||||
251
src/views/modules/supplier/components/qualityAccident-add.vue
Normal file
251
src/views/modules/supplier/components/qualityAccident-add.vue
Normal file
@@ -0,0 +1,251 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-02-14 15:02:26
|
||||
* @LastEditTime: 2023-04-18 15:40:53
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form :model="dataForm" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form-item prop="productId" :label="$t('supplier.materialName')">
|
||||
<el-select v-model="dataForm.productId" :placeholder="$t('supplier.materialName')" @change="getProductCode">
|
||||
<el-option v-for="item in productList" :key="item.id" :label="item.productName" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="productCode" :label="$t('supplier.materialCode')">
|
||||
<el-input v-model="dataForm.productCode" :placeholder="$t('supplier.materialCode')" disabled>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="supplierId" :label="$t('supplier.supplierName')">
|
||||
<el-select v-model="dataForm.supplierId" :placeholder="$t('supplier.supplierName')">
|
||||
<el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="problemBatch" :label="$t('supplier.problemBatch')">
|
||||
<el-input v-model="dataForm.problemBatch" :placeholder="$t('supplier.problemBatch')">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="applicationDate" :label="$t('supplier.applicationDate')">
|
||||
<el-date-picker v-model="dataForm.applicationDate" type="datetime" format='yyyy-MM-dd HH:mm:ss'
|
||||
valueFormat='yyyy-MM-ddTHH:mm:ss' :placeholder="$t('supplier.applicationDate')">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item prop="lostHour" :label="$t('supplier.lostHour')">
|
||||
<el-input v-model="dataForm.lostHour" :placeholder="$t('supplier.lostHour')">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="place" :label="$t('supplier.place')">
|
||||
<el-input v-model="dataForm.place" :placeholder="$t('supplier.place')">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="causeAnalysis" :label="$t('supplier.causeAnalysis')">
|
||||
<el-input v-model="dataForm.causeAnalysis" :placeholder="$t('supplier.causeAnalysis')">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="everlastMeasures" :label="$t('supplier.everlastMeasures')">
|
||||
<el-input v-model="dataForm.everlastMeasures" :placeholder="$t('supplier.everlastMeasures')">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="interimMeasures" :label="$t('supplier.interimMeasures')">
|
||||
<el-input v-model="dataForm.interimMeasures" :placeholder="$t('supplier.interimMeasures')">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="problemDescription" :label="$t('supplier.problemDescription')">
|
||||
<el-input v-model="dataForm.problemDescription" :placeholder="$t('supplier.problemDescription')">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="closedLoop" :label="$t('supplier.closedLoop')">
|
||||
<el-switch v-model="dataForm.closedLoop" :active-value="1"
|
||||
:inactive-value="0">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item prop="rejectionRate" :label="$t('supplier.rejectionRate')">
|
||||
<el-input v-model="dataForm.rejectionRate" :placeholder="$t('supplier.rejectionRate')">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import debounce from "lodash/debounce";
|
||||
import basicAdd from "@/mixins/basic-add";
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
submitURL: "/supplier/qmsQualityAccident",
|
||||
infoURL: "/supplier/qmsQualityAccident/{id}",
|
||||
getProductListURL: '/basic/qmsProduct/page',
|
||||
getSupplierListURL: '/supplier/qmsSupplier/page'
|
||||
},
|
||||
options: [{
|
||||
value: 0,
|
||||
label: '不可用'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '可用'
|
||||
}],
|
||||
supplierList:null,
|
||||
enterpriseNatureList: [
|
||||
{
|
||||
value: 0,
|
||||
label: '私营'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '国有'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '外资'
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '其他'
|
||||
}
|
||||
],
|
||||
|
||||
supplierTypeList: [],
|
||||
productList:[],
|
||||
visible: false,
|
||||
listQuery: {
|
||||
limit: 999,
|
||||
page:1
|
||||
},
|
||||
dataForm: {
|
||||
id: "",
|
||||
productId: null,
|
||||
supplierId: null,
|
||||
applicationDate:null,
|
||||
causeAnalysis:null,
|
||||
closedLoop: null,
|
||||
everlastMeasures: null,
|
||||
interimMeasures:null,
|
||||
lostHour: null,
|
||||
place: null,
|
||||
problemBatch: null,
|
||||
problemDescription: null,
|
||||
rejectionRate: 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: {
|
||||
getProductCode(val) {
|
||||
this.productList.forEach(ele => {
|
||||
if (val === ele.id) {
|
||||
this.dataForm.productCode = ele.productCode
|
||||
}
|
||||
});
|
||||
},
|
||||
init(id, ) {
|
||||
this.dataForm.id = id || ""
|
||||
// this.dataForm.dictTypeId = dictTypeId || "";
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs["dataForm"].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.getInfo();
|
||||
} else {
|
||||
this.getCode()
|
||||
}
|
||||
});
|
||||
},
|
||||
getCode() {
|
||||
this.$http
|
||||
.get(this.urlOptions.getSupplierListURL, { params: this.listQuery })
|
||||
.then(({ data: res }) => {
|
||||
if (res.code === 0) {
|
||||
console.log(res.data);
|
||||
this.supplierList = res.data.list
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
})
|
||||
this.$http
|
||||
.get(this.urlOptions.getProductListURL, { params: this.listQuery })
|
||||
.then(({ data: res }) => {
|
||||
if (res.code === 0) {
|
||||
this.productList = res.data.list
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
})
|
||||
},
|
||||
// 获取信息
|
||||
getInfo() {
|
||||
this.$http
|
||||
.get(`/supplier/qmsQualityAccident/${this.dataForm.id}`)
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.dataForm = {
|
||||
...this.dataForm,
|
||||
...res.data,
|
||||
};
|
||||
})
|
||||
.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: () => {
|
||||
console.log(1111);
|
||||
this.visible = false;
|
||||
this.$emit("successSubmit");
|
||||
},
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
});
|
||||
},
|
||||
1000,
|
||||
{ leading: true, trailing: false }
|
||||
),
|
||||
},
|
||||
};
|
||||
</script>
|
||||
49
src/views/modules/supplier/components/radio.vue
Normal file
49
src/views/modules/supplier/components/radio.vue
Normal file
@@ -0,0 +1,49 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-01-31 14:12:10
|
||||
* @LastEditTime: 2023-01-31 16:47:32
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<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>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { addDynamicRoute } from '@/router'
|
||||
export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 子级
|
||||
// emitClick () {
|
||||
// // 路由参数
|
||||
// const routeParams = {
|
||||
// routeName: `${this.$route.name}__${this.injectData.id}`,
|
||||
// title: `${this.$route.meta.title} - ${this.injectData.dictType}`,
|
||||
// path: 'sys/dict-data',
|
||||
// params: {
|
||||
// dictTypeId: this.injectData.id
|
||||
// }
|
||||
// }
|
||||
// // 动态路由
|
||||
// addDynamicRoute(routeParams, this.$router)
|
||||
// }
|
||||
},
|
||||
};
|
||||
</script>
|
||||
250
src/views/modules/supplier/components/supplier-add.vue
Normal file
250
src/views/modules/supplier/components/supplier-add.vue
Normal file
@@ -0,0 +1,250 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-02-14 15:02:26
|
||||
* @LastEditTime: 2023-04-18 14:21:19
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form :model="dataForm" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form-item prop="code" :label="$t('supplier.code')">
|
||||
<el-input v-model="dataForm.code" :placeholder="$t('supplier.code')" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="name" :label="$t('supplier.name')">
|
||||
<el-input v-model="dataForm.name" :placeholder="$t('supplier.name')">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="abbreviation" :label="$t('supplier.abbreviation')">
|
||||
<el-input v-model="dataForm.abbreviation" :placeholder="$t('supplier.abbreviation')">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="supplierTypeId" :label="$t('supplier.supplierType')">
|
||||
<el-select v-model="dataForm.supplierTypeId" :placeholder="$t('supplier.supplierType')">
|
||||
<el-option v-for="item in supplierTypeList" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="address" :label="$t('supplier.address')">
|
||||
<el-input v-model="dataForm.address" :placeholder="$t('supplier.address')">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="ment" :label="$t('supplier.ment')">
|
||||
<el-select v-model="dataForm.ment" :placeholder="$t('supplier.ment')">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="contact" :label="$t('supplier.contact')">
|
||||
<el-input v-model="dataForm.contact" :placeholder="$t('supplier.contact')">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="contactEmail" :label="$t('supplier.contactEmail')">
|
||||
<el-input v-model="dataForm.contactEmail" :placeholder="$t('supplier.contactEmail')">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="contactPhone" :label="$t('supplier.contactPhone')">
|
||||
<el-input v-model="dataForm.contactPhone" :placeholder="$t('supplier.contactPhone')">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="enterpriseNature" :label="$t('supplier.enterpriseNature')">
|
||||
<el-select v-model="dataForm.enterpriseNature" :placeholder="$t('supplier.enterpriseNature')">
|
||||
<el-option v-for="item in enterpriseNatureList" :key="item.value" :label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="industry" :label="$t('supplier.industry')">
|
||||
<el-input v-model="dataForm.industry" :placeholder="$t('supplier.industry')">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="productService" :label="$t('supplier.productService')">
|
||||
<el-input v-model="dataForm.productService" :placeholder="$t('supplier.productService')">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item prop="productTypeStatus" :label="$t('basic.status')">
|
||||
<el-select v-model="dataForm.productTypeStatus" :placeholder="$t('basic.status')">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import debounce from "lodash/debounce";
|
||||
import basicAdd from "@/mixins/basic-add";
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
submitURL: "/supplier/qmsSupplier",
|
||||
infoURL: "/supplier/qmsSupplier/{id}",
|
||||
// getProductListURL: '/basic/qmsProduct/page',
|
||||
getCodeURL: '/supplier/qmsSupplier/getCode',
|
||||
getSupplierTypeListURL: '/supplier/qmsSupplierType/page'
|
||||
},
|
||||
options: [{
|
||||
value: 0,
|
||||
label: '不可用'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '可用'
|
||||
}],
|
||||
enterpriseNatureList: [
|
||||
{
|
||||
value: 0,
|
||||
label: '私营'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '国有'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '外资'
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '其他'
|
||||
}
|
||||
],
|
||||
|
||||
supplierTypeList: [],
|
||||
productList:[],
|
||||
visible: false,
|
||||
listQuery: {
|
||||
limit: 999,
|
||||
page:1
|
||||
},
|
||||
dataForm: {
|
||||
id: "",
|
||||
code:null,
|
||||
supplierId:null,
|
||||
productId: null,
|
||||
ment: null,
|
||||
supplierTypeId:null,
|
||||
name:null,
|
||||
address: null,
|
||||
abbreviation: null,
|
||||
grade: null,
|
||||
contact:null,
|
||||
contactEmail:null,
|
||||
contactPhone: null,
|
||||
enterpriseNature: null,
|
||||
industry: null,
|
||||
productService: 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.dataForm.id = id || ""
|
||||
// this.dataForm.dictTypeId = dictTypeId || "";
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs["dataForm"].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.getInfo();
|
||||
} else {
|
||||
this.getCode()
|
||||
}
|
||||
});
|
||||
},
|
||||
getCode() {
|
||||
this.$http
|
||||
.post(this.urlOptions.getCodeURL )
|
||||
.then(({ data: res }) => {
|
||||
if (res.code === 0) {
|
||||
console.log(res.data);
|
||||
this.dataForm.code = res.data
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
})
|
||||
this.$http
|
||||
.get(this.urlOptions.getSupplierTypeListURL, { params: this.listQuery })
|
||||
.then(({ data: res }) => {
|
||||
if (res.code === 0) {
|
||||
console.log(res.data);
|
||||
this.supplierTypeList = res.data.list
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
})
|
||||
},
|
||||
// 获取信息
|
||||
getInfo() {
|
||||
this.$http
|
||||
.get(`/supplier/qmsSupplier/${this.dataForm.id}`)
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.dataForm = {
|
||||
...this.dataForm,
|
||||
...res.data,
|
||||
};
|
||||
})
|
||||
.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: () => {
|
||||
console.log(1111);
|
||||
this.visible = false;
|
||||
this.$emit("successSubmit");
|
||||
},
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
});
|
||||
},
|
||||
1000,
|
||||
{ leading: true, trailing: false }
|
||||
),
|
||||
},
|
||||
};
|
||||
</script>
|
||||
176
src/views/modules/supplier/components/supplierProduct.vue
Normal file
176
src/views/modules/supplier/components/supplierProduct.vue
Normal file
@@ -0,0 +1,176 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-02-14 15:02:26
|
||||
* @LastEditTime: 2023-04-18 09:36:39
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form :model="dataForm" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form-item prop="productId" :label="$t('supplier.productName')">
|
||||
<el-select v-model="dataForm.productId" :placeholder="$t('supplier.productName')">
|
||||
<el-option v-for="item in productList" :key="item.id" :label="item.productName" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="supplierId" :label="$t('supplier.supplierName')">
|
||||
<el-select v-model="dataForm.supplierList" :placeholder="$t('supplier.supplierName')">
|
||||
<el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item prop="productTypeStatus" :label="$t('basic.status')">
|
||||
<el-select v-model="dataForm.productTypeStatus" :placeholder="$t('basic.status')">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import debounce from "lodash/debounce";
|
||||
import basicAdd from "@/mixins/basic-add";
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
submitURL: "/supplier/qmsSupplierType",
|
||||
infoURL: "/supplier/qmsSupplierType/{id}",
|
||||
getProductListURL: '/basic/qmsProduct/page',
|
||||
// getCodeURL: '/supplier/qmsSupplierType/getCode',
|
||||
getSupplierListURL: '/supplier/qmsSupplier/page'
|
||||
},
|
||||
options: [{
|
||||
value: 0,
|
||||
label: '不可用'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '可用'
|
||||
}],
|
||||
supplierList: [],
|
||||
productList:[],
|
||||
visible: false,
|
||||
listQuery: {
|
||||
limit: 999,
|
||||
page:1
|
||||
},
|
||||
dataForm: {
|
||||
id: "",
|
||||
supplierId:null,
|
||||
productId: 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.dataForm.id = id || ""
|
||||
// this.dataForm.dictTypeId = dictTypeId || "";
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs["dataForm"].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.getInfo();
|
||||
} else {
|
||||
this.getCode()
|
||||
}
|
||||
});
|
||||
},
|
||||
getCode() {
|
||||
this.$http
|
||||
.get(this.urlOptions.getSupplierListURL, { params: this.listQuery } )
|
||||
.then(({ data: res }) => {
|
||||
if (res.code === 0) {
|
||||
console.log(res.data);
|
||||
this.supplierList = res.data.list
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
})
|
||||
this.$http
|
||||
.get(this.urlOptions.getProductListURL, { params: this.listQuery })
|
||||
.then(({ data: res }) => {
|
||||
if (res.code === 0) {
|
||||
console.log(res.data);
|
||||
this.productList = res.data.list
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
})
|
||||
},
|
||||
// 获取信息
|
||||
getInfo() {
|
||||
this.$http
|
||||
.get(`/supplier/qmsSupplierType/${this.dataForm.id}`)
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.dataForm = {
|
||||
...this.dataForm,
|
||||
...res.data,
|
||||
};
|
||||
})
|
||||
.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: () => {
|
||||
console.log(1111);
|
||||
this.visible = false;
|
||||
this.$emit("successSubmit");
|
||||
},
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
});
|
||||
},
|
||||
1000,
|
||||
{ leading: true, trailing: false }
|
||||
),
|
||||
},
|
||||
};
|
||||
</script>
|
||||
125
src/views/modules/supplier/components/supplierProductSearch.vue
Normal file
125
src/views/modules/supplier/components/supplierProductSearch.vue
Normal file
@@ -0,0 +1,125 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-02-21 14:44:31
|
||||
* @LastEditTime: 2023-04-14 16:29:53
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form :model="dataForm" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form-item prop="supplierName" :label="$t('supplier.supplierName')">
|
||||
<el-input v-model="dataForm.supplierName" :placeholder="$t('supplier.supplierName')" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import debounce from "lodash/debounce";
|
||||
import basicAdd from "@/mixins/basic-add";
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
// urlOptions: {
|
||||
// submitURL: "/sys/params/",
|
||||
// infoURL: "/sys/params",
|
||||
// },
|
||||
visible: false,
|
||||
options: [{
|
||||
value: '0',
|
||||
label: '不可用'
|
||||
},
|
||||
{
|
||||
value: '1',
|
||||
label: '可用'
|
||||
}],
|
||||
dataForm: {
|
||||
supplierName: null
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// dataRule() {
|
||||
// return {
|
||||
// paramCode: [
|
||||
// {
|
||||
// required: true,
|
||||
// message: this.$t("validate.required"),
|
||||
// trigger: "blur",
|
||||
// },
|
||||
// ],
|
||||
// paramValue: [
|
||||
// {
|
||||
// required: true,
|
||||
// message: this.$t("validate.required"),
|
||||
// trigger: "blur",
|
||||
// },
|
||||
// ],
|
||||
// };
|
||||
// },
|
||||
},
|
||||
methods: {
|
||||
// init(id) {
|
||||
// this.dataForm.id = id || "";
|
||||
// this.visible = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs["dataForm"].resetFields();
|
||||
// if (this.dataForm.id) {
|
||||
// this.getInfo();
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
// 获取信息
|
||||
// getInfo() {
|
||||
// this.$http
|
||||
// .get(`/sys/params/${this.dataForm.id}`)
|
||||
// .then(({ data: res }) => {
|
||||
// if (res.code !== 0) {
|
||||
// return this.$message.error(res.msg);
|
||||
// }
|
||||
// this.dataForm = {
|
||||
// ...this.dataForm,
|
||||
// ...res.data,
|
||||
// };
|
||||
// })
|
||||
// .catch(() => {});
|
||||
// },
|
||||
// 表单提交
|
||||
handleConditionSearch() {
|
||||
this.$emit("successSubmit", this.dataForm);
|
||||
},
|
||||
// dataFormSubmitHandle: debounce(
|
||||
// function () {
|
||||
// // console.log(1111);
|
||||
// // this.visible = false;
|
||||
// this.$emit("successSubmit", this.dataForm.key);
|
||||
// // this.$refs["dataForm"].validate((valid) => {
|
||||
// // if (!valid) {
|
||||
// // return false;
|
||||
// // }
|
||||
// // this.$http[!this.dataForm.id ? "post" : "put"](
|
||||
// // "/sys/params",
|
||||
// // 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: () => {
|
||||
|
||||
// // },
|
||||
// // });
|
||||
// // })
|
||||
// // .catch(() => {});
|
||||
// // });
|
||||
// },
|
||||
// 1000,
|
||||
// { leading: true, trailing: false }
|
||||
// ),
|
||||
},
|
||||
};
|
||||
</script>
|
||||
175
src/views/modules/supplier/components/supplierType-add.vue
Normal file
175
src/views/modules/supplier/components/supplierType-add.vue
Normal file
@@ -0,0 +1,175 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-02-14 15:02:26
|
||||
* @LastEditTime: 2023-04-17 10:56:39
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form :model="dataForm" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form-item prop="code" :label="$t('basic.code')">
|
||||
<el-input v-model="dataForm.code" :placeholder="$t('basic.code')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="name" :label="$t('basic.name')">
|
||||
<el-input v-model="dataForm.name" :placeholder="$t('basic.name')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="supplierTypeStatus" :label="$t('basic.status')">
|
||||
<el-select v-model="dataForm.supplierTypeStatus" :placeholder="$t('basic.status')">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item prop="productTypeStatus" :label="$t('basic.status')">
|
||||
<el-select v-model="dataForm.productTypeStatus" :placeholder="$t('basic.status')">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import debounce from "lodash/debounce";
|
||||
import basicAdd from "@/mixins/basic-add";
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
submitURL: "/supplier/qmsSupplierType",
|
||||
infoURL: "/supplier/qmsSupplierType/{id}",
|
||||
getCodeURL: '/supplier/qmsSupplierType/getCode',
|
||||
// getTypeListURL: '/basic/qmsProductType/page'
|
||||
},
|
||||
options: [{
|
||||
value: 0,
|
||||
label: '不可用'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '可用'
|
||||
}],
|
||||
typeList:[],
|
||||
visible: false,
|
||||
listQuery: {
|
||||
limit: 999,
|
||||
page:1
|
||||
},
|
||||
dataForm: {
|
||||
id: "",
|
||||
code:null,
|
||||
name: null,
|
||||
supplierTypeStatus: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.dataForm.id = id || ""
|
||||
// this.dataForm.dictTypeId = dictTypeId || "";
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs["dataForm"].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.getInfo();
|
||||
} else {
|
||||
this.getCode()
|
||||
}
|
||||
});
|
||||
},
|
||||
getCode() {
|
||||
this.$http
|
||||
.post(this.urlOptions.getCodeURL)
|
||||
.then(({ data: res }) => {
|
||||
if (res.code === 0) {
|
||||
console.log(res);
|
||||
this.dataForm.code = res.data
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
// this.$http
|
||||
// .get(this.urlOptions.getTypeListURL,this.listQuery )
|
||||
// .then(({ data: res }) => {
|
||||
// if (res.code === 0) {
|
||||
// console.log(res.data);
|
||||
// this.typeList = res.data.list
|
||||
// }
|
||||
// })
|
||||
// .catch(() => {
|
||||
// });
|
||||
},
|
||||
// 获取信息
|
||||
getInfo() {
|
||||
this.$http
|
||||
.get(`/supplier/qmsSupplierType/${this.dataForm.id}`)
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.dataForm = {
|
||||
...this.dataForm,
|
||||
...res.data,
|
||||
};
|
||||
})
|
||||
.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: () => {
|
||||
console.log(1111);
|
||||
this.visible = false;
|
||||
this.$emit("successSubmit");
|
||||
},
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
});
|
||||
},
|
||||
1000,
|
||||
{ leading: true, trailing: false }
|
||||
),
|
||||
},
|
||||
};
|
||||
</script>
|
||||
129
src/views/modules/supplier/components/supplierTypeSearch.vue
Normal file
129
src/views/modules/supplier/components/supplierTypeSearch.vue
Normal file
@@ -0,0 +1,129 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-02-21 14:44:31
|
||||
* @LastEditTime: 2023-04-14 16:29:53
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form :model="dataForm" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form-item prop="code" :label="$t('basic.code')">
|
||||
<el-input v-model="dataForm.code" :placeholder="$t('basic.code')" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="name" :label="$t('basic.name')">
|
||||
<el-input v-model="dataForm.name" :placeholder="$t('basic.name')" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import debounce from "lodash/debounce";
|
||||
import basicAdd from "@/mixins/basic-add";
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
// urlOptions: {
|
||||
// submitURL: "/sys/params/",
|
||||
// infoURL: "/sys/params",
|
||||
// },
|
||||
visible: false,
|
||||
options: [{
|
||||
value: '0',
|
||||
label: '不可用'
|
||||
},
|
||||
{
|
||||
value: '1',
|
||||
label: '可用'
|
||||
}],
|
||||
dataForm: {
|
||||
name: null,
|
||||
code: null
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// dataRule() {
|
||||
// return {
|
||||
// paramCode: [
|
||||
// {
|
||||
// required: true,
|
||||
// message: this.$t("validate.required"),
|
||||
// trigger: "blur",
|
||||
// },
|
||||
// ],
|
||||
// paramValue: [
|
||||
// {
|
||||
// required: true,
|
||||
// message: this.$t("validate.required"),
|
||||
// trigger: "blur",
|
||||
// },
|
||||
// ],
|
||||
// };
|
||||
// },
|
||||
},
|
||||
methods: {
|
||||
// init(id) {
|
||||
// this.dataForm.id = id || "";
|
||||
// this.visible = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs["dataForm"].resetFields();
|
||||
// if (this.dataForm.id) {
|
||||
// this.getInfo();
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
// 获取信息
|
||||
// getInfo() {
|
||||
// this.$http
|
||||
// .get(`/sys/params/${this.dataForm.id}`)
|
||||
// .then(({ data: res }) => {
|
||||
// if (res.code !== 0) {
|
||||
// return this.$message.error(res.msg);
|
||||
// }
|
||||
// this.dataForm = {
|
||||
// ...this.dataForm,
|
||||
// ...res.data,
|
||||
// };
|
||||
// })
|
||||
// .catch(() => {});
|
||||
// },
|
||||
// 表单提交
|
||||
handleConditionSearch() {
|
||||
this.$emit("successSubmit", this.dataForm);
|
||||
},
|
||||
// dataFormSubmitHandle: debounce(
|
||||
// function () {
|
||||
// // console.log(1111);
|
||||
// // this.visible = false;
|
||||
// this.$emit("successSubmit", this.dataForm.key);
|
||||
// // this.$refs["dataForm"].validate((valid) => {
|
||||
// // if (!valid) {
|
||||
// // return false;
|
||||
// // }
|
||||
// // this.$http[!this.dataForm.id ? "post" : "put"](
|
||||
// // "/sys/params",
|
||||
// // 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: () => {
|
||||
|
||||
// // },
|
||||
// // });
|
||||
// // })
|
||||
// // .catch(() => {});
|
||||
// // });
|
||||
// },
|
||||
// 1000,
|
||||
// { leading: true, trailing: false }
|
||||
// ),
|
||||
},
|
||||
};
|
||||
</script>
|
||||
246
src/views/modules/supplier/qmsEvaluationItemListTag.vue
Normal file
246
src/views/modules/supplier/qmsEvaluationItemListTag.vue
Normal file
@@ -0,0 +1,246 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-04-17 14:23:17
|
||||
* @LastEditTime: 2023-04-24 14:27:08
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<!-- <div class="mod-sys__user"> -->
|
||||
<el-input v-model="name" :placeholder="$t('supplier.title')" style="width:300px" @blur="handleAdd"
|
||||
@keyup.enter.native="handleAdd">
|
||||
</el-input>
|
||||
<!-- </div> -->
|
||||
<el-card class="box-card" style="width:600px">
|
||||
<div slot="header" class="clearfix">
|
||||
<span> </span>
|
||||
<el-button style="float: right; padding: 3px 0" type="text" icon="el-icon-edit" />
|
||||
<el-button style="float: right; padding: 3px 0" type="text" icon="el-icon-delete" />
|
||||
</div>
|
||||
<span v-for="o in 4" :key="o" class="text item">
|
||||
{{'列表内容 ' + o }}
|
||||
</span>
|
||||
</el-card>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from "@/mixins/basic-page"
|
||||
import basicSearch from "@/mixins/basic-search"
|
||||
// import supplierProductSearch from "./components/supplierProductSearch.vue"
|
||||
// import evaluationTaskAdd from "./components/evaluationTask-add.vue"
|
||||
import { timeFormatter } from '@/filters'
|
||||
import i18n from "@/i18n"
|
||||
// import i18n from "@/i18n";
|
||||
export default {
|
||||
mixins: [basicPage, basicSearch],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "/supplier/qmsEvaluationItemListLabel/page",
|
||||
deleteURL: "/supplier/qmsEvaluationTask",
|
||||
exportURL: '/supplier/qmsEvaluationTask/export',
|
||||
getSupplierListURL: '/supplier/qmsSupplier/page',
|
||||
getTemplateListURL: '/supplier/qmsEvaluationTask/page'
|
||||
// submitURL: '/supplier/qmsSupplierType'
|
||||
},
|
||||
name: '',
|
||||
searchOrEditTitle: "",
|
||||
searchOrUpdateVisible: false,
|
||||
productOrEditTitle: "",
|
||||
addOrEditTitle: '',
|
||||
addOrUpdateVisible: false,
|
||||
productOrUpdateVisible: false,
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: i18n.t('supplier.supplierName'),
|
||||
selectOptions: [],
|
||||
param: 'supplierName',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: i18n.t('supplier.evaluationTemplateName'),
|
||||
selectOptions: [],
|
||||
param: 'evaluationTemplateId',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: i18n.t('supplier.startTime'),
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-ddTHH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeSlot',
|
||||
width: 350
|
||||
},
|
||||
// {
|
||||
// type: "",
|
||||
// label: i18n.t("params.paramCode"),
|
||||
// placeholder: i18n.t("params.paramCode"),
|
||||
// param: "paramCode",
|
||||
// },
|
||||
// {
|
||||
// type: "separate",
|
||||
// },
|
||||
{
|
||||
type: "button",
|
||||
btnName: i18n.t('search'),
|
||||
name: "search",
|
||||
color: "primary",
|
||||
// plain: true,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: i18n.t('add'),
|
||||
name: "add",
|
||||
color: "primary",
|
||||
// plain: true,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: i18n.t('export'),
|
||||
name: "export",
|
||||
color: "primary",
|
||||
// plain: true,
|
||||
}
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
},
|
||||
methods: {
|
||||
//search-bar点击
|
||||
// handleSearchCancel() {
|
||||
// this.searchOrEditTitle = "";
|
||||
// this.searchOrUpdateVisible = false;
|
||||
// },
|
||||
handleAdd() {
|
||||
const data = {
|
||||
name: this.name
|
||||
}
|
||||
this.$http[!this.dataForm.id ? "post" : "put"](this.urlOptions.submitURL, data)
|
||||
.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("successSubmit")
|
||||
},
|
||||
})
|
||||
})
|
||||
},
|
||||
conditionSearch() {
|
||||
this.searchOrEditTitle = "搜索";
|
||||
this.searchOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.searchOrUpdate.init();
|
||||
});
|
||||
},
|
||||
exportHandle() {
|
||||
this.$http.get(this.urlOptions.exportURL, { responseType: 'blob' }, {
|
||||
...this.dataForm
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
// if (res !== 0) {
|
||||
// return this.$message.error(res.msg)
|
||||
// }
|
||||
let fileName = ''
|
||||
const contentDisposition = res.headers['content-disposition']
|
||||
if (contentDisposition) {
|
||||
const temp = res.headers['content-disposition']
|
||||
.split(';')[1]
|
||||
.split('=')[1]
|
||||
// 对文件名乱码转义--【Node.js】使用iconv-lite解决中文乱码
|
||||
fileName = decodeURI(temp)
|
||||
console.log(temp)
|
||||
}
|
||||
const blob = new Blob([res.data])
|
||||
const reader = new FileReader()
|
||||
reader.readAsDataURL(blob)
|
||||
reader.onload = (e) => {
|
||||
const a = document.createElement('a')
|
||||
a.download = fileName
|
||||
a.href = e.target.result
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
document.body.removeChild(a)
|
||||
}
|
||||
}).catch(() => { })
|
||||
},
|
||||
// handleConfirm() {
|
||||
// this.$refs.addOrUpdate.dataFormSubmitHandle();
|
||||
// },
|
||||
// conditionSearchSubmit() {},
|
||||
conditionSearchSubmit(dataForm) {
|
||||
// console.log(key);
|
||||
// console.log(key);
|
||||
this.listQuery.supplierName = dataForm.supplierName
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
this.searchOrUpdateVisible = false;
|
||||
// console.log(11111);
|
||||
// this.conditionSearchSubmit();
|
||||
},
|
||||
handleClick(val) {
|
||||
if (val.type === "delete") {
|
||||
this.$confirm(`确定对[名称=${val.data.customerTypeName}]进行删除操作?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.$http.delete(this.urlOptions.deleteURL, { data: [val.data.id] }).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
} else if (val.type === 'edit') {
|
||||
this.addOrEditTitle = '修改'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id);
|
||||
});
|
||||
}
|
||||
},
|
||||
buttonClick(val) {
|
||||
console.log(val)
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
default:
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
363
src/views/modules/supplier/qmsEvaluationTask.vue
Normal file
363
src/views/modules/supplier/qmsEvaluationTask.vue
Normal file
@@ -0,0 +1,363 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-04-17 14:23:17
|
||||
* @LastEditTime: 2023-04-19 14:30:08
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<SearchBar :formConfigs="formConfig" ref="ruleForm" @headBtnClick="buttonClick">
|
||||
</SearchBar>
|
||||
<base-table id="palletTable" :table-props="tableProps" :page="listQuery.page" ref="palletTable1"
|
||||
@emitFun="inputChange" @emitButtonClick="emitButtonClick" :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" />
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" @cancel="handleCancel"
|
||||
@confirm="handleConfirm" :before-close="handleCancel">
|
||||
<evaluationTask-add ref="addOrUpdate" @refreshDataList="successSubmit">
|
||||
</evaluationTask-add>
|
||||
<!-- <el-row slot="footer" type="flex" justify="end"> </el-row> -->
|
||||
</base-dialog>
|
||||
<base-dialog :dialogTitle="searchOrEditTitle" :dialogVisible="searchOrUpdateVisible" @cancel="handleSearchCancel"
|
||||
@confirm="handleSearchConfirm" :before-close="handleSearchCancel">
|
||||
<supplierProduct-search ref="searchOrUpdate" @successSubmit="conditionSearchSubmit">
|
||||
</supplierProduct-search>
|
||||
<el-row slot="footer" type="flex" justify="end">
|
||||
<el-col :span="12">
|
||||
<el-button size="small" type="primary" plain class="btnTextStyle" @click="handleSearchCancel">
|
||||
{{ $t("close") }}
|
||||
</el-button>
|
||||
<el-button size="small" class="btnTextStyle" type="primary" plain @click="handleSearchReset">{{
|
||||
$t("reset")
|
||||
}}</el-button>
|
||||
<el-button type="primary" size="small" class="btnTextStyle" @click="handleSearchConfirm">
|
||||
{{ $t("search") }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from "@/mixins/basic-page"
|
||||
import basicSearch from "@/mixins/basic-search"
|
||||
import supplierProductSearch from "./components/supplierProductSearch.vue"
|
||||
import evaluationTaskAdd from "./components/evaluationTask-add.vue"
|
||||
import { timeFormatter } from '@/filters'
|
||||
import i18n from "@/i18n"
|
||||
// import i18n from "@/i18n";
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "evaluationType",
|
||||
label: i18n.t('supplier.evaluationType')
|
||||
},
|
||||
{
|
||||
prop: "title",
|
||||
label: i18n.t('supplier.title')
|
||||
},
|
||||
{
|
||||
prop: "evaluationTemplateName",
|
||||
label: i18n.t('supplier.evaluationTemplateName')
|
||||
},
|
||||
{
|
||||
prop: "evaluationPeriod",
|
||||
label: i18n.t('supplier.evaluationPeriod')
|
||||
},
|
||||
{
|
||||
prop: "description",
|
||||
label: i18n.t('supplier.description'),
|
||||
filter: timeFormatter
|
||||
},
|
||||
{
|
||||
prop: "startTime",
|
||||
label: i18n.t('supplier.startTime')
|
||||
}
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
btnName: i18n.t('t.edit'),
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
btnName: i18n.t('t.delete'),
|
||||
}
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage, basicSearch],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "/supplier/qmsEvaluationTask/page",
|
||||
deleteURL: "/supplier/qmsEvaluationTask",
|
||||
exportURL: '/supplier/qmsEvaluationTask/export',
|
||||
getSupplierListURL: '/supplier/qmsSupplier/page',
|
||||
getTemplateListURL: '/supplier/qmsEvaluationTask/page'
|
||||
|
||||
// submitURL: '/supplier/qmsSupplierType'
|
||||
},
|
||||
tableProps,
|
||||
ment: '',
|
||||
tableBtn,
|
||||
productData: {},
|
||||
dataForm:{
|
||||
limit: 999,
|
||||
page:1
|
||||
},
|
||||
searchOrEditTitle: "",
|
||||
searchOrUpdateVisible: false,
|
||||
productOrEditTitle: "",
|
||||
addOrEditTitle: '',
|
||||
addOrUpdateVisible: false,
|
||||
productOrUpdateVisible: false,
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: i18n.t('supplier.supplierName'),
|
||||
selectOptions: [],
|
||||
param: 'supplierName',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: i18n.t('supplier.evaluationTemplateName'),
|
||||
selectOptions: [],
|
||||
param: 'evaluationTemplateId',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: i18n.t('supplier.startTime'),
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-ddTHH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeSlot',
|
||||
width: 350
|
||||
},
|
||||
// {
|
||||
// type: "",
|
||||
// label: i18n.t("params.paramCode"),
|
||||
// placeholder: i18n.t("params.paramCode"),
|
||||
// param: "paramCode",
|
||||
// },
|
||||
// {
|
||||
// type: "separate",
|
||||
// },
|
||||
{
|
||||
type: "button",
|
||||
btnName: i18n.t('search'),
|
||||
name: "search",
|
||||
color: "primary",
|
||||
// plain: true,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: i18n.t('add'),
|
||||
name: "add",
|
||||
color: "primary",
|
||||
// plain: true,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: i18n.t('export'),
|
||||
name: "export",
|
||||
color: "primary",
|
||||
// plain: true,
|
||||
}
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
supplierProductSearch,
|
||||
// supplierProduct,
|
||||
evaluationTaskAdd
|
||||
},
|
||||
mounted () {
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
inputChange(val) {
|
||||
console.log('=======')
|
||||
console.log(val)
|
||||
this.tableData[val._pageIndex - 1][val.prop] = val[val.prop]
|
||||
console.log(this.tableData)
|
||||
},
|
||||
emitButtonClick() {
|
||||
console.log('emitButtonClick')
|
||||
let obj = {}
|
||||
for (let i of this.tableData) {
|
||||
obj[i.prop] = ''
|
||||
}
|
||||
this.tableData.push(obj)
|
||||
},
|
||||
getData() {
|
||||
this.$http
|
||||
.get(this.urlOptions.getSupplierListURL, { params: this.listQuery })
|
||||
.then(({ data: res }) => {
|
||||
if (res.code === 0) {
|
||||
console.log(res.data);
|
||||
this.formConfig[0].selectOptions = res.data.list.map((item) => {
|
||||
return {
|
||||
id: item.name,
|
||||
name: item.name,
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
})
|
||||
this.$http
|
||||
.get(this.urlOptions.getTemplateListURL, { params: this.listQuery })
|
||||
.then(({ data: res }) => {
|
||||
if (res.code === 0) {
|
||||
console.log(res.data);
|
||||
this.formConfig[1].selectOptions = res.data.list
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
})
|
||||
},
|
||||
//search-bar点击
|
||||
handleProductCancel() {
|
||||
this.productOrUpdateVisible = false;
|
||||
this.productOrEditTitle = "";
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
console.log(val);
|
||||
this.productData = val.newVal ? val.newVal : {}
|
||||
},
|
||||
setCurrent(index) {
|
||||
this.$refs.palletTable1.setCurrent("palletTable", index);
|
||||
},
|
||||
// handleSearchCancel() {
|
||||
// this.searchOrEditTitle = "";
|
||||
// this.searchOrUpdateVisible = false;
|
||||
// },
|
||||
conditionSearch() {
|
||||
this.searchOrEditTitle = "搜索";
|
||||
this.searchOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.searchOrUpdate.init();
|
||||
});
|
||||
},
|
||||
exportHandle() {
|
||||
this.$http.get(this.urlOptions.exportURL, { responseType: 'blob' }, {
|
||||
...this.dataForm
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
// if (res !== 0) {
|
||||
// return this.$message.error(res.msg)
|
||||
// }
|
||||
let fileName = ''
|
||||
const contentDisposition = res.headers['content-disposition']
|
||||
if (contentDisposition) {
|
||||
const temp = res.headers['content-disposition']
|
||||
.split(';')[1]
|
||||
.split('=')[1]
|
||||
// 对文件名乱码转义--【Node.js】使用iconv-lite解决中文乱码
|
||||
fileName = decodeURI(temp)
|
||||
console.log(temp)
|
||||
}
|
||||
const blob = new Blob([res.data])
|
||||
const reader = new FileReader()
|
||||
reader.readAsDataURL(blob)
|
||||
reader.onload = (e) => {
|
||||
const a = document.createElement('a')
|
||||
a.download = fileName
|
||||
a.href = e.target.result
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
document.body.removeChild(a)
|
||||
}
|
||||
}).catch(() => { })
|
||||
},
|
||||
// handleConfirm() {
|
||||
// this.$refs.addOrUpdate.dataFormSubmitHandle();
|
||||
// },
|
||||
// conditionSearchSubmit() {},
|
||||
conditionSearchSubmit(dataForm) {
|
||||
// console.log(key);
|
||||
// console.log(key);
|
||||
this.listQuery.supplierName = dataForm.supplierName
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
this.searchOrUpdateVisible = false;
|
||||
// console.log(11111);
|
||||
// this.conditionSearchSubmit();
|
||||
},
|
||||
handleClick(val) {
|
||||
if (val.type === "delete") {
|
||||
this.$confirm(`确定对[名称=${val.data.customerTypeName}]进行删除操作?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.$http.delete(this.urlOptions.deleteURL, { data: [val.data.id] }).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
} else if (val.type === 'edit') {
|
||||
this.addOrEditTitle = '修改'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id);
|
||||
});
|
||||
}
|
||||
},
|
||||
// addOrUpdateHandle(productData) {
|
||||
// this.addOrUpdateVisible = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.addOrUpdate.init(productData);
|
||||
// });
|
||||
// },
|
||||
buttonClick(val) {
|
||||
console.log(val)
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
// this.listQuery.paramCode = val.paramCode;
|
||||
this.listQuery.evaluationTemplateId = val.evaluationTemplateId ? val.evaluationTemplateId : undefined
|
||||
// this.listQuery.supplierBatch = val.supplierBatch ? val.supplierBatch : undefined
|
||||
this.listQuery.supplierName = val.supplierName ? val.supplierName : undefined
|
||||
this.listQuery.startTime = val.timeSlot ? val.timeSlot[0] : undefined
|
||||
this.listQuery.endTime = val.timeSlot ? val.timeSlot[1] : undefined
|
||||
// console.log(i18n);
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
default:
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
354
src/views/modules/supplier/qmsPoorLaunch.vue
Normal file
354
src/views/modules/supplier/qmsPoorLaunch.vue
Normal file
@@ -0,0 +1,354 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-04-17 14:23:17
|
||||
* @LastEditTime: 2023-04-18 15:20:13
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<SearchBar :formConfigs="formConfig" ref="ruleForm" @headBtnClick="buttonClick">
|
||||
</SearchBar>
|
||||
<base-table id="palletTable" :table-props="tableProps" :page="listQuery.page" ref="palletTable1"
|
||||
@emitFun="inputChange" @emitButtonClick="emitButtonClick" :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" />
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" @cancel="handleCancel"
|
||||
@confirm="handleConfirm" :before-close="handleCancel">
|
||||
<poorLaunch-add ref="addOrUpdate" @refreshDataList="successSubmit">
|
||||
</poorLaunch-add>
|
||||
<!-- <el-row slot="footer" type="flex" justify="end"> </el-row> -->
|
||||
</base-dialog>
|
||||
<base-dialog :dialogTitle="searchOrEditTitle" :dialogVisible="searchOrUpdateVisible" @cancel="handleSearchCancel"
|
||||
@confirm="handleSearchConfirm" :before-close="handleSearchCancel">
|
||||
<supplierProduct-search ref="searchOrUpdate" @successSubmit="conditionSearchSubmit">
|
||||
</supplierProduct-search>
|
||||
<el-row slot="footer" type="flex" justify="end">
|
||||
<el-col :span="12">
|
||||
<el-button size="small" type="primary" plain class="btnTextStyle" @click="handleSearchCancel">
|
||||
{{ $t("close") }}
|
||||
</el-button>
|
||||
<el-button size="small" class="btnTextStyle" type="primary" plain @click="handleSearchReset">{{
|
||||
$t("reset")
|
||||
}}</el-button>
|
||||
<el-button type="primary" size="small" class="btnTextStyle" @click="handleSearchConfirm">
|
||||
{{ $t("search") }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from "@/mixins/basic-page"
|
||||
import basicSearch from "@/mixins/basic-search"
|
||||
import supplierProductSearch from "./components/supplierProductSearch.vue"
|
||||
import poorLaunchAdd from "./components/poorLaunch-add.vue"
|
||||
import { timeFormatter } from '@/filters'
|
||||
import i18n from "@/i18n"
|
||||
// import i18n from "@/i18n";
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "productName",
|
||||
label: i18n.t('supplier.materialName')
|
||||
},
|
||||
{
|
||||
prop: "productCode",
|
||||
label: i18n.t('supplier.materialCode')
|
||||
},
|
||||
{
|
||||
prop: "supplierName",
|
||||
label: i18n.t('supplier.supplierName')
|
||||
},
|
||||
{
|
||||
prop: "supplierBatch",
|
||||
label: i18n.t('supplier.supplierBatch')
|
||||
},
|
||||
{
|
||||
prop: "offlineTime",
|
||||
label: i18n.t('supplier.offlineTime'),
|
||||
filter: timeFormatter
|
||||
},
|
||||
{
|
||||
prop: "defectiveQuantity",
|
||||
label: i18n.t('supplier.defectiveQuantity')
|
||||
},
|
||||
{
|
||||
prop: "undesirablePhenomena",
|
||||
label: i18n.t('supplier.undesirablePhenomena')
|
||||
}
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
btnName: i18n.t('t.edit'),
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
btnName: i18n.t('t.delete'),
|
||||
}
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage, basicSearch],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "/supplier/qmsPoorLaunch/page",
|
||||
deleteURL: "/supplier/qmsPoorLaunch",
|
||||
exportURL: '/supplier/qmsPoorLaunch/export',
|
||||
getSupplierListURL: '/supplier/qmsSupplier/page'
|
||||
// submitURL: '/supplier/qmsSupplierType'
|
||||
},
|
||||
tableProps,
|
||||
ment: '',
|
||||
tableBtn,
|
||||
productData: {},
|
||||
dataForm:{
|
||||
limit: 999,
|
||||
page:1
|
||||
},
|
||||
searchOrEditTitle: "",
|
||||
searchOrUpdateVisible: false,
|
||||
productOrEditTitle: "",
|
||||
addOrEditTitle: '',
|
||||
addOrUpdateVisible: false,
|
||||
productOrUpdateVisible: false,
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: i18n.t('supplier.materialName'),
|
||||
placeholder: i18n.t('supplier.materialName'),
|
||||
param: 'productName'
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: i18n.t('supplier.supplierBatch'),
|
||||
placeholder: i18n.t('supplier.supplierBatch'),
|
||||
param: 'supplierBatch'
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: i18n.t('supplier.supplierName'),
|
||||
selectOptions: [],
|
||||
param: 'supplierName',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: i18n.t('supplier.offlineTime'),
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-ddTHH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeSlot',
|
||||
width: 350
|
||||
},
|
||||
// {
|
||||
// type: "",
|
||||
// label: i18n.t("params.paramCode"),
|
||||
// placeholder: i18n.t("params.paramCode"),
|
||||
// param: "paramCode",
|
||||
// },
|
||||
// {
|
||||
// type: "separate",
|
||||
// },
|
||||
{
|
||||
type: "button",
|
||||
btnName: i18n.t('search'),
|
||||
name: "search",
|
||||
color: "primary",
|
||||
// plain: true,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: i18n.t('add'),
|
||||
name: "add",
|
||||
color: "primary",
|
||||
// plain: true,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: i18n.t('export'),
|
||||
name: "export",
|
||||
color: "primary",
|
||||
// plain: true,
|
||||
}
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
supplierProductSearch,
|
||||
// supplierProduct,
|
||||
poorLaunchAdd
|
||||
},
|
||||
mounted () {
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
inputChange(val) {
|
||||
console.log('=======')
|
||||
console.log(val)
|
||||
this.tableData[val._pageIndex - 1][val.prop] = val[val.prop]
|
||||
console.log(this.tableData)
|
||||
},
|
||||
emitButtonClick() {
|
||||
console.log('emitButtonClick')
|
||||
let obj = {}
|
||||
for (let i of this.tableData) {
|
||||
obj[i.prop] = ''
|
||||
}
|
||||
this.tableData.push(obj)
|
||||
},
|
||||
getData() {
|
||||
this.$http
|
||||
.get(this.urlOptions.getSupplierListURL, { params: this.listQuery })
|
||||
.then(({ data: res }) => {
|
||||
if (res.code === 0) {
|
||||
console.log(res.data);
|
||||
this.formConfig[2].selectOptions = res.data.list
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
})
|
||||
},
|
||||
//search-bar点击
|
||||
handleProductCancel() {
|
||||
this.productOrUpdateVisible = false;
|
||||
this.productOrEditTitle = "";
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
console.log(val);
|
||||
this.productData = val.newVal ? val.newVal : {}
|
||||
},
|
||||
setCurrent(index) {
|
||||
this.$refs.palletTable1.setCurrent("palletTable", index);
|
||||
},
|
||||
// handleSearchCancel() {
|
||||
// this.searchOrEditTitle = "";
|
||||
// this.searchOrUpdateVisible = false;
|
||||
// },
|
||||
conditionSearch() {
|
||||
this.searchOrEditTitle = "搜索";
|
||||
this.searchOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.searchOrUpdate.init();
|
||||
});
|
||||
},
|
||||
exportHandle() {
|
||||
this.$http.get(this.urlOptions.exportURL, { responseType: 'blob' }, {
|
||||
...this.dataForm
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
// if (res !== 0) {
|
||||
// return this.$message.error(res.msg)
|
||||
// }
|
||||
let fileName = ''
|
||||
const contentDisposition = res.headers['content-disposition']
|
||||
if (contentDisposition) {
|
||||
const temp = res.headers['content-disposition']
|
||||
.split(';')[1]
|
||||
.split('=')[1]
|
||||
// 对文件名乱码转义--【Node.js】使用iconv-lite解决中文乱码
|
||||
fileName = decodeURI(temp)
|
||||
console.log(temp)
|
||||
}
|
||||
const blob = new Blob([res.data])
|
||||
const reader = new FileReader()
|
||||
reader.readAsDataURL(blob)
|
||||
reader.onload = (e) => {
|
||||
const a = document.createElement('a')
|
||||
a.download = fileName
|
||||
a.href = e.target.result
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
document.body.removeChild(a)
|
||||
}
|
||||
}).catch(() => { })
|
||||
},
|
||||
// handleConfirm() {
|
||||
// this.$refs.addOrUpdate.dataFormSubmitHandle();
|
||||
// },
|
||||
// conditionSearchSubmit() {},
|
||||
conditionSearchSubmit(dataForm) {
|
||||
// console.log(key);
|
||||
// console.log(key);
|
||||
this.listQuery.supplierName = dataForm.supplierName
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
this.searchOrUpdateVisible = false;
|
||||
// console.log(11111);
|
||||
// this.conditionSearchSubmit();
|
||||
},
|
||||
handleClick(val) {
|
||||
if (val.type === "delete") {
|
||||
this.$confirm(`确定对[名称=${val.data.customerTypeName}]进行删除操作?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.$http.delete(this.urlOptions.deleteURL, { data: [val.data.id] }).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
} else if (val.type === 'edit') {
|
||||
this.addOrEditTitle = '修改'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id);
|
||||
});
|
||||
}
|
||||
},
|
||||
// addOrUpdateHandle(productData) {
|
||||
// this.addOrUpdateVisible = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.addOrUpdate.init(productData);
|
||||
// });
|
||||
// },
|
||||
buttonClick(val) {
|
||||
console.log(val)
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
// this.listQuery.paramCode = val.paramCode;
|
||||
this.listQuery.productName = val.productName ? val.productName : undefined
|
||||
this.listQuery.supplierBatch = val.supplierBatch ? val.supplierBatch : undefined
|
||||
this.listQuery.supplierName = val.supplierName ? val.supplierName : undefined
|
||||
this.listQuery.startTime = val.timeSlot ? val.timeSlot[0] : undefined
|
||||
this.listQuery.endTime = val.timeSlot ? val.timeSlot[1] : undefined
|
||||
// console.log(i18n);
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
default:
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
391
src/views/modules/supplier/qmsQualityAccident.vue
Normal file
391
src/views/modules/supplier/qmsQualityAccident.vue
Normal file
@@ -0,0 +1,391 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-04-17 14:23:17
|
||||
* @LastEditTime: 2023-04-18 16:11:41
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<SearchBar :formConfigs="formConfig" ref="ruleForm" @headBtnClick="buttonClick">
|
||||
</SearchBar>
|
||||
<base-table id="palletTable" :table-props="tableProps" :page="listQuery.page" ref="palletTable1"
|
||||
@emitFun="inputChange" @emitButtonClick="emitButtonClick" :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" />
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" @cancel="handleCancel"
|
||||
@confirm="handleConfirm" :before-close="handleCancel">
|
||||
<qualityAccident-add ref="addOrUpdate" @refreshDataList="successSubmit">
|
||||
</qualityAccident-add>
|
||||
<!-- <el-row slot="footer" type="flex" justify="end"> </el-row> -->
|
||||
</base-dialog>
|
||||
<base-dialog :dialogTitle="searchOrEditTitle" :dialogVisible="searchOrUpdateVisible" @cancel="handleSearchCancel"
|
||||
@confirm="handleSearchConfirm" :before-close="handleSearchCancel">
|
||||
<supplierProduct-search ref="searchOrUpdate" @successSubmit="conditionSearchSubmit">
|
||||
</supplierProduct-search>
|
||||
<el-row slot="footer" type="flex" justify="end">
|
||||
<el-col :span="12">
|
||||
<el-button size="small" type="primary" plain class="btnTextStyle" @click="handleSearchCancel">
|
||||
{{ $t("close") }}
|
||||
</el-button>
|
||||
<el-button size="small" class="btnTextStyle" type="primary" plain @click="handleSearchReset">{{
|
||||
$t("reset")
|
||||
}}</el-button>
|
||||
<el-button type="primary" size="small" class="btnTextStyle" @click="handleSearchConfirm">
|
||||
{{ $t("search") }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from "@/mixins/basic-page"
|
||||
import basicSearch from "@/mixins/basic-search"
|
||||
import supplierProductSearch from "./components/supplierProductSearch.vue"
|
||||
import qualityAccidentAdd from "./components/qualityAccident-add.vue"
|
||||
import { timeFormatter } from '@/filters'
|
||||
import i18n from "@/i18n"
|
||||
import supplier from '@/filters/supplier'
|
||||
// import i18n from "@/i18n";
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "applicationDate",
|
||||
label: i18n.t('supplier.applicationDate'),
|
||||
filter: timeFormatter
|
||||
},
|
||||
{
|
||||
prop: "productName",
|
||||
label: i18n.t('supplier.productName')
|
||||
},
|
||||
{
|
||||
prop: "productCode",
|
||||
label: i18n.t('supplier.productCode')
|
||||
},
|
||||
{
|
||||
prop: "supplierName",
|
||||
label: i18n.t('supplier.supplierName')
|
||||
},
|
||||
{
|
||||
prop: "lostHour",
|
||||
label: i18n.t('supplier.lostHour')
|
||||
},
|
||||
{
|
||||
prop: "place",
|
||||
label: i18n.t('supplier.place')
|
||||
},
|
||||
{
|
||||
prop: "problemBatch",
|
||||
label: i18n.t('supplier.problemBatch')
|
||||
},
|
||||
{
|
||||
prop: "problemDescription",
|
||||
label: i18n.t('supplier.problemDescription')
|
||||
},
|
||||
{
|
||||
prop: "rejectionRate",
|
||||
label: i18n.t('supplier.rejectionRate')
|
||||
},
|
||||
{
|
||||
prop: "closedLoop",
|
||||
label: i18n.t('supplier.closedLoop'),
|
||||
filter: supplier('whether'),
|
||||
}
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
btnName: i18n.t('t.edit'),
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
btnName: i18n.t('t.delete'),
|
||||
}
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage, basicSearch],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "/supplier/qmsQualityAccident/page",
|
||||
deleteURL: "/supplier/qmsQualityAccident",
|
||||
exportURL: '/supplier/qmsQualityAccident/export',
|
||||
getSupplierListURL: '/supplier/qmsSupplier/page'
|
||||
// submitURL: '/supplier/qmsSupplierType'
|
||||
},
|
||||
tableProps,
|
||||
closedLoop:null,
|
||||
ment: '',
|
||||
tableBtn,
|
||||
productData: {},
|
||||
dataForm:{
|
||||
limit: 999,
|
||||
page:1
|
||||
},
|
||||
searchOrEditTitle: "",
|
||||
searchOrUpdateVisible: false,
|
||||
productOrEditTitle: "",
|
||||
addOrEditTitle: '',
|
||||
addOrUpdateVisible: false,
|
||||
productOrUpdateVisible: false,
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: i18n.t('supplier.materialName'),
|
||||
placeholder: i18n.t('supplier.materialName'),
|
||||
param: 'productName'
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: i18n.t('supplier.supplierName'),
|
||||
selectOptions: [],
|
||||
param: 'supplierName',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: i18n.t('supplier.closedLoop'),
|
||||
selectOptions: [
|
||||
{
|
||||
id: '',
|
||||
name:'全部'
|
||||
},
|
||||
{
|
||||
id: 0,
|
||||
name: '否'
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
name: '是'
|
||||
}
|
||||
],
|
||||
param: 'closedLoop',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: i18n.t('supplier.problemDescription'),
|
||||
placeholder: i18n.t('supplier.problemDescription'),
|
||||
param: 'problemDescription'
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: i18n.t('supplier.applicationDate'),
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-ddTHH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeSlot',
|
||||
width: 350
|
||||
},
|
||||
// {
|
||||
// type: "",
|
||||
// label: i18n.t("params.paramCode"),
|
||||
// placeholder: i18n.t("params.paramCode"),
|
||||
// param: "paramCode",
|
||||
// },
|
||||
// {
|
||||
// type: "separate",
|
||||
// },
|
||||
{
|
||||
type: "button",
|
||||
btnName: i18n.t('search'),
|
||||
name: "search",
|
||||
color: "primary",
|
||||
// plain: true,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: i18n.t('add'),
|
||||
name: "add",
|
||||
color: "primary",
|
||||
// plain: true,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: i18n.t('export'),
|
||||
name: "export",
|
||||
color: "primary",
|
||||
// plain: true,
|
||||
}
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
supplierProductSearch,
|
||||
// supplierProduct,
|
||||
qualityAccidentAdd
|
||||
},
|
||||
mounted () {
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
inputChange(val) {
|
||||
console.log('=======')
|
||||
console.log(val)
|
||||
this.tableData[val._pageIndex - 1][val.prop] = val[val.prop]
|
||||
console.log(this.tableData)
|
||||
},
|
||||
emitButtonClick() {
|
||||
console.log('emitButtonClick')
|
||||
let obj = {}
|
||||
for (let i of this.tableData) {
|
||||
obj[i.prop] = ''
|
||||
}
|
||||
this.tableData.push(obj)
|
||||
},
|
||||
getData() {
|
||||
this.$http
|
||||
.get(this.urlOptions.getSupplierListURL, { params: this.listQuery })
|
||||
.then(({ data: res }) => {
|
||||
if (res.code === 0) {
|
||||
console.log(res.data);
|
||||
this.formConfig[1].selectOptions = res.data.list
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
})
|
||||
},
|
||||
//search-bar点击
|
||||
handleProductCancel() {
|
||||
this.productOrUpdateVisible = false;
|
||||
this.productOrEditTitle = "";
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
console.log(val);
|
||||
this.productData = val.newVal ? val.newVal : {}
|
||||
},
|
||||
setCurrent(index) {
|
||||
this.$refs.palletTable1.setCurrent("palletTable", index);
|
||||
},
|
||||
// handleSearchCancel() {
|
||||
// this.searchOrEditTitle = "";
|
||||
// this.searchOrUpdateVisible = false;
|
||||
// },
|
||||
conditionSearch() {
|
||||
this.searchOrEditTitle = "搜索";
|
||||
this.searchOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.searchOrUpdate.init();
|
||||
});
|
||||
},
|
||||
exportHandle() {
|
||||
this.$http.get(this.urlOptions.exportURL, { responseType: 'blob' }, {
|
||||
...this.dataForm
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
// if (res !== 0) {
|
||||
// return this.$message.error(res.msg)
|
||||
// }
|
||||
let fileName = ''
|
||||
const contentDisposition = res.headers['content-disposition']
|
||||
if (contentDisposition) {
|
||||
const temp = res.headers['content-disposition']
|
||||
.split(';')[1]
|
||||
.split('=')[1]
|
||||
// 对文件名乱码转义--【Node.js】使用iconv-lite解决中文乱码
|
||||
fileName = decodeURI(temp)
|
||||
console.log(temp)
|
||||
}
|
||||
const blob = new Blob([res.data])
|
||||
const reader = new FileReader()
|
||||
reader.readAsDataURL(blob)
|
||||
reader.onload = (e) => {
|
||||
const a = document.createElement('a')
|
||||
a.download = fileName
|
||||
a.href = e.target.result
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
document.body.removeChild(a)
|
||||
}
|
||||
}).catch(() => { })
|
||||
},
|
||||
// handleConfirm() {
|
||||
// this.$refs.addOrUpdate.dataFormSubmitHandle();
|
||||
// },
|
||||
// conditionSearchSubmit() {},
|
||||
conditionSearchSubmit(dataForm) {
|
||||
// console.log(key);
|
||||
// console.log(key);
|
||||
this.listQuery.supplierName = dataForm.supplierName
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
this.searchOrUpdateVisible = false;
|
||||
// console.log(11111);
|
||||
// this.conditionSearchSubmit();
|
||||
},
|
||||
handleClick(val) {
|
||||
if (val.type === "delete") {
|
||||
this.$confirm(`确定对[名称=${val.data.customerTypeName}]进行删除操作?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.$http.delete(this.urlOptions.deleteURL, { data: [val.data.id] }).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
} else if (val.type === 'edit') {
|
||||
this.addOrEditTitle = '修改'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id);
|
||||
});
|
||||
}
|
||||
},
|
||||
// addOrUpdateHandle(productData) {
|
||||
// this.addOrUpdateVisible = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.addOrUpdate.init(productData);
|
||||
// });
|
||||
// },
|
||||
buttonClick(val) {
|
||||
console.log(val)
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
// this.listQuery.paramCode = val.paramCode;
|
||||
this.listQuery.productName = val.productName ? val.productName : undefined
|
||||
this.listQuery.problemDescription = val.problemDescription ? val.problemDescription : undefined
|
||||
this.listQuery.closedLoop = closedLoop ? closedLoop : undefined
|
||||
this.listQuery.supplierName = val.supplierName ? val.supplierName : undefined
|
||||
this.listQuery.startTime = val.timeSlot ? val.timeSlot[0] : undefined
|
||||
this.listQuery.endTime = val.timeSlot ? val.timeSlot[1] : undefined
|
||||
// console.log(i18n);
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
default:
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
337
src/views/modules/supplier/qmsSupplier.vue
Normal file
337
src/views/modules/supplier/qmsSupplier.vue
Normal file
@@ -0,0 +1,337 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-04-17 14:23:17
|
||||
* @LastEditTime: 2023-04-18 15:19:18
|
||||
* @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-radio-group v-model="ment" size="small">
|
||||
<el-radio-button label="">{{ $t('all') }} </el-radio-button>
|
||||
<el-radio-button label="0">{{ $t('notAvailable') }} </el-radio-button>
|
||||
<el-radio-button label="1">{{ $t('available') }} </el-radio-button>
|
||||
</el-radio-group>
|
||||
</SearchBar>
|
||||
<base-table id="palletTable" :table-props="tableProps" :page="listQuery.page" ref="palletTable1"
|
||||
@emitFun="inputChange" @emitButtonClick="emitButtonClick" :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" />
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" @cancel="handleCancel"
|
||||
@confirm="handleConfirm" :before-close="handleCancel">
|
||||
<supplier-add ref="addOrUpdate" @refreshDataList="successSubmit">
|
||||
</supplier-add>
|
||||
<!-- <el-row slot="footer" type="flex" justify="end"> </el-row> -->
|
||||
</base-dialog>
|
||||
<base-dialog :dialogTitle="searchOrEditTitle" :dialogVisible="searchOrUpdateVisible" @cancel="handleSearchCancel"
|
||||
@confirm="handleSearchConfirm" :before-close="handleSearchCancel">
|
||||
<supplierProduct-search ref="searchOrUpdate" @successSubmit="conditionSearchSubmit">
|
||||
</supplierProduct-search>
|
||||
<el-row slot="footer" type="flex" justify="end">
|
||||
<el-col :span="12">
|
||||
<el-button size="small" type="primary" plain class="btnTextStyle" @click="handleSearchCancel">
|
||||
{{ $t("close") }}
|
||||
</el-button>
|
||||
<el-button size="small" class="btnTextStyle" type="primary" plain @click="handleSearchReset">{{
|
||||
$t("reset")
|
||||
}}</el-button>
|
||||
<el-button type="primary" size="small" class="btnTextStyle" @click="handleSearchConfirm">
|
||||
{{ $t("search") }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from "@/mixins/basic-page"
|
||||
import basicSearch from "@/mixins/basic-search"
|
||||
import supplierProductSearch from "./components/supplierProductSearch.vue"
|
||||
import supplierAdd from "./components/supplier-add.vue"
|
||||
import inputArea from "./components/inputArea"
|
||||
import innerTable from "./components/innerTable"
|
||||
// import available from "./components/available.vue"
|
||||
// import radio from "./components/radio.vue"
|
||||
import i18n from "@/i18n"
|
||||
// import i18n from "@/i18n";
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "detail",
|
||||
label:'',
|
||||
subcomponent: innerTable,
|
||||
},
|
||||
{
|
||||
prop: "code",
|
||||
label: i18n.t('supplier.code'),
|
||||
},
|
||||
{
|
||||
prop: "name",
|
||||
label: i18n.t('supplier.name'),
|
||||
subcomponent: inputArea,
|
||||
},
|
||||
{
|
||||
prop: "abbreviation",
|
||||
label: i18n.t('supplier.abbreviation'),
|
||||
},
|
||||
{
|
||||
prop: "grade",
|
||||
label: i18n.t('supplier.grade'),
|
||||
},
|
||||
{
|
||||
prop: "address",
|
||||
label: i18n.t('supplier.address'),
|
||||
},
|
||||
{
|
||||
prop: "ment",
|
||||
label: i18n.t('supplier.ment'),
|
||||
}
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
btnName: i18n.t('t.edit'),
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
btnName: i18n.t('t.delete'),
|
||||
}
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage, basicSearch],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "/supplier/qmsSupplier/page",
|
||||
deleteURL: "/supplier/qmsSupplier",
|
||||
exportURL: '/supplier/qmsSupplier/export',
|
||||
getSupplierTypeListURL: '/supplier/qmsSupplierType/page'
|
||||
// submitURL: '/supplier/qmsSupplierType'
|
||||
},
|
||||
tableProps,
|
||||
ment: '',
|
||||
tableBtn,
|
||||
productData: {},
|
||||
dataForm:{
|
||||
limit: 999,
|
||||
page:1
|
||||
},
|
||||
searchOrEditTitle: "",
|
||||
searchOrUpdateVisible: false,
|
||||
productOrEditTitle: "",
|
||||
addOrEditTitle: '',
|
||||
addOrUpdateVisible: false,
|
||||
productOrUpdateVisible: false,
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: i18n.t('supplier.name'),
|
||||
placeholder: i18n.t('supplier.name'),
|
||||
param: 'supplierName'
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: i18n.t('supplier.abbreviation'),
|
||||
placeholder: i18n.t('supplier.abbreviation'),
|
||||
param: ''
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: i18n.t('supplier.supplierType'),
|
||||
selectOptions: [],
|
||||
param: 'supplierTypeId',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: i18n.t('supplier.ment'),
|
||||
selectOptions: [
|
||||
{ id: 0, name: '合格' },
|
||||
{ id: 1, name: '不合格' },
|
||||
{ id: 2, name: '黑名单' }
|
||||
],
|
||||
param: 'supplierStatus',
|
||||
clearable: true,
|
||||
filterable: true
|
||||
},
|
||||
// {
|
||||
// type: "",
|
||||
// label: i18n.t("params.paramCode"),
|
||||
// placeholder: i18n.t("params.paramCode"),
|
||||
// param: "paramCode",
|
||||
// },
|
||||
// {
|
||||
// type: "separate",
|
||||
// },
|
||||
{
|
||||
type: "button",
|
||||
btnName: i18n.t('search'),
|
||||
name: "search",
|
||||
color: "primary",
|
||||
// plain: true,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: i18n.t('add'),
|
||||
name: "add",
|
||||
color: "primary",
|
||||
// plain: true,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: i18n.t('export'),
|
||||
name: "export",
|
||||
color: "primary",
|
||||
// plain: true,
|
||||
}
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
supplierProductSearch,
|
||||
// supplierProduct,
|
||||
supplierAdd
|
||||
},
|
||||
mounted () {
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
inputChange(val) {
|
||||
console.log('=======')
|
||||
console.log(val)
|
||||
this.tableData[val._pageIndex - 1][val.prop] = val[val.prop]
|
||||
console.log(this.tableData)
|
||||
},
|
||||
emitButtonClick() {
|
||||
console.log('emitButtonClick')
|
||||
let obj = {}
|
||||
for (let i of this.tableData) {
|
||||
obj[i.prop] = ''
|
||||
}
|
||||
this.tableData.push(obj)
|
||||
},
|
||||
getData() {
|
||||
this.$http
|
||||
.get(this.urlOptions.getSupplierTypeListURL, { params: this.listQuery })
|
||||
.then(({ data: res }) => {
|
||||
if (res.code === 0) {
|
||||
console.log(res.data);
|
||||
this.formConfig[2].selectOptions = res.data.list
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
})
|
||||
},
|
||||
//search-bar点击
|
||||
handleProductCancel() {
|
||||
this.productOrUpdateVisible = false;
|
||||
this.productOrEditTitle = "";
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
console.log(val);
|
||||
this.productData = val.newVal ? val.newVal : {}
|
||||
},
|
||||
setCurrent(index) {
|
||||
this.$refs.palletTable1.setCurrent("palletTable", index);
|
||||
},
|
||||
// handleSearchCancel() {
|
||||
// this.searchOrEditTitle = "";
|
||||
// this.searchOrUpdateVisible = false;
|
||||
// },
|
||||
conditionSearch() {
|
||||
this.searchOrEditTitle = "搜索";
|
||||
this.searchOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.searchOrUpdate.init();
|
||||
});
|
||||
},
|
||||
// handleConfirm() {
|
||||
// this.$refs.addOrUpdate.dataFormSubmitHandle();
|
||||
// },
|
||||
// conditionSearchSubmit() {},
|
||||
conditionSearchSubmit(dataForm) {
|
||||
// console.log(key);
|
||||
// console.log(key);
|
||||
this.listQuery.supplierName = dataForm.supplierName
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
this.searchOrUpdateVisible = false;
|
||||
// console.log(11111);
|
||||
// this.conditionSearchSubmit();
|
||||
},
|
||||
handleClick(val) {
|
||||
if (val.type === "delete") {
|
||||
this.$confirm(`确定对[名称=${val.data.customerTypeName}]进行删除操作?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.$http.delete(this.urlOptions.deleteURL, { data: [val.data.id] }).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
} else if (val.type === 'edit') {
|
||||
this.addOrEditTitle = '修改'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id);
|
||||
});
|
||||
}
|
||||
},
|
||||
// addOrUpdateHandle(productData) {
|
||||
// this.addOrUpdateVisible = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.addOrUpdate.init(productData);
|
||||
// });
|
||||
// },
|
||||
buttonClick(val) {
|
||||
console.log(val)
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
// this.listQuery.paramCode = val.paramCode;
|
||||
this.listQuery.supplierName = val.supplierName ? val.supplierName : undefined
|
||||
this.listQuery.supplierStatus = val.supplierStatus ? val.supplierStatus : undefined
|
||||
this.listQuery.supplierTypeId = val.supplierTypeId ? val.supplierTypeId : undefined
|
||||
this.listQuery.ment = this.ment ? this.ment : undefined
|
||||
// console.log(i18n);
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "export":
|
||||
// this.listQuery.paramCode = val.paramCode;
|
||||
this.exportHandle()
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
default:
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
238
src/views/modules/supplier/qmsSupplierProduct.vue
Normal file
238
src/views/modules/supplier/qmsSupplierProduct.vue
Normal file
@@ -0,0 +1,238 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-04-17 14:23:17
|
||||
* @LastEditTime: 2023-04-17 15:27:42
|
||||
* @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-badge :value="2" class="item">
|
||||
<el-button type="primary" size="small" @click="conditionSearch">条件搜索</el-button>
|
||||
</el-badge>
|
||||
</SearchBar>
|
||||
<base-table id="palletTable" :table-props="tableProps" :page="listQuery.page" ref="palletTable1"
|
||||
highlight-current-row :limit="listQuery.limit" :table-data="tableData" @current-change="handleCurrentChange">
|
||||
<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" />
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" @cancel="handleCancel"
|
||||
@confirm="handleConfirm" :before-close="handleCancel">
|
||||
<supplier-product ref="addOrUpdate" @refreshDataList="successSubmit">
|
||||
</supplier-product>
|
||||
<!-- <el-row slot="footer" type="flex" justify="end"> </el-row> -->
|
||||
</base-dialog>
|
||||
<base-dialog :dialogTitle="searchOrEditTitle" :dialogVisible="searchOrUpdateVisible" @cancel="handleSearchCancel"
|
||||
@confirm="handleSearchConfirm" :before-close="handleSearchCancel">
|
||||
<supplierProduct-search ref="searchOrUpdate" @successSubmit="conditionSearchSubmit">
|
||||
</supplierProduct-search>
|
||||
<el-row slot="footer" type="flex" justify="end">
|
||||
<el-col :span="12">
|
||||
<el-button size="small" type="primary" plain class="btnTextStyle" @click="handleSearchCancel">
|
||||
{{ $t("close") }}
|
||||
</el-button>
|
||||
<el-button size="small" class="btnTextStyle" type="primary" plain @click="handleSearchReset">{{
|
||||
$t("reset")
|
||||
}}</el-button>
|
||||
<el-button type="primary" size="small" class="btnTextStyle" @click="handleSearchConfirm">
|
||||
{{ $t("search") }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from "@/mixins/basic-page"
|
||||
import basicSearch from "@/mixins/basic-search"
|
||||
import supplierProductSearch from "./components/supplierProductSearch.vue"
|
||||
import supplierProduct from "./components/supplierProduct.vue"
|
||||
// import available from "./components/available.vue"
|
||||
// import radio from "./components/radio.vue"
|
||||
import i18n from "@/i18n"
|
||||
// import i18n from "@/i18n";
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "supplierCode",
|
||||
label: i18n.t('supplier.supplierCode'),
|
||||
},
|
||||
{
|
||||
prop: "supplierName",
|
||||
label: i18n.t('supplier.supplierName'),
|
||||
},
|
||||
{
|
||||
prop: "productCode",
|
||||
label: i18n.t('supplier.productCode'),
|
||||
},
|
||||
{
|
||||
prop: "productName",
|
||||
label: i18n.t('supplier.productName'),
|
||||
}
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
btnName: i18n.t('t.edit'),
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
btnName: i18n.t('t.delete'),
|
||||
}
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage, basicSearch],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "supplier/qmsSupplierProduct/page",
|
||||
deleteURL: "supplier/qmsSupplierProduct",
|
||||
// exportURL: '/supplier/qmsSupplierType/export',
|
||||
// submitURL: '/supplier/qmsSupplierType'
|
||||
},
|
||||
tableProps,
|
||||
tableBtn,
|
||||
productData: {},
|
||||
dataForm:{
|
||||
limit: 999,
|
||||
page:1
|
||||
},
|
||||
searchOrEditTitle: "",
|
||||
searchOrUpdateVisible: false,
|
||||
productOrEditTitle: "",
|
||||
addOrEditTitle: '',
|
||||
addOrUpdateVisible: false,
|
||||
productOrUpdateVisible: false,
|
||||
formConfig: [
|
||||
// {
|
||||
// type: "",
|
||||
// label: i18n.t("params.paramCode"),
|
||||
// placeholder: i18n.t("params.paramCode"),
|
||||
// param: "paramCode",
|
||||
// },
|
||||
// {
|
||||
// type: "separate",
|
||||
// },
|
||||
{
|
||||
type: "button",
|
||||
btnName: i18n.t('supplier.supplierRelevance'),
|
||||
name: "supplierRelevance",
|
||||
color: "primary",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: i18n.t('search'),
|
||||
name: "search",
|
||||
color: "primary",
|
||||
// plain: true,
|
||||
}
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
supplierProductSearch,
|
||||
supplierProduct
|
||||
},
|
||||
methods: {
|
||||
//search-bar点击
|
||||
handleProductCancel() {
|
||||
this.productOrUpdateVisible = false;
|
||||
this.productOrEditTitle = "";
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
console.log(val);
|
||||
this.productData = val.newVal ? val.newVal : {}
|
||||
},
|
||||
setCurrent(index) {
|
||||
this.$refs.palletTable1.setCurrent("palletTable", index);
|
||||
},
|
||||
// handleSearchCancel() {
|
||||
// this.searchOrEditTitle = "";
|
||||
// this.searchOrUpdateVisible = false;
|
||||
// },
|
||||
conditionSearch() {
|
||||
this.searchOrEditTitle = "搜索";
|
||||
this.searchOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.searchOrUpdate.init();
|
||||
});
|
||||
},
|
||||
// handleConfirm() {
|
||||
// this.$refs.addOrUpdate.dataFormSubmitHandle();
|
||||
// },
|
||||
// conditionSearchSubmit() {},
|
||||
conditionSearchSubmit(dataForm) {
|
||||
// console.log(key);
|
||||
// console.log(key);
|
||||
this.listQuery.supplierName = dataForm.supplierName
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
this.searchOrUpdateVisible = false;
|
||||
// console.log(11111);
|
||||
// this.conditionSearchSubmit();
|
||||
},
|
||||
handleClick(val) {
|
||||
if (val.type === "delete") {
|
||||
this.$confirm(`确定对[名称=${val.data.customerTypeName}]进行删除操作?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.$http.delete(this.urlOptions.deleteURL, { data: [val.data.id] }).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
} else if (val.type === 'edit') {
|
||||
this.addOrEditTitle = '修改'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id);
|
||||
});
|
||||
}
|
||||
},
|
||||
// addOrUpdateHandle(productData) {
|
||||
// this.addOrUpdateVisible = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.addOrUpdate.init(productData);
|
||||
// });
|
||||
// },
|
||||
buttonClick(val) {
|
||||
console.log(val);
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
// this.listQuery.paramCode = val.paramCode;
|
||||
this.listQuery.key = null;
|
||||
// console.log(i18n);
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "supplierRelevance":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
default:
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
304
src/views/modules/supplier/qmsSupplierType.vue
Normal file
304
src/views/modules/supplier/qmsSupplierType.vue
Normal file
@@ -0,0 +1,304 @@
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<SearchBar :formConfigs="formConfig" ref="ruleForm" @headBtnClick="buttonClick">
|
||||
<el-badge :value="2" class="item">
|
||||
<el-button type="primary" size="small" @click="conditionSearch">条件搜索</el-button>
|
||||
</el-badge>
|
||||
</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>
|
||||
<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">
|
||||
<supplierType-add ref="addOrUpdate" @refreshDataList="successSubmit">
|
||||
</supplierType-add>
|
||||
<!-- <el-row slot="footer" type="flex" justify="end"> </el-row> -->
|
||||
</base-dialog>
|
||||
<base-dialog :dialogTitle="searchOrEditTitle" :dialogVisible="searchOrUpdateVisible" @cancel="handleSearchCancel"
|
||||
@confirm="handleSearchConfirm" :before-close="handleSearchCancel">
|
||||
<supplierType-search ref="searchOrUpdate" @successSubmit="conditionSearchSubmit">
|
||||
</supplierType-search>
|
||||
<el-row slot="footer" type="flex" justify="end">
|
||||
<el-col :span="12">
|
||||
<el-button size="small" type="primary" plain class="btnTextStyle" @click="handleSearchCancel">
|
||||
{{ $t("close") }}
|
||||
</el-button>
|
||||
<el-button size="small" class="btnTextStyle" type="primary" plain @click="handleSearchReset">{{
|
||||
$t("reset")
|
||||
}}</el-button>
|
||||
<el-button type="primary" size="small" class="btnTextStyle" @click="handleSearchConfirm">
|
||||
{{ $t("search") }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from "@/mixins/basic-page"
|
||||
import basicSearch from "@/mixins/basic-search"
|
||||
import supplierTypeSearch from "./components/supplierTypeSearch.vue"
|
||||
import supplierTypeAdd from "./components/supplierType-add.vue"
|
||||
import available from "./components/available.vue"
|
||||
import radio from "./components/radio.vue"
|
||||
import i18n from "@/i18n"
|
||||
// import i18n from "@/i18n";
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "code",
|
||||
label: i18n.t('supplier.code'),
|
||||
},
|
||||
{
|
||||
prop: "name",
|
||||
label: i18n.t('supplier.name'),
|
||||
},
|
||||
{
|
||||
prop: "supplierTypeStatus",
|
||||
label: i18n.t('supplier.status'),
|
||||
subcomponent: available,
|
||||
}
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
btnName: i18n.t('edit'),
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
btnName: i18n.t('delete'),
|
||||
},
|
||||
{
|
||||
type: "changeStatus",
|
||||
btnName: i18n.t('changeStatus'),
|
||||
}
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage, basicSearch],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "/supplier/qmsSupplierType/page",
|
||||
deleteURL: "/supplier/qmsSupplierType",
|
||||
exportURL: '/supplier/qmsSupplierType/export',
|
||||
submitURL: '/supplier/qmsSupplierType'
|
||||
},
|
||||
tableProps,
|
||||
tableBtn,
|
||||
productData: {},
|
||||
dataForm:{
|
||||
limit: 999,
|
||||
page:1
|
||||
},
|
||||
searchOrEditTitle: "",
|
||||
searchOrUpdateVisible: false,
|
||||
productOrEditTitle: "",
|
||||
addOrEditTitle: '',
|
||||
addOrUpdateVisible: false,
|
||||
productOrUpdateVisible: false,
|
||||
formConfig: [
|
||||
// {
|
||||
// type: "",
|
||||
// label: i18n.t("params.paramCode"),
|
||||
// placeholder: i18n.t("params.paramCode"),
|
||||
// param: "paramCode",
|
||||
// },
|
||||
// {
|
||||
// type: "separate",
|
||||
// },
|
||||
{
|
||||
type: "button",
|
||||
btnName: i18n.t('add'),
|
||||
name: "add",
|
||||
color: "primary",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: i18n.t('search'),
|
||||
name: "search",
|
||||
color: "primary",
|
||||
// plain: true,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: i18n.t('export'),
|
||||
name: "export",
|
||||
color: "primary",
|
||||
// plain: true,
|
||||
}
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
supplierTypeSearch,
|
||||
supplierTypeAdd
|
||||
},
|
||||
methods: {
|
||||
//search-bar点击
|
||||
handleProductCancel() {
|
||||
this.productOrUpdateVisible = false;
|
||||
this.productOrEditTitle = "";
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
console.log(val);
|
||||
this.productData = val.newVal ? val.newVal : {}
|
||||
},
|
||||
setCurrent(index) {
|
||||
this.$refs.palletTable1.setCurrent("palletTable", index);
|
||||
},
|
||||
// handleSearchCancel() {
|
||||
// this.searchOrEditTitle = "";
|
||||
// this.searchOrUpdateVisible = false;
|
||||
// },
|
||||
conditionSearch() {
|
||||
this.searchOrEditTitle = "搜索";
|
||||
this.searchOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.searchOrUpdate.init();
|
||||
});
|
||||
},
|
||||
// handleConfirm() {
|
||||
// this.$refs.addOrUpdate.dataFormSubmitHandle();
|
||||
// },
|
||||
// conditionSearchSubmit() {},
|
||||
conditionSearchSubmit(dataForm) {
|
||||
// console.log(key);
|
||||
// console.log(key);
|
||||
this.listQuery.name = dataForm.name
|
||||
this.listQuery.code = dataForm.code
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
this.searchOrUpdateVisible = false;
|
||||
// console.log(11111);
|
||||
// this.conditionSearchSubmit();
|
||||
},
|
||||
exportHandle() {
|
||||
this.$http.get(this.urlOptions.exportURL, { responseType: 'blob' }, {
|
||||
...this.dataForm
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
// if (res !== 0) {
|
||||
// return this.$message.error(res.msg)
|
||||
// }
|
||||
let fileName = ''
|
||||
const contentDisposition = res.headers['content-disposition']
|
||||
if (contentDisposition) {
|
||||
const temp = res.headers['content-disposition']
|
||||
.split(';')[1]
|
||||
.split('=')[1]
|
||||
// 对文件名乱码转义--【Node.js】使用iconv-lite解决中文乱码
|
||||
fileName = decodeURI(temp)
|
||||
console.log(temp)
|
||||
}
|
||||
const blob = new Blob([res.data])
|
||||
const reader = new FileReader()
|
||||
reader.readAsDataURL(blob)
|
||||
reader.onload = (e) => {
|
||||
const a = document.createElement('a')
|
||||
a.download = fileName
|
||||
a.href = e.target.result
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
document.body.removeChild(a)
|
||||
}
|
||||
}).catch(() => { })
|
||||
},
|
||||
handleClick(val) {
|
||||
if (val.type === "delete") {
|
||||
this.$confirm(`确定对[名称=${val.data.customerTypeName}]进行删除操作?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.$http.delete(this.urlOptions.deleteURL, { data: [val.data.id] }).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
} else if (val.type === 'edit') {
|
||||
this.addOrEditTitle = '修改'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id);
|
||||
});
|
||||
}else if (val.type === 'changeStatus') {
|
||||
this.$confirm('你确定要进行此操作吗, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http.put(this.urlOptions.submitURL, {
|
||||
code: val.data.code,
|
||||
name: val.data.name,
|
||||
id: val.data.id,
|
||||
supplierTypeStatus: val.data.supplierTypeStatus=== 1? 0 :1
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '修改成功!'
|
||||
});
|
||||
this.getDataList()
|
||||
})
|
||||
.catch(() => { });
|
||||
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消'
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
// addOrUpdateHandle(productData) {
|
||||
// this.addOrUpdateVisible = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.addOrUpdate.init(productData);
|
||||
// });
|
||||
// },
|
||||
buttonClick(val) {
|
||||
console.log(val);
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
// this.listQuery.paramCode = val.paramCode;
|
||||
this.listQuery.key = null;
|
||||
// console.log(i18n);
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "export":
|
||||
this.exportHandle()
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
default:
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user