This commit is contained in:
2023-10-08 15:58:29 +08:00
parent b4ffb20ba8
commit 51f101ea4e
77 changed files with 1378 additions and 947 deletions

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2022-08-24 11:19:43
* @LastEditors: zwq
* @LastEditTime: 2023-09-05 15:10:13
* @LastEditTime: 2023-10-08 10:44:25
* @Description:
*/
export default {
@@ -39,7 +39,7 @@ export default {
if(bPage){
this.dataForm.warehouseId = this.bId;
}else{
this.dataForm.warehouseId = this.bId;
this.dataForm.warehouseId = this.aId;
}
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
@@ -90,17 +90,25 @@ export default {
// 修改的提交
if (this.dataForm.id) {
this.urlOptions.updateURL(this.dataForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.visible = false;
this.$emit("refreshDataList");
if(response.data){
this.$modal.msgSuccess("修改成功");
this.visible = false;
this.$emit("refreshDataList");
}else{
this.$modal.msgWarning('名称或编码不能重复');;
}
});
return;
}
// 添加的提交
this.urlOptions.createURL(this.dataForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.visible = false;
this.$emit("refreshDataList");
if(response.data){
this.$modal.msgSuccess("新增成功");
this.visible = false;
this.$emit("refreshDataList");
}else{
this.$modal.msgWarning('名称或编码不能重复');;
}
});
});
},

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2022-08-24 11:19:43
* @LastEditors: zwq
* @LastEditTime: 2023-09-05 15:10:24
* @LastEditTime: 2023-09-26 14:00:22
* @Description:
*/
export default {
@@ -42,7 +42,7 @@ export default {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data.list;
this.total = response.data.total;
this.listQuery.total = response.data.total;
this.dataListLoading = false;
});
},

View File

@@ -2,7 +2,7 @@
/*
* @Date: 2020-12-29 16:49:28
* @LastEditors: zwq
* @LastEditTime: 2023-09-07 14:10:53
* @LastEditTime: 2023-10-07 14:32:52
* @FilePath: \basic-admin\src\filters\basicData\index.js
* @Description:
*/
@@ -47,6 +47,9 @@ const table = {
1: '否',
2: '是',
},
specification:{
0: '卷',
},
}
// 日期格式化
@@ -91,6 +94,20 @@ export function parseTime(time, pattern) {
})
return time_str
}
// 去除浮点相乘
export function mul(num1, num2) {
if (parseFloat(num1).toString() == "NaN" || parseFloat(num2).toString() == "NaN") return;
var m = 0, s1 = num1.toString(), s2 = num2.toString();
try {
m += s1.split(".")[1].length
} catch (e) {
}
try {
m += s2.split(".")[1].length
} catch (e) {
}
return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m);
}
export default function (dictTable) {
return function (val) {
return table?.[dictTable]?.[val]

View File

@@ -0,0 +1,46 @@
<!--
* @Author: zwq
* @Date: 2023-09-22 15:36:40
* @LastEditors: zwq
* @LastEditTime: 2023-09-26 15:59:57
* @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() {
this.list.sType = 1
this.$emit("emitData", this.list,1);
},
},
};
</script>
<style scoped>
.tableInner >>> .el-input__inner {
color: #409EFF;
border: 1px rgb(232, 231, 231) solid;
padding: 0;
text-align: center;
height: 30px;
}
</style>

View File

@@ -0,0 +1,59 @@
<template>
<div class="tableInner">
<el-select v-model="list[itemProp]" @change="changeInput">
<el-option
v-for="item in QArr"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
</template>
<script>
export default {
name: 'InputArea',
props: {
injectData: {
type: Object,
default: () => ({}),
},
itemProp: {
type: String,
},
},
data() {
return {
list: this.injectData,
QArr: [
{
name: 'A',
id: 0,
},
{
name: 'B',
id: 1,
},
{
name: 'C',
id: 2,
},
],
};
},
methods: {
changeInput() {
this.list.sType = 1;
this.$emit('emitData', this.list);
},
},
};
</script>
<style scoped>
.tableInner >>> .el-input__inner {
color: #409EFF;
border: 1px rgb(232, 231, 231) solid;
padding: 0;
text-align: center;
height: 30px;
}
</style>