2 コミット a3beda3dd9 ... 374941d88b

作者 SHA1 メッセージ 日付
  zx 374941d88b Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper 1 年間 前
  zx 9d94c020a5 dfaw 1 年間 前

+ 26 - 7
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/product/list.vue

@@ -2,10 +2,9 @@
     <section>
         <!--工具条-->
         <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
+
             <el-form :inline="true">
-                <el-form-item >
-                    <span style="font-size:16px;color:#606266">{{ titleName }}</span>
-                </el-form-item>
+                <h1>{{ titleName }}</h1>
                 <el-form-item label="产品名称">
                     <el-input v-model="name" placeholder="请输入" clearable="true" size="small">
                     </el-input>
@@ -326,6 +325,8 @@
 
                 <el-button @click.native="deletePro(1, addForm)" v-if="addForm.id" style="float:left">{{ $t('btn.delete')
                 }}</el-button>
+                <el-button v-if="prodEditActive == 1"   @click="backStep()"
+                        :loading="addLoading">上一步</el-button>
                 <el-button @click.native="addFormVisible = false">{{ $t('btn.cancel') }}</el-button>
                 <el-button v-if="prodEditActive == 0" type="primary" @click="submitInsert(0)"
                     :loading="addLoading">保存</el-button>
@@ -1195,7 +1196,8 @@ export default {
                 flag = false
             }
             //数字
-            const reg = /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g
+            const reg = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/
+            const r = /^\+?[1-9][0-9]*$/; // 正整数
             if(flag){
                  for (let i = 0; i < this.procedureLit.length; i++) {
                     console.log(this.procedureLit[i].name === '')
@@ -1204,14 +1206,14 @@ export default {
                         break
                     }
 
-                   /*  if(!reg.test(this.procedureLit[i].unitPrice)|| !reg.test(this.procedureLit[i].workingTime)){
+                     if(!reg.test(this.procedureLit[i].unitPrice)|| !r.test(this.procedureLit[i].workingTime)){
                         this.$message({
-                            message: "单件工时和工价要为数字",
+                            message: "请输入正确的单件工时为和工价格式,工时为正整数,工价可保留两位小数",
                             type: "error"
                         });
 
                         return 
-                    } */
+                    } 
 
                   
                 }
@@ -1276,6 +1278,23 @@ export default {
 
            
 
+        },
+        //工序返回上一步
+        backStep(){
+            this.prodEditActive =0
+            this.http.post('/product/get', { id: this.productId },
+                res => {
+                    if (res.code == "ok") {
+                        this.addForm = res.data;
+                    }
+                });
+
+             this.addFormVisible = true;
+            if (this.user.company.packageEngineering == 1) {
+                if (this.professionList.length == 0) {
+                    this.getProfessionList();
+                }
+            }    
         },
 
         //删除工序