yusheng 2 жил өмнө
parent
commit
295d35db79

+ 5 - 0
src/styles/index.scss

@@ -9,4 +9,9 @@ $--ele-font-path: '~ele-admin/es/style/fonts';
     max-height: 700px;
     overflow-y: auto;
     padding-bottom: 30px;
+}
+table th .is-required::before{
+    content: "*";
+    color: red;
+    margin-right: 4px;
 }

+ 21 - 3
src/views/contractManage/contractBook/components/inventoryTable.vue

@@ -52,6 +52,10 @@
           ></el-input>
         </el-form-item>
       </template>
+      <template v-slot:headerProductName="{column  }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      
       <template v-slot:productCode="scope">
         <el-form-item
           style="margin-bottom: 20px"
@@ -96,6 +100,9 @@
           ></el-input>
         </el-form-item>
       </template>
+      <template v-slot:headerTotalCount="{column  }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
       <template v-slot:totalPrice="scope">
         <el-form-item
           style="margin-bottom: 20px"
@@ -225,6 +232,10 @@
           </el-input>
         </el-form-item>
       </template>
+      <template v-slot:headerSinglePrice="{column  }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      
       <template v-slot:technicalAnswerName="{ row, $index }">
         <el-form-item
           style="margin-bottom: 20px"
@@ -362,7 +373,9 @@
             width: 200,
             prop: 'productName',
             label: '名称',
-            slot: 'productName'
+            slot: 'productName',
+            headerSlot: 'headerProductName',
+
           },
           {
             width: 120,
@@ -399,13 +412,18 @@
             width: 160,
             prop: 'singlePrice',
             label: '单价',
-            slot: 'singlePrice'
+            slot: 'singlePrice',
+            headerSlot: 'headerSinglePrice',
+
           },
           {
             width: 80,
             prop: 'totalCount',
             label: '数量',
-            slot: 'totalCount'
+            slot: 'totalCount',
+            headerSlot: 'headerTotalCount',
+
+            
           },
           {
             width: 80,

+ 204 - 144
src/views/contractManage/contractBook/components/paymentList.vue

@@ -1,82 +1,137 @@
 <template>
-    <el-form ref="form" :model="form" :rules="rules">
-      <ele-pro-table ref="table" :needPage="false" :columns="columns" :datasource="form.datasource"
-        cache-key="systemRoleTable17" class="time-form">
-        <!-- 表头工具栏 -->
-        <template v-slot:toolbar>
-          <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon" @click="handlAdd">
-            新增
-          </el-button>
-        </template>
-        <template v-slot:moneyName="scope">
-          <el-form-item style="margin-bottom: 20px;" :prop="'datasource.' + scope.$index + '.moneyName'" :rules="{
+  <el-form ref="form" :model="form" :rules="rules">
+    <ele-pro-table
+      ref="table"
+      :needPage="false"
+      :columns="columns"
+      :datasource="form.datasource"
+      cache-key="systemRoleTable17"
+      class="time-form"
+    >
+      <!-- 表头工具栏 -->
+      <template v-slot:toolbar>
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-plus"
+          class="ele-btn-icon"
+          @click="handlAdd"
+        >
+          新增
+        </el-button>
+      </template>
+      <template v-slot:moneyName="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.moneyName'"
+          :rules="{
             required: true,
             message: '请输入',
             trigger: 'blur'
-          }">
-            <el-input v-model="scope.row.moneyName" placeholder="请输入"></el-input>
-          </el-form-item>
-        </template>
-        
-        <template v-slot:ratio="scope">
-          <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.ratio'"  :rules="{
-          required: true,
-          pattern:numberReg,
-          message: '请输入正确的比例',
-          trigger: 'change'
-        }">
-            <el-input v-model="scope.row.ratio"  placeholder="请输入" @input="(val)=>ratioInput(val,scope.$index)">
-                <template slot="append">%</template>
-            </el-input>
-          </el-form-item>
-        </template>
-        <template v-slot:price="scope">
-            <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.price'" :rules="{
-          required: true,
-          pattern:numberReg,
-          message: '请输入正确的金额',
-          trigger: 'change'
-        }">
-        {{scope.row.price||0.00}}元
-            <!-- <el-input v-model="scope.row.price" placeholder="请输入" disabled>
+          }"
+        >
+          <el-input
+            v-model="scope.row.moneyName"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </template>
+      <template v-slot:headerMoneyName="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      <template v-slot:ratio="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.ratio'"
+          :rules="{
+            required: true,
+            pattern: numberReg,
+            message: '请输入正确的比例',
+            trigger: 'change'
+          }"
+        >
+          <el-input
+            v-model="scope.row.ratio"
+            placeholder="请输入"
+            @input="(val) => ratioInput(val, scope.$index)"
+          >
+            <template slot="append">%</template>
+          </el-input>
+        </el-form-item>
+      </template>
+      <template v-slot:headerRatio="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      <template v-slot:price="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.price'"
+          :rules="{
+            required: true,
+            pattern: numberReg,
+            message: '请输入正确的金额',
+            trigger: 'change'
+          }"
+        >
+          {{ scope.row.price || 0.0 }}元
+          <!-- <el-input v-model="scope.row.price" placeholder="请输入" disabled>
               <template slot="append">元</template>
             </el-input> -->
         </el-form-item>
-        </template>
-        <template v-slot:deadLine="scope">
-          <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.deadLine'" :rules="{
+      </template>
+      <template v-slot:deadLine="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.deadLine'"
+          :rules="{
             required: true,
             message: '请选择日期',
             trigger: 'change'
-          }">
-                  <el-date-picker
-                  style="width:140px"
-                   v-model="scope.row.deadLine"
-                   type="date"
-                   placeholder="选择日期">
+          }"
+        >
+          <el-date-picker
+            style="width: 140px"
+            v-model="scope.row.deadLine"
+            type="date"
+            placeholder="选择日期"
+          >
           </el-date-picker>
-          </el-form-item>
-        </template>
-          <template v-slot:remark="scope">
-        <el-form-item style="margin-bottom: 20px" :prop="'datasource.' + scope.$index + '.remark'">
-            <el-input v-model="scope.row.remark" type="textarea" placeholder="请输入"></el-input>
         </el-form-item>
       </template>
-        <!-- 操作列 -->
-        <template v-slot:action="{ row }">
-          <el-popconfirm class="ele-action" title="确定要删除吗?" @confirm="remove(row)">
-            <template v-slot:reference>
-              <el-link type="danger" :underline="false" icon="el-icon-delete">
-                删除
-              </el-link>
-            </template>
-          </el-popconfirm>
-        </template>
-      </ele-pro-table>
-    </el-form>
-  </template>
-  <script>
-  import { emailReg, phoneReg,numberReg } from 'ele-admin';
+      <template v-slot:headerDeadLine="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      <template v-slot:remark="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.remark'"
+        >
+          <el-input
+            v-model="scope.row.remark"
+            type="textarea"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </template>
+      <!-- 操作列 -->
+      <template v-slot:action="{ row }">
+        <el-popconfirm
+          class="ele-action"
+          title="确定要删除吗?"
+          @confirm="remove(row)"
+        >
+          <template v-slot:reference>
+            <el-link type="danger" :underline="false" icon="el-icon-delete">
+              删除
+            </el-link>
+          </template>
+        </el-popconfirm>
+      </template>
+    </ele-pro-table>
+  </el-form>
+</template>
+<script>
+  import { emailReg, phoneReg, numberReg } from 'ele-admin';
   export default {
     props: {
       delDetailIds: Array
@@ -84,11 +139,11 @@
     data() {
       const defaultForm = {
         key: null,
-        deadLine:null,
-        moneyName:'',
-        price:null,
-        ratio:null,
-        remark:''
+        deadLine: null,
+        moneyName: '',
+        price: null,
+        ratio: null,
+        remark: ''
       };
       return {
         numberReg,
@@ -105,18 +160,20 @@
             align: 'center',
             fixed: 'left'
           },
-          
+
           {
             width: 240,
             prop: 'moneyName',
             label: '款项名称',
-            slot: 'moneyName'
+            slot: 'moneyName',
+            headerSlot: 'headerMoneyName'
           },
           {
             width: 170,
             prop: 'ratio',
             label: '比例',
-            slot: 'ratio'
+            slot: 'ratio',
+            headerSlot: 'headerRatio'
           },
           {
             width: 150,
@@ -124,12 +181,13 @@
             label: '金额',
             slot: 'price'
           },
-         
+
           {
             width: 160,
             prop: 'deadLine',
             label: '截止日期',
-            slot: 'deadLine'
+            slot: 'deadLine',
+            headerSlot: 'headerDeadLine'
           },
           {
             width: 260,
@@ -145,87 +203,93 @@
             slot: 'action',
             showOverflowTooltip: true
           }
-        ],
+        ]
       };
     },
     computed: {
       canHandl() {
         return this.form.datasource.length;
       },
-      discountAmount(){
-        return this.$store.state.concact.discountAmount
+      discountAmount() {
+        return this.$store.state.concact.discountAmount;
       }
     },
-    watch:{
-      discountAmount(newval){
-        if(newval){
-          this.refreshprice()
+    watch: {
+      discountAmount(newval) {
+        if (newval) {
+          this.refreshprice();
         }
       }
     },
     methods: {
       //输入比例更新金额
-     async ratioInput(val,index=null){
-      val=Number(val)
-      try {
-        if(index!=null){
-          await this.checkRatio()
-        }
-        let newval=(val/100).toFixed(2)
-          let price=(this.discountAmount*newval).toFixed(2)
-          console.log(newval,price,index,'88888')
-          if(index!=null){
-            console.log(newval,price,index,'999999')
-           this.$set( this.form.datasource[index], 'price',  price)
-          }else{
-           return price
+      async ratioInput(val, index = null) {
+        val = Number(val);
+        try {
+          if (index != null) {
+            await this.checkRatio();
           }
-      } catch (error) {
-         return 0
-      }
-       
-      
-       
-       //this.$set( this.form.datasource[index], 'price',  price)
+          let newval = (val / 100).toFixed(2);
+          let price = (this.discountAmount * newval).toFixed(2);
+          console.log(newval, price, index, '88888');
+          if (index != null) {
+            console.log(newval, price, index, '999999');
+            this.$set(this.form.datasource[index], 'price', price);
+          } else {
+            return price;
+          }
+        } catch (error) {
+          return 0;
+        }
+
+        //this.$set( this.form.datasource[index], 'price',  price)
       },
       //检验比例
-      checkRatio(){
+      checkRatio() {
         return new Promise((resolve, reject) => {
-                let newData=this.form.datasource,sum=0
-              newData.forEach(r=>{
-                if(r.ratio){
-                  sum+=Number(r.ratio)
-                }
-              })
-              console.log(sum,'3333333')
-              if(sum>100){
-                this.$message.error('总共比例不能超过100')
-                this.$set( this.form.datasource[this.form.datasource.length-1], 'ratio',  null)
-                this.$set( this.form.datasource[this.form.datasource.length-1], 'price',  0.00)
-                reject(false);
-              }else{
-                resolve(true)
-              }
-            })
-      
+          let newData = this.form.datasource,
+            sum = 0;
+          newData.forEach((r) => {
+            if (r.ratio) {
+              sum += Number(r.ratio);
+            }
+          });
+          console.log(sum, '3333333');
+          if (sum > 100) {
+            this.$message.error('总共比例不能超过100');
+            this.$set(
+              this.form.datasource[this.form.datasource.length - 1],
+              'ratio',
+              null
+            );
+            this.$set(
+              this.form.datasource[this.form.datasource.length - 1],
+              'price',
+              0.0
+            );
+            reject(false);
+          } else {
+            resolve(true);
+          }
+        });
       },
-      refreshprice(){
-        let newData=this.form.datasource
-        newData.forEach(async (r,index)=>{
-          if(r.ratio){
-            console.log(this.ratioInput(Number(r.ratio)),'9999888888')
-            r.price =await this.ratioInput(Number(r.ratio));
+      refreshprice() {
+        let newData = this.form.datasource;
+        newData.forEach(async (r, index) => {
+          if (r.ratio) {
+            console.log(this.ratioInput(Number(r.ratio)), '9999888888');
+            r.price = await this.ratioInput(Number(r.ratio));
           }
-        })
+        });
       },
-        // 返回列表数据
-     getTableValue(){
-         return this.form.datasource
+      // 返回列表数据
+      getTableValue() {
+        return this.form.datasource;
       },
       //修改回显
-      putTableValue(data){
-        if(data&&data?.length){
-            this.form.datasource=data
+      putTableValue(data) {
+        if (data && data?.length) {
+          this.form.datasource = data;
         }
       },
       remove(row) {
@@ -254,22 +318,18 @@
         item.key = this.form.datasource.length + 1;
         this.form.datasource.push(item);
       },
- 
 
-      validateForm (callback) {
+      validateForm(callback) {
         //开始表单校验
         this.$refs.form.validate((valid) => {
           callback(valid);
         });
-      },
-  
-  
+      }
     }
   };
-  </script>
-  <style lang="scss" scoped>
+</script>
+<style lang="scss" scoped>
   .time-form .el-form-item {
     margin-bottom: 0 !important;
   }
-  </style>
-  
+</style>

+ 5 - 5
src/views/purchasingManage/purchaseOrder/returnGoods/components/inventoryTable.vue

@@ -411,15 +411,15 @@
           } else if (Number(value) > row.receiveTotalCount) {
             this.$message.error('退货数量不能大于收货数量');
             callback(new Error('退货数量不能大于收货数量'));
-          } else if (this.getTotalCount(row)> row.warehouseNum) {
-            this.$message.error('退货数量不能大于库存');
-            callback(new Error('退货数量不能大于库存'));
-          } else {
+          }  else {
             callback();
           }
         };
       },
-
+      // else if (this.getTotalCount(row)> row.warehouseNum) {
+      //       this.$message.error('退货数量不能大于库存');
+      //       callback(new Error('退货数量不能大于库存'));
+      //     }
       getTotalCount(row){
         let num=0;
         this.form.datasource.filter(item=>item.warehouseId==row.warehouseId).forEach(item=>{

+ 19 - 14
src/views/saleManage/quotation/components/addDialog.vue

@@ -13,24 +13,12 @@
       <headerTitle title="基本信息"></headerTitle>
       <el-row>
         <el-col :span="12">
-          <el-form-item
-            label="询价方名称"
-            prop="contactName"
-            style="margin-bottom: 22px"
-          >
-            <el-input
-              clearable
-              v-model="form.contactName"
-              @click.native="handParent"
-              placeholder="请输入"
-            />
-          </el-form-item>
           <el-form-item
             label="关联商机"
             prop="opportunityId"
             style="margin-bottom: 22px"
           >
-            <el-select v-model="form.opportunityId" placeholder="请选择">
+            <el-select v-model="form.opportunityId" placeholder="请选择" style="width: 100%;">
               <el-option
                 v-for="item in businessList"
                 :key="item.id"
@@ -40,13 +28,26 @@
               </el-option>
             </el-select>
           </el-form-item>
+          <el-form-item
+            label="询价方名称"
+            prop="contactName"
+            style="margin-bottom: 22px"
+          >
+            <el-input
+              clearable
+              v-model="form.contactName"
+              @click.native="handParent"
+              placeholder="请输入"
+            />
+          </el-form-item>
+        
           <el-form-item
             label="询价方联系人"
             prop="contactLinkName"
             style="margin-bottom: 22px"
           >
             <el-select
-              v-model="form.contactLinkName"
+              v-model="form.contactLinkName" style="width: 100%;"
               placeholder="请选择"
               @change="onchangeLink"
               @focus="selectFocus"
@@ -323,6 +324,10 @@
         tableLinkData: [],
         businessList: [], //商机列表
         rules: {
+          
+          opportunityId: [
+            { required: true, message: '请选择关联商机', trigger: 'change' }
+          ],
           contactName: [
             { required: true, message: '请选择客户', trigger: 'change' }
           ],

+ 8 - 7
src/views/saleManage/quotation/components/detailDialog.vue

@@ -25,20 +25,21 @@
      </headerTitle>
        <el-row>
          <el-col :span="12">
-           <el-form-item
-             label="询价方名称"
-             prop="contactName"
+          <el-form-item
+             label="关联商机名称"
+             prop="opportunityName"
              style="margin-bottom: 22px"
            >
-           {{form.contactName}}
+           {{detailData.opportunityName}}
            </el-form-item>
            <el-form-item
-             label="关联商机名称"
-             prop="opportunityName"
+             label="询价方名称"
+             prop="contactName"
              style="margin-bottom: 22px"
            >
-           {{detailData.opportunityName}}
+           {{form.contactName}}
            </el-form-item>
+       
            <el-form-item
              label="询价方联系人"
              prop="contactLinkName"