Commit f82b7afa by xin.yang

fix bug

parent 1d7315b5
......@@ -716,7 +716,7 @@ export default {
'9000491': '人员未找到',
'9000492': '默认展示已存在',
'9000493': '未找到储位类别',
'9000494': '未找到工装类',
'9000494': '未找到工装类',
'9000495': '未找到工装信息',
'9000496': 'ID重复',
'9000497': '父级和子级不能相同',
......
......@@ -743,7 +743,7 @@ export default {
'9000491': '人员未找到',
'9000492': '默认展示已存在',
'9000493': '未找到储位类别',
'9000494': '未找到工装类',
'9000494': '未找到工装类',
'9000495': '未找到工装信息',
'9000496': 'ID重复',
'9000497': '父级和子级不能相同',
......
......@@ -71,8 +71,8 @@
@click="loadExcel()"
>{{ $t("1005") }}</Button
>
<!-- <Upload
style="display: inline-block"
<Upload
style="display:inline-block"
ref="upload"
:action="action"
name="excel-file"
......@@ -81,15 +81,14 @@
:on-format-error="handleFormatError"
:on-success="handleSuccess"
:on-error="handleError"
:format="['xlsx']"
> -->
:format="['xlsx','xls']"
>
<Button
type="primary"
class="fourWord"
icon="md-cloud-upload"
>{{ $t("1006") }}</Button
>
<!-- </Upload> -->
>{{$t('1006')}}</Button>
</Upload>
<Button
type="primary"
class="fourWord"
......@@ -260,7 +259,7 @@ export default {
//导入方法
action:
this.axios.publicPath +
"acc/Upload/Submit?templateName=FixtureToolsAssmeblyTemplate",
"acc/Upload/UploadExcel?templateName=FixtureToolsAssmeblyTemplate",
headers: {
token: localStorage.getItem("token"),
timestamp: localStorage.getItem("timestamp"),
......@@ -810,6 +809,26 @@ export default {
.catch((error) => error);
}
},
handleFormatError(file) {
this.$Message.error(
this.$t("950396") + file.name + this.$t("950397")
);
},
handleSuccess(res, file) {
if (res.ret == 1) {
this.$Message.success(this.$t("950398"));
this.tosearch();
} else {
if ((res.msg + "").indexOf(",") != -1) {
inittip(res.msg);
} else {
this.$Message.error(this.$t(res.data));
}
}
},
handleError() {
this.$Message.error(this.$t("2010006") + "!");
},
},
};
</script>
......
......@@ -150,7 +150,7 @@ export default {
data(){
return {
//导入方法
action: this.axios.publicPath + "acc/Upload/Submit?templateName=FixtureToolsProductTemplate",
action: this.axios.publicPath + "acc/Upload/UploadExcel?templateName=FixtureToolsProductTemplate",
headers: {
token: localStorage.getItem("token"),
timestamp: localStorage.getItem("timestamp"),
......
......@@ -154,7 +154,7 @@ export default {
data(){
return {
//导入方法
action: this.axios.publicPath + "acc/Upload/Submit?templateName=FixtureToolsTemplate",
action: this.axios.publicPath + "acc/Upload/UploadExcel?templateName=FixtureToolsTemplate",
headers: {
token: localStorage.getItem("token"),
timestamp: localStorage.getItem("timestamp"),
......
......@@ -86,7 +86,7 @@ export default {
data(){
return{
//导入方法
action: this.axios.publicPath + "acc/Upload/Submit?templateName=FixtureToolsCategoryTemplate",
action: this.axios.publicPath + "acc/Upload/UploadExcel?templateName=FixtureToolsCategoryTemplate",
headers: {
token: localStorage.getItem("token"),
timestamp: localStorage.getItem("timestamp"),
......
......@@ -275,7 +275,7 @@ export default {
addremark:'',//备注
filename:'',
fileurl:'',
action: this.axios.publicPath + "acc/Upload/Submit?templateName=AutomationLocationTemplate",
action: this.axios.publicPath + "acc/Upload/UploadExcel?templateName=AutomationLocationTemplate",
UploadAction: this.axios.publicPath + "config/upload/UploadImage",
headers: {
token: localStorage.getItem("token"),
......
......@@ -1465,7 +1465,7 @@ namespace Siger.Middlelayer.Common
[Description("未找到储位类别")]
LocationTypeNotFound,
[Description("未找到工装类")]
[Description("未找到工装类")]
FixtureToolCatgeoryNotFound,
[Description("未找到工装信息")]
......
......@@ -103,6 +103,8 @@ namespace Siger.Middlelayer.AccRepository.Repositories
name = item.Fixture,
parent = parent,
createtime = DateTime.Now,
updatetime = DateTime.Now,
projectId = projectid
};
_context.siger_automation_fixture_tools_category.Add(entity);
_context.SaveChanges();
......
......@@ -161,7 +161,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
{
errors.Add($"{rowIndex},{(int)RequestEnum.FixtureToolNotFound}");
}
var product = _context.siger_project_product.FirstOrDefault(q => q.projectid == projectid && q.status == (int)RowState.Valid && q.code == item.Product);
var product = _context.siger_project_product.FirstOrDefault(q => q.projectid == projectid && q.status == (int)RowState.Valid && q.name == item.Product);
if (product == null)
{
errors.Add($"{rowIndex},{(int)RequestEnum.ProductNotFound}");
......
......@@ -157,7 +157,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
errors.Add($"{rowIndex},{(int)RequestEnum.DataExist}");
}
var category = _context.siger_automation_fixture_tools.FirstOrDefault(q => q.name == item.Catgeory && q.projectId == projectid && q.status == (int)RowState.Valid);
var category = _context.siger_automation_fixture_tools_category.FirstOrDefault(q => q.name == item.Catgeory && q.projectId == projectid && q.status == (int)RowState.Valid);
if (category == null)
{
errors.Add($"{rowIndex},{(int)RequestEnum.FixtureToolCatgeoryNotFound}");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment