Fixiaobai
2023-11-17 f19edc96af3261347f48cb8f66f1f5b2feb6071e
src/views/plan/customerorder/sample-customerorder-form.vue
@@ -68,8 +68,8 @@
        <el-row>
          <el-col :span="6">
            <el-form-item label="业务员" prop="salesMan">
              <el-select @change="selsctionSales" v-model="salesSelectData" style="width:100%">
                <el-option v-for="(item,index) in staffOptions" :key="index" :value="item" :label="item.staffName"/>
              <el-select @change="selsctionSales" filterable v-model="salesSelectData" style="width:100%">
                <el-option v-for="(item,index) in staffOptions" :key="index" :value="item.staffNo+','+item.staffName" :label="item.staffName"/>
              </el-select>
            </el-form-item>
          </el-col>
@@ -154,7 +154,7 @@
    <el-divider>
      <span style="font-weight:bold;font-size:16px;">订单行</span>
    </el-divider>
    <div>
    <div class="l-mes normal-form">
      <avue-crud ref="crud"
        show-hide="false"
        :option="option"
@@ -172,6 +172,9 @@
                :label="item.label"
                :value="item.value" />
            </el-select>
          </template>
          <template slot="menu" slot-scope="scope">
              <el-button type="text" icon="el-icon-circle-close" :disabled="tableData.length<2"  @click="delRow(scope.row,scope.index)">取消</el-button>
          </template>
      </avue-crud>
    </div>
@@ -382,38 +385,38 @@
    />
  </el-dialog>
</template>
<style>
.normal-form .el-input-group__append,
.normal-form .el-input-group__prepend {
  padding: 0;
  border-top: none;
  border-right: none;
  border-left: none;
  border-radius: 0;
  background-color: transparent;
}
.normal-form .el-input-group__append .el-button,
.normal-form .el-input-group__prepend .el-button {
  padding: 0;
  width: 25px;
  border: none !important;
  line-height: 28px;
  color: #c0c4cc;
  margin: -1px 0;
}
</style>
<script>
import { addObj } from '@/api/plan/customer'
import { remote } from '@/api/admin/dict'
import PartDialog from '@/views/common/part.vue'
import { validateSixDecimal } from '@/util/validate'
import {dateFormat} from '@/util/date'
// import { chooseStaff } from '@/api/admin/productType'
import { chooseStaff } from '@/api/plan/customerorder'
import { tableOption } from '@/const/crud/customerOrder/customerOrderForm'
export default {
  components: {
    PartDialog
  },
  watch:{
    visible(newVal){
      if(!newVal){
        this.tableData = [{
            "$cellEdit": true,
            "$index": 0,
            "partNo": "",
            "specs": "",
            "manufactureAttr": "",
            "productName": "",
            "productType": "",
            "otcUnit": "",
            "buyQtyDue": "",
            "shippingAddress": "",
            "remark": "",
            "isTrusted": true
        }]
      }
    }
  },
  data() {
    return {
@@ -424,7 +427,7 @@
          "$cellEdit": true,
          "$index": 0,
          "partNo": "",
          "customerPartSpec": "",
          "specs": "",
          "manufactureAttr": "",
          "productName": "",
          "productType": "",
@@ -469,14 +472,20 @@
    this.getStaffOptions();
  },
  methods: {
    delRow(row,index){
      this.tableData.splice(index,1)
    },
    selsctionSales(data){
        this.dataForm.salesMan =  data.staffName
        this.dataForm.salerWorkCode = data.staffNo
        if(data){
          let arr = data.split(",")
          this.dataForm.salesMan =  arr[1]
          this.dataForm.salerWorkCode = arr[0]
        }
    },
    getStaffOptions(){
      // chooseStaff().then((response)=>{
      //   this.staffOptions = response.data.data
      // })
      chooseStaff().then((response)=>{
        this.staffOptions = response.data.data
      })
    },
    init(id) {
      this.initDataForm()
@@ -503,7 +512,7 @@
          "$cellEdit": true,
          "$index": 0,
          "partNo": "",
          "customerPartSpec": "",
          "specs": "",
          "manufactureAttr": "",
          "productName": "",
          "productType": "",
@@ -542,12 +551,16 @@
      this.showPart = true
    },
    selectPart(part) {
      console.log(part);
      const index = this.currentSelectRow
      if (part) {
        this.tableData[index].partId=part.id
        this.tableData[index].partNo = part.partNo
        this.tableData[index].customerPartSpec = part.specs
        this.tableData[index].productName = part.partName
        this.tableData[index].otcUnit = part.unit
        this.tableData[index].buyQtyDue = part.numCount
        this.tableData[index].manufactureAttr = part.materialAttribute
      }
    },
    // 全屏
@@ -575,4 +588,29 @@
    }
  }
}
</script>
</script>
<style>
.normal-form .el-input-group__append,
.normal-form .el-input-group__prepend {
  padding: 0;
  border-top: none;
  border-right: none;
  border-left: none;
  border-radius: 0;
  background-color: transparent;
}
.normal-form .el-input-group__append .el-button,
.normal-form .el-input-group__prepend .el-button {
  padding: 0;
  width: 25px;
  border: none !important;
  line-height: 28px;
  color: #c0c4cc;
  margin: -1px 0;
}
.avue-crud .avue-crud__left .el-button{
    margin-right: 8px;
    margin-bottom: 8px;
    border-radius: 0px;
}
</style>