فهرست منبع

修改按钮与项目名称

mushencc 3 سال پیش
والد
کامیت
17ab7a8b98
1فایلهای تغییر یافته به همراه27 افزوده شده و 4 حذف شده
  1. 27 4
      src/views/PurchasingManage/PurchasingOrder/edit.vue

+ 27 - 4
src/views/PurchasingManage/PurchasingOrder/edit.vue

@@ -6,7 +6,8 @@
                 type="primary"
                 v-show="!isCheck"
                 ghost
-                style="margin-right:10px;">参照请购单</Button>
+                style="margin-right:10px;"
+                :disabled="btn1_disable">参照请购单</Button>
         <Button @click="goBack"
                 type="primary"
                 ghost
@@ -127,7 +128,8 @@
                   v-show="!isCheck"
                   type="primary"
                   size="small"
-                  style="margin-left:10px;">选择物料</Button>
+                  style="margin-left:10px;"
+                  :disabled="btn_disable">选择物料</Button>
         </div>
         <div class="content_table_btn_right"
              v-show="!isCheck">
@@ -327,6 +329,8 @@ export default {
   data () {
     // 这里存放数据
     return {
+      btn_disable:false,
+      btn1_disable:false,
       fax_modify: '',
       searchData: {
         client_name: ''
@@ -336,6 +340,7 @@ export default {
         title: '',
         tableData: [{}]
       },
+      table_state:'',
       modalSupplierData: {
         title: '',
         code: '',
@@ -587,7 +592,7 @@ export default {
             ])
           }
         },
-        { title: '项目名称', key: 'client_name', align: 'center', minWidth: 100 },
+        { title: '项目名称', key: 'residential_name', align: 'center', minWidth: 100 },
         { title: '紧急程度', align: 'center', key: 'warning_state', minWidth: 80, slot: 'basicTypeSet', },
         {
           title: '创建时间', key: 'crt_time', align: 'center', minWidth: 110,
@@ -702,6 +707,7 @@ export default {
     this.axios({ method: 'get', url: '/api/order_index', }).then((res) => {
       this.modalProjectData.tableData = res.data.data
       this.modal_project_total = res.data.total
+      console.log(res);
     }).catch((err) => { });
     // 获取紧急程度
     this.axios.get('/api/warning_list').then(res => { this.warningList = res.data.data })
@@ -742,6 +748,18 @@ export default {
       let obj = JSON.parse(JSON.stringify(this.searchData))
       obj.crt_time = parseInt(new Date(obj.crt_time).getTime() / 1000) || ''
       obj.arrive_time = parseInt(new Date(obj.arrive_time).getTime() / 1000) || ''
+      // if(this.tableData == null){
+      //   this.confirmDelete({
+      //   content: '请选择物料',
+      //   title:'提示',
+      //   type: 'error',
+      //   then: () => {
+          
+      //     // this.select_post(n, this.selectIds)
+      //   },
+      //   cancel: () => { }
+      // })
+      // }
       if (this.$route.query.purchase_order_no == '') {
         // 新增
         this.axios({
@@ -749,7 +767,8 @@ export default {
           url: '/api/purchase_add',
           data: {
             ...obj,
-            list: this.tableData
+            list: this.tableData,
+            is_refer:this.table_state,
           }
         }).then((res) => {
           if (res.code == 200) {
@@ -791,6 +810,8 @@ export default {
             // element.type_title = element.m_title
             // element.material_id = element.m_id
             element.supply_id = this.searchData.supply_id
+            this.table_state = 1
+            this.btn_disable = true
           });
           this.tableData = [...this.tableData, ...result]
         }
@@ -818,6 +839,8 @@ export default {
         element.supply_id = this.searchData.supply_id
       });
       this.tableData = [...this.tableData, ...this.modalData.selectedData]
+      this.table_state = 0
+      this.btn1_disable = true
     },
     changeModalSize (e) {
       this.modal_page_size = e;