zi-ming-ui 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/babel.config.js +5 -0
- package/jsconfig.json +19 -0
- package/package.json +48 -12
- package/public/favicon.ico +0 -0
- package/public/index.html +17 -0
- package/src/App.vue +52 -0
- package/src/assets/logo.png +0 -0
- package/src/components/HelloWorld.vue +58 -0
- package/src/main.js +12 -0
- package/src/package/appearance-damage-report/api/DamageProds.js +55 -0
- package/src/package/appearance-damage-report/api/DamageRecord.js +51 -0
- package/src/package/appearance-damage-report/api/DamageType.js +50 -0
- package/src/package/appearance-damage-report/index.vue +159 -0
- package/src/package/appearance-damage-report/utils/request.js +22 -0
- package/src/package/horiz-radio-self-naming/index.vue +689 -0
- package/src/package/index.js +13 -0
- package/src/package/public-js/index.js +4 -0
- package/src/package/public-js/letter.js +10 -0
- package/src/package/public-js/num.js +5 -0
- package/src/package/tips/index.vue +46 -0
- package/vue.config.js +9 -0
- package/zi-ming-ui/zi-ming-ui.common.js.map +1 -0
- package/zi-ming-ui.common.js.map +0 -1
- /package/{demo.html → zi-ming-ui/demo.html} +0 -0
- /package/{zi-ming-ui.common.js → zi-ming-ui/zi-ming-ui.common.js} +0 -0
- /package/{zi-ming-ui.css → zi-ming-ui/zi-ming-ui.css} +0 -0
- /package/{zi-ming-ui.umd.js → zi-ming-ui/zi-ming-ui.umd.js} +0 -0
- /package/{zi-ming-ui.umd.js.map → zi-ming-ui/zi-ming-ui.umd.js.map} +0 -0
- /package/{zi-ming-ui.umd.min.js → zi-ming-ui/zi-ming-ui.umd.min.js} +0 -0
- /package/{zi-ming-ui.umd.min.js.map → zi-ming-ui/zi-ming-ui.umd.min.js.map} +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# my-app
|
|
2
|
+
|
|
3
|
+
## Project setup
|
|
4
|
+
```
|
|
5
|
+
npm install
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
### Compiles and hot-reloads for development
|
|
9
|
+
```
|
|
10
|
+
npm run serve
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Compiles and minifies for production
|
|
14
|
+
```
|
|
15
|
+
npm run build
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Lints and fixes files
|
|
19
|
+
```
|
|
20
|
+
npm run lint
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Customize configuration
|
|
24
|
+
See [Configuration Reference](https://cli.vuejs.org/config/).
|
package/babel.config.js
ADDED
package/jsconfig.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es5",
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"baseUrl": "./",
|
|
6
|
+
"moduleResolution": "node",
|
|
7
|
+
"paths": {
|
|
8
|
+
"@/*": [
|
|
9
|
+
"src/*"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"lib": [
|
|
13
|
+
"esnext",
|
|
14
|
+
"dom",
|
|
15
|
+
"dom.iterable",
|
|
16
|
+
"scripthost"
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,48 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "zi-ming-ui",
|
|
3
|
-
|
|
4
|
-
"
|
|
5
|
-
"main": "zi-ming-ui.common.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "zi-ming-ui",
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"private": false,
|
|
5
|
+
"main": "package/zi-ming-ui.common.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"serve": "vue-cli-service serve",
|
|
8
|
+
"build": "vue-cli-service build",
|
|
9
|
+
"lint": "vue-cli-service lint",
|
|
10
|
+
"package": "vue-cli-service build --target lib ./src/package/index.js --name zi-ming-ui --dest zi-ming-ui"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"axios": "^1.13.6",
|
|
14
|
+
"core-js": "^3.8.3",
|
|
15
|
+
"vue": "^3.2.13",
|
|
16
|
+
"zsl-ui-test": "^1.0.6",
|
|
17
|
+
"zi-ming-ui": "^1.0.2"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@babel/core": "^7.12.16",
|
|
21
|
+
"@babel/eslint-parser": "^7.12.16",
|
|
22
|
+
"@vue/cli-plugin-babel": "~5.0.0",
|
|
23
|
+
"@vue/cli-plugin-eslint": "~5.0.0",
|
|
24
|
+
"@vue/cli-service": "4.4.6",
|
|
25
|
+
"eslint": "^7.32.0",
|
|
26
|
+
"eslint-plugin-vue": "^8.0.3"
|
|
27
|
+
},
|
|
28
|
+
"eslintConfig": {
|
|
29
|
+
"root": true,
|
|
30
|
+
"env": {
|
|
31
|
+
"node": true
|
|
32
|
+
},
|
|
33
|
+
"extends": [
|
|
34
|
+
"plugin:vue/vue3-essential",
|
|
35
|
+
"eslint:recommended"
|
|
36
|
+
],
|
|
37
|
+
"parserOptions": {
|
|
38
|
+
"parser": "@babel/eslint-parser"
|
|
39
|
+
},
|
|
40
|
+
"rules": {}
|
|
41
|
+
},
|
|
42
|
+
"browserslist": [
|
|
43
|
+
"> 1%",
|
|
44
|
+
"last 2 versions",
|
|
45
|
+
"not dead",
|
|
46
|
+
"not ie 11"
|
|
47
|
+
]
|
|
48
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
7
|
+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
|
8
|
+
<title><%= htmlWebpackPlugin.options.title %></title>
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<noscript>
|
|
12
|
+
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
|
13
|
+
</noscript>
|
|
14
|
+
<div id="app"></div>
|
|
15
|
+
<!-- built files will be auto injected -->
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
package/src/App.vue
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div id="app">
|
|
3
|
+
|
|
4
|
+
<appearance-damage-report :baseUrl="baseUrl">
|
|
5
|
+
|
|
6
|
+
</appearance-damage-report>
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import AppearanceDamageReport from "./package/appearance-damage-report/index.vue";
|
|
15
|
+
// import publicjs from "./package/public-js/index.js";
|
|
16
|
+
export default {
|
|
17
|
+
name: 'App',
|
|
18
|
+
components: {
|
|
19
|
+
AppearanceDamageReport
|
|
20
|
+
},
|
|
21
|
+
data() {
|
|
22
|
+
return {
|
|
23
|
+
baseUrl:'http://localhost:8080/',
|
|
24
|
+
prodId: null,
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
methods: {
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<style>
|
|
35
|
+
#app {
|
|
36
|
+
font-family: Avenir, Helvetica, Arial, sans-serif;
|
|
37
|
+
-webkit-font-smoothing: antialiased;
|
|
38
|
+
-moz-osx-font-smoothing: grayscale;
|
|
39
|
+
color: #2c3e50;
|
|
40
|
+
margin-top: 20px;
|
|
41
|
+
padding: 20px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.selected-info {
|
|
45
|
+
margin-top: 20px;
|
|
46
|
+
padding: 15px;
|
|
47
|
+
background-color: #f0f8ff;
|
|
48
|
+
border-radius: 6px;
|
|
49
|
+
border-left: 4px solid #1890ff;
|
|
50
|
+
}
|
|
51
|
+
</style>
|
|
52
|
+
|
|
Binary file
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="hello">
|
|
3
|
+
<h1>{{ msg }}</h1>
|
|
4
|
+
<p>
|
|
5
|
+
For a guide and recipes on how to configure / customize this project,<br>
|
|
6
|
+
check out the
|
|
7
|
+
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
|
|
8
|
+
</p>
|
|
9
|
+
<h3>Installed CLI Plugins</h3>
|
|
10
|
+
<ul>
|
|
11
|
+
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
|
|
12
|
+
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
|
|
13
|
+
</ul>
|
|
14
|
+
<h3>Essential Links</h3>
|
|
15
|
+
<ul>
|
|
16
|
+
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
|
|
17
|
+
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
|
|
18
|
+
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
|
|
19
|
+
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
|
|
20
|
+
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
|
|
21
|
+
</ul>
|
|
22
|
+
<h3>Ecosystem</h3>
|
|
23
|
+
<ul>
|
|
24
|
+
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
|
|
25
|
+
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
|
|
26
|
+
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
|
|
27
|
+
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
|
|
28
|
+
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
|
|
29
|
+
</ul>
|
|
30
|
+
</div>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script>
|
|
34
|
+
export default {
|
|
35
|
+
name: 'HelloWorld',
|
|
36
|
+
props: {
|
|
37
|
+
msg: String
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
|
43
|
+
<style scoped>
|
|
44
|
+
h3 {
|
|
45
|
+
margin: 40px 0 0;
|
|
46
|
+
}
|
|
47
|
+
ul {
|
|
48
|
+
list-style-type: none;
|
|
49
|
+
padding: 0;
|
|
50
|
+
}
|
|
51
|
+
li {
|
|
52
|
+
display: inline-block;
|
|
53
|
+
margin: 0 10px;
|
|
54
|
+
}
|
|
55
|
+
a {
|
|
56
|
+
color: #42b983;
|
|
57
|
+
}
|
|
58
|
+
</style>
|
package/src/main.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//src/main.js
|
|
2
|
+
import { createApp } from "vue";
|
|
3
|
+
import App from "./App.vue";
|
|
4
|
+
// import TestUi from "zsl-ui-test"; //引入包
|
|
5
|
+
import Zimingui from "zi-ming-ui"; //引入包
|
|
6
|
+
import "../node_modules/zsl-ui-test/zsl-ui.css"; //引入包样式
|
|
7
|
+
import "../node_modules/zi-ming-ui/zi-ming-ui.css"; //引入包样式
|
|
8
|
+
const app = createApp(App);
|
|
9
|
+
// app.config.globalProperties.public = TestUi.publicjs; //公共方法
|
|
10
|
+
// app.use(TestUi.install); //注册组件
|
|
11
|
+
app.use(Zimingui.install); //注册组件
|
|
12
|
+
app.mount("#app");
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
const DamageProds = (request) => {
|
|
6
|
+
return {
|
|
7
|
+
// 查询产品列表
|
|
8
|
+
listDamageProds(query) {
|
|
9
|
+
return request({
|
|
10
|
+
url: '/betaflight/DamageProds/list',
|
|
11
|
+
method: 'get',
|
|
12
|
+
params: query
|
|
13
|
+
})
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
// 查询产品详细
|
|
17
|
+
getDamageProds(id) {
|
|
18
|
+
return request({
|
|
19
|
+
url: '/betaflight/DamageProds/' + id,
|
|
20
|
+
method: 'get'
|
|
21
|
+
})
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
// 新增产品
|
|
25
|
+
addDamageProds(data) {
|
|
26
|
+
return request({
|
|
27
|
+
url: '/betaflight/DamageProds',
|
|
28
|
+
method: 'post',
|
|
29
|
+
data: data
|
|
30
|
+
})
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
// 修改产品
|
|
34
|
+
updateDamageProds(data) {
|
|
35
|
+
return request({
|
|
36
|
+
url: '/betaflight/DamageProds',
|
|
37
|
+
method: 'put',
|
|
38
|
+
data: data
|
|
39
|
+
})
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
// 删除产品
|
|
43
|
+
delDamageProds(id) {
|
|
44
|
+
return request({
|
|
45
|
+
url: '/betaflight/DamageProds/' + id,
|
|
46
|
+
method: 'delete'
|
|
47
|
+
})
|
|
48
|
+
},
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export default DamageProds;
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
const DamageRecord = (request) => {
|
|
5
|
+
return {
|
|
6
|
+
// 查询外观不良列表
|
|
7
|
+
listDamageRecord(query) {
|
|
8
|
+
return request({
|
|
9
|
+
url: '/betaflight/DamageRecord/list',
|
|
10
|
+
method: 'get',
|
|
11
|
+
params: query
|
|
12
|
+
})
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
// 查询外观不良详细
|
|
16
|
+
getDamageRecord(id) {
|
|
17
|
+
return request({
|
|
18
|
+
url: '/betaflight/DamageRecord/' + id,
|
|
19
|
+
method: 'get'
|
|
20
|
+
})
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
// 新增外观不良
|
|
24
|
+
addDamageRecord(data) {
|
|
25
|
+
return request({
|
|
26
|
+
url: '/betaflight/DamageRecord',
|
|
27
|
+
method: 'post',
|
|
28
|
+
data: data
|
|
29
|
+
})
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
// 修改外观不良
|
|
33
|
+
updateDamageRecord(data) {
|
|
34
|
+
return request({
|
|
35
|
+
url: '/betaflight/DamageRecord',
|
|
36
|
+
method: 'put',
|
|
37
|
+
data: data
|
|
38
|
+
})
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
// 删除外观不良
|
|
42
|
+
delDamageRecord(id) {
|
|
43
|
+
return request({
|
|
44
|
+
url: '/betaflight/DamageRecord/' + id,
|
|
45
|
+
method: 'delete'
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default DamageRecord;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
const DamageType = (request) => {
|
|
4
|
+
return {
|
|
5
|
+
// 查询不良原因列表
|
|
6
|
+
listDamageType(query) {
|
|
7
|
+
return request({
|
|
8
|
+
url: '/betaflight/DamageType/list',
|
|
9
|
+
method: 'get',
|
|
10
|
+
params: query
|
|
11
|
+
})
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
// 查询不良原因详细
|
|
15
|
+
getDamageType(id) {
|
|
16
|
+
return request({
|
|
17
|
+
url: '/betaflight/DamageType/' + id,
|
|
18
|
+
method: 'get'
|
|
19
|
+
})
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
// 新增不良原因
|
|
23
|
+
addDamageType(data) {
|
|
24
|
+
return request({
|
|
25
|
+
url: '/betaflight/DamageType',
|
|
26
|
+
method: 'post',
|
|
27
|
+
data: data
|
|
28
|
+
})
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
// 修改不良原因
|
|
32
|
+
updateDamageType(data) {
|
|
33
|
+
return request({
|
|
34
|
+
url: '/betaflight/DamageType',
|
|
35
|
+
method: 'put',
|
|
36
|
+
data: data
|
|
37
|
+
})
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
// 删除不良原因
|
|
41
|
+
delDamageType(id) {
|
|
42
|
+
return request({
|
|
43
|
+
url: '/betaflight/DamageType/' + id,
|
|
44
|
+
method: 'delete'
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default DamageType;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<h2>上报外观不良</h2>
|
|
4
|
+
<h4>1. 请选择产品</h4>
|
|
5
|
+
<flex-radio-group v-model="damageProdId" @change="prodChange" :list="DamageProds.listDamageProds"
|
|
6
|
+
:add="DamageProds.addDamageProds" :update="DamageProds.addDamageProds" />
|
|
7
|
+
<h4>2. 请选择不良原因</h4>
|
|
8
|
+
<flex-radio-group ref="typeGroup" @change="typeChange" v-model="damageTypeId" :list="DamageType.listDamageType"
|
|
9
|
+
:add="DamageType.addDamageType" :update="DamageType.updateDamageType" />
|
|
10
|
+
<h4>3. 本次上报不良个数</h4>
|
|
11
|
+
<input v-model.number="damageNum" type="number" placeholder="请输入不良个数" class="inputNum" />
|
|
12
|
+
|
|
13
|
+
<div class="tj-btn" @click="addRecord">提交</div>
|
|
14
|
+
<tips v-model="showTips">
|
|
15
|
+
{{ tipsContent }}
|
|
16
|
+
</tips>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
import FlexRadioGroup from "../horiz-radio-self-naming/index.vue";
|
|
22
|
+
import tips from '../tips/index.vue'
|
|
23
|
+
|
|
24
|
+
import DamageProds from "./api/DamageProds"
|
|
25
|
+
import DamageType from "./api/DamageType"
|
|
26
|
+
import DamageRecord from "./api/DamageRecord"
|
|
27
|
+
import { createRequest } from './utils/request'
|
|
28
|
+
export default {
|
|
29
|
+
name: 'appearance-damage-report',
|
|
30
|
+
components: {
|
|
31
|
+
FlexRadioGroup,
|
|
32
|
+
tips,
|
|
33
|
+
},
|
|
34
|
+
props: {
|
|
35
|
+
baseUrl: [String]
|
|
36
|
+
},
|
|
37
|
+
data() {
|
|
38
|
+
return {
|
|
39
|
+
DamageProds: {},
|
|
40
|
+
DamageType: {},
|
|
41
|
+
DamageRecord: {},
|
|
42
|
+
damageProdId: null,
|
|
43
|
+
damageTypeId: null,
|
|
44
|
+
|
|
45
|
+
damageNum: 0,
|
|
46
|
+
|
|
47
|
+
damageProdName: null,
|
|
48
|
+
damageTypeName: null,
|
|
49
|
+
|
|
50
|
+
showTips: false,
|
|
51
|
+
tipsContent: '',
|
|
52
|
+
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
watch: {
|
|
56
|
+
baseUrl: {
|
|
57
|
+
handler(n, o) {
|
|
58
|
+
console.log('baseUrl', n)
|
|
59
|
+
let request = createRequest(n)
|
|
60
|
+
this.DamageProds = DamageProds(request);
|
|
61
|
+
this.DamageType = DamageType(request);
|
|
62
|
+
this.DamageRecord = DamageRecord(request);
|
|
63
|
+
},
|
|
64
|
+
deep: true,
|
|
65
|
+
immediate: true,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
mounted() {
|
|
69
|
+
this.resetData();
|
|
70
|
+
},
|
|
71
|
+
methods: {
|
|
72
|
+
prodChange(data) {
|
|
73
|
+
this.damageProdName = data.name;
|
|
74
|
+
},
|
|
75
|
+
typeChange(data) {
|
|
76
|
+
this.damageTypeName = data.name;
|
|
77
|
+
},
|
|
78
|
+
resetData() {
|
|
79
|
+
this.damageProdId = null;
|
|
80
|
+
this.damageProdName = null;
|
|
81
|
+
|
|
82
|
+
this.damageTypeId = null;
|
|
83
|
+
this.damageTypeName = null;
|
|
84
|
+
|
|
85
|
+
this.damageNum = 0;
|
|
86
|
+
},
|
|
87
|
+
addRecord() {
|
|
88
|
+
if (!this.damageProdId) {
|
|
89
|
+
this.tipsText('请选择: 产品')
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (!this.damageTypeId) {
|
|
93
|
+
this.tipsText('请选择: 不良原因')
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (this.damageNum < 0 || !this.damageNum) {
|
|
97
|
+
this.tipsText('请输入: 不良个数')
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
let pn = this.damageProdName || ''
|
|
101
|
+
let tn = this.damageTypeName || ''
|
|
102
|
+
let remark = null;
|
|
103
|
+
|
|
104
|
+
if (pn || tn) {
|
|
105
|
+
remark = ''
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (pn) {
|
|
109
|
+
remark += pn + ' ';
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (tn) {
|
|
113
|
+
remark += tn;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
remark += this.damageNum + '个';
|
|
117
|
+
|
|
118
|
+
this.DamageRecord.addDamageRecord({
|
|
119
|
+
damageProdId: this.damageProdId, damageTypeId: this.damageTypeId,
|
|
120
|
+
damageNum: this.damageNum,
|
|
121
|
+
remark: remark
|
|
122
|
+
}).then(res => {
|
|
123
|
+
console.log('res', res)
|
|
124
|
+
if (res.data.code === 200) {
|
|
125
|
+
this.tipsText('上报成功')
|
|
126
|
+
this.damageTypeId = null;
|
|
127
|
+
this.damageTypeName = null;
|
|
128
|
+
this.damageNum = 0;
|
|
129
|
+
this.$emit('reported')
|
|
130
|
+
}
|
|
131
|
+
})
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
tipsText(text) {
|
|
135
|
+
this.showTips = false;
|
|
136
|
+
this.tipsContent = text;
|
|
137
|
+
this.showTips = true;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
</script>
|
|
142
|
+
|
|
143
|
+
<style>
|
|
144
|
+
.tj-btn {
|
|
145
|
+
background-color: #1890ff;
|
|
146
|
+
color: #fff;
|
|
147
|
+
display: inline-block;
|
|
148
|
+
border-radius: 5px;
|
|
149
|
+
padding: 5px 10px;
|
|
150
|
+
margin-top: 10px;
|
|
151
|
+
margin-left: 10px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.inputNum {
|
|
155
|
+
padding: 10px;
|
|
156
|
+
border: 1px solid #ccc;
|
|
157
|
+
border-radius: 5px;
|
|
158
|
+
}
|
|
159
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import axios from 'axios'
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
|
|
6
|
+
// 创建axios实例
|
|
7
|
+
const service = axios.create({
|
|
8
|
+
// 超时
|
|
9
|
+
timeout: 10000
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
export let createRequest = (baseURL) => {
|
|
15
|
+
return axios.create({
|
|
16
|
+
baseURL:baseURL,
|
|
17
|
+
// 超时
|
|
18
|
+
timeout: 10000
|
|
19
|
+
})
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default service
|