作者 许海潮

合并分支 'brunch_li' 到 'master'

产品



查看合并请求 !3
@@ -7,8 +7,7 @@ @@ -7,8 +7,7 @@
7 <div class="fa-text">产品管理</div> 7 <div class="fa-text">产品管理</div>
8 </div> 8 </div>
9 <div class="peiches"> 9 <div class="peiches">
10 -  
11 - <el-button type="primary" @click="dialogVisible = true">添加产品</el-button> 10 + <el-button type="primary" @click="addEidor">添加产品</el-button>
12 </div> 11 </div>
13 </div> 12 </div>
14 <div class="biaoge"> 13 <div class="biaoge">
@@ -93,16 +92,10 @@ @@ -93,16 +92,10 @@
93 </el-table-column> 92 </el-table-column>
94 <el-table-column fixed="right" label="操作" width="196"> 93 <el-table-column fixed="right" label="操作" width="196">
95 <template slot-scope="scope"> 94 <template slot-scope="scope">
96 - <el-button  
97 - type="text"  
98 - size="small"  
99 - @click="dialogVisibleh = true" 95 + <el-button type="text" size="small" @click="editor(scope.row)"
100 >编辑</el-button 96 >编辑</el-button
101 > 97 >
102 - <el-button  
103 - type="text"  
104 - size="small"  
105 - v-if="scope.row.status == 0" 98 + <el-button type="text" size="small" v-if="scope.row.status == 0"
106 >禁用</el-button 99 >禁用</el-button
107 > 100 >
108 </template> 101 </template>
@@ -112,7 +105,7 @@ @@ -112,7 +105,7 @@
112 </div> 105 </div>
113 <div class="tiaoshu"> 106 <div class="tiaoshu">
114 <div class="left-io"></div> 107 <div class="left-io"></div>
115 - <div class="gon">共{{total}}条</div> 108 + <div class="gon">共{{ total }}条</div>
116 <div class="kls"> 109 <div class="kls">
117 <el-pagination 110 <el-pagination
118 :page-size="20" 111 :page-size="20"
@@ -126,10 +119,10 @@ @@ -126,10 +119,10 @@
126 </div> 119 </div>
127 <!-- 添加产品 --> 120 <!-- 添加产品 -->
128 <el-dialog 121 <el-dialog
129 - title="添加产品" 122 + :title="editorProduct == '' ? '添加产品' : '编辑商品'"
130 :visible.sync="dialogVisible" 123 :visible.sync="dialogVisible"
131 width="55%" 124 width="55%"
132 - style='margin-top: 10%' 125 + style="margin-top: 10%"
133 :append-to-body="true" 126 :append-to-body="true"
134 > 127 >
135 <div class="liebiao"> 128 <div class="liebiao">
@@ -208,9 +201,8 @@ @@ -208,9 +201,8 @@
208 </div> 201 </div>
209 202
210 <div class="queren"> 203 <div class="queren">
211 -  
212 <el-button type="primary" round @click="xinzeng">确认</el-button> 204 <el-button type="primary" round @click="xinzeng">确认</el-button>
213 - <el-button round @click='dialogVisible = false'>取消</el-button> 205 + <el-button round @click="dialogVisible = false">取消</el-button>
214 </div> 206 </div>
215 </div> 207 </div>
216 </el-dialog> 208 </el-dialog>
@@ -235,7 +227,9 @@ export default { @@ -235,7 +227,9 @@ export default {
235 pageNum: 1, 227 pageNum: 1,
236 productId: "", //产品编码 228 productId: "", //产品编码
237 telegramStatus: "", //转态 229 telegramStatus: "", //转态
238 - total:null 230 + total: null,
  231 + editorProduct: '',//获取同行的所有数据
  232 +
239 }; 233 };
240 }, 234 },
241 mounted() { 235 mounted() {
@@ -304,11 +298,29 @@ export default { @@ -304,11 +298,29 @@ export default {
304 this.dialogImageUrl = file.url; 298 this.dialogImageUrl = file.url;
305 this.dialogVisible = true; 299 this.dialogVisible = true;
306 }, 300 },
  301 + //**编辑商品 * */
  302 + editor(val) {
  303 + console.log(val)
  304 + this.editorProduct = val;
  305 + this.dialogVisible = true
  306 + this.productModel = val.productModel
  307 + this.breed = val.breed
  308 + this.deptId = val.deptId
  309 + this.productId = val.productId
  310 + this.size = val.size
  311 + this.productType = val.productType
  312 + this.weight = val.weight
  313 + },
  314 + /** 添加商品 * */
  315 + addEidor() {
  316 + this.dialogVisible = true
  317 + this.editorProduct = '';
  318 + }
  319 +
307 }, 320 },
308 }; 321 };
309 </script> 322 </script>
310 <style> 323 <style>
311 -  
312 .el-dialog__body { 324 .el-dialog__body {
313 padding: 5px 20px; 325 padding: 5px 20px;
314 padding-bottom: 68px; 326 padding-bottom: 68px;
@@ -7,8 +7,9 @@ @@ -7,8 +7,9 @@
7 <div class="fa-text">车辆管理</div> 7 <div class="fa-text">车辆管理</div>
8 </div> 8 </div>
9 <div class="peiches"> 9 <div class="peiches">
10 -  
11 - <el-button type="primary" @click="dialogVisible = true">添加部门</el-button> 10 + <el-button type="primary" @click="dialogVisible = true"
  11 + >添加部门</el-button
  12 + >
12 </div> 13 </div>
13 </div> 14 </div>
14 <div class="biaoge"> 15 <div class="biaoge">
@@ -231,9 +232,8 @@ @@ -231,9 +232,8 @@
231 </div> 232 </div>
232 </div> 233 </div>
233 <div class="queren"> 234 <div class="queren">
234 -  
235 - <el-button type="primary" round @click="tianjias">确认</el-button>  
236 - <el-button round @click='dialogVisible = false'>取消</el-button> 235 + <el-button type="primary" round @click="tianjias">确认</el-button>
  236 + <el-button round @click="dialogVisible = false">取消</el-button>
237 </div> 237 </div>
238 </div> 238 </div>
239 </el-dialog> 239 </el-dialog>
@@ -375,12 +375,10 @@ export default { @@ -375,12 +375,10 @@ export default {
375 zizhiChange(e) { 375 zizhiChange(e) {
376 // var type = e.target.dataset.type; 376 // var type = e.target.dataset.type;
377 var that = this; 377 var that = this;
  378 + console.log(e)
378 var file = e.target.files[0]; 379 var file = e.target.files[0];
379 var formData = new FormData(); 380 var formData = new FormData();
380 -  
381 - formData.append("file", file);  
382 var url = "/api/file/upload"; 381 var url = "/api/file/upload";
383 - console.log(formData, "aasass");  
384 that.$axios 382 that.$axios
385 .post(url, formData) 383 .post(url, formData)
386 .then(function (res) { 384 .then(function (res) {
@@ -7,8 +7,9 @@ @@ -7,8 +7,9 @@
7 <div class="fa-text">仪表管理</div> 7 <div class="fa-text">仪表管理</div>
8 </div> 8 </div>
9 <div class="peiches"> 9 <div class="peiches">
10 -  
11 - <el-button type="primary" @click="dialogVisible = true">添加仪表</el-button> 10 + <el-button type="primary" @click="dialogVisible = true"
  11 + >添加仪表</el-button
  12 + >
12 </div> 13 </div>
13 </div> 14 </div>
14 <div class="biaoge"> 15 <div class="biaoge">
@@ -131,7 +132,7 @@ @@ -131,7 +132,7 @@
131 title="仪表管理" 132 title="仪表管理"
132 :visible.sync="dialogVisible" 133 :visible.sync="dialogVisible"
133 width="55%" 134 width="55%"
134 - style='margin-top: 10%' 135 + style="margin-top: 10%"
135 :append-to-body="true" 136 :append-to-body="true"
136 > 137 >
137 <div class="liebiao"> 138 <div class="liebiao">
@@ -190,9 +191,8 @@ @@ -190,9 +191,8 @@
190 </div> 191 </div>
191 </div> 192 </div>
192 <div class="queren"> 193 <div class="queren">
193 -  
194 <el-button type="primary" round @click="qutbtn">确认</el-button> 194 <el-button type="primary" round @click="qutbtn">确认</el-button>
195 - <el-button round @click='dialogVisible = false'>取消</el-button> 195 + <el-button round @click="dialogVisible = false">取消</el-button>
196 </div> 196 </div>
197 </div> 197 </div>
198 </el-dialog> 198 </el-dialog>
@@ -259,17 +259,17 @@ export default { @@ -259,17 +259,17 @@ export default {
259 }; 259 };
260 that.$axios 260 that.$axios
261 .post(url, params) 261 .post(url, params)
262 - .then(function (res) {  
263 - console.log(res);  
264 - that.$message({  
265 - message: "添加成功",  
266 - type: "success", 262 + .then((res) => {
  263 + console.log(res);
  264 + that.$message({
  265 + message: "添加成功",
  266 + type: "success",
  267 + });
  268 + that.dialogVisible=false;
  269 + })
  270 + .catch((err) => {
  271 + console.log(err);
267 }); 272 });
268 - that.dialogVisible = false;  
269 - })  
270 - .catch(function (err) {  
271 - console.log(err);  
272 - });  
273 }, 273 },
274 //编辑发货申请 274 //编辑发货申请
275 handleClick(row) { 275 handleClick(row) {
@@ -290,31 +290,29 @@ export default { @@ -290,31 +290,29 @@ export default {
290 let params = {}; 290 let params = {};
291 that.$axios 291 that.$axios
292 .get(url) 292 .get(url)
293 - .then(function (res) {  
294 - console.log(res);  
295 - if (type == true) {  
296 - that.$message({  
297 - message: "禁用成功",  
298 - type: "success",  
299 - });  
300 - } else if (type == false) {  
301 - that.$message({  
302 - message: "解禁成功",  
303 - type: "success",  
304 - });  
305 - }  
306 - that.list();  
307 - })  
308 - .catch(function (err) {  
309 - console.log(err);  
310 - }); 293 + .then((res) => {
  294 + console.log(res);
  295 + if(type==true) {
  296 + that.$message({
  297 + message: "禁用成功",
  298 + type: "success",
  299 + });
  300 + } else if(type==false) {
  301 + that.$message({
  302 + message: "解禁成功",
  303 + type: "success",
  304 + });
  305 + }
  306 + that.list();
  307 + })
  308 + .catch((err) => {
  309 + console.log(err);
  310 + });
311 }, 311 },
312 }, 312 },
313 }; 313 };
314 </script> 314 </script>
315 <style> 315 <style>
316 -  
317 -  
318 .el-dialog__body { 316 .el-dialog__body {
319 padding: 5px 20px; 317 padding: 5px 20px;
320 } 318 }