Pārlūkot izejas kodu

Merge branch 'purchaseDev' of http://172.16.100.139/new-business/drp-web into purchaseDev

002390 2 gadi atpakaļ
vecāks
revīzija
726f66e88d

+ 20 - 3
src/api/business/purchase/contract.js

@@ -8,6 +8,13 @@ export function LIST(params) {
   });
 }
 
+export function ITEM(data) {
+  return request({
+    url: `/pu/contract/${data}`,
+    method: "GET",
+  });
+}
+
 export function ADD(data) {
   return request({
     url: "/pu/contract/add",
@@ -55,10 +62,20 @@ export function TERMINATION(params) {
   });
 }
 
-export function ITEM(data) {
+export function PIGEONHOLE(data, params) {
   return request({
-    url: `/pu/contract/${data}`,
-    method: "GET",
+    url: `/pu/contract/pigeonhole`,
+    method: "PUT",
+    data: data,
+    params: params,
+  });
+}
+
+export function ALTERATION(data) {
+  return request({
+    url: `/pu/contract/alteration`,
+    method: "POST",
+    data: data,
   });
 }
 

+ 89 - 41
src/views/material/basicFile/details.vue

@@ -10,7 +10,7 @@
         <el-col :span="1.5">
           <el-button-group>
             <el-button size="small" @click="handleSave"
-                       v-hasPermi="['system:material:add', `${maintainNewVersion ? '' : 'system:material:versions'}`]">
+              v-hasPermi="['system:material:add', `${maintainNewVersion ? '' : 'system:material:versions'}`]">
               保存
             </el-button>
           </el-button-group>
@@ -108,13 +108,13 @@
         <el-form :inline="true" label-position="right" :model="basicData.value">
           <!-- <el-form-item label="所属组织"></el-form-item> -->
           <el-form-item label="物料编码">
-            <el-input v-model="basicData.value.code" readonly size="small"></el-input>
+            <el-input v-model="basicData.value.code" readonly size="mini"></el-input>
           </el-form-item>
           <el-form-item label="物料名称">
-            <el-input v-model="basicData.value.name" readonly size="small"></el-input>
+            <el-input v-model="basicData.value.name" readonly size="mini"></el-input>
           </el-form-item>
           <el-form-item label="英文名称">
-            <el-input v-model="basicData.value.enName" readonly size="small"></el-input>
+            <el-input v-model="basicData.value.enName" readonly size="mini"></el-input>
           </el-form-item>
           <!-- <el-form-item label="版本号"></el-form-item> -->
         </el-form>
@@ -128,8 +128,14 @@
               <div class="md-main">
 
                 <!-- 基本信息展示表单 -->
-                <el-form v-if="activeMainTab == 'material'" :inline="true" label-position="right"
-                         :hide-required-asterisk="true" :model="basicData.value">
+                <el-form 
+                  v-if="activeMainTab == 'material'" 
+                  :inline="true" 
+                  label-position="right"
+                  :hide-required-asterisk="true" 
+                  :model="basicData.value" 
+                  ref="basicMessageRef"
+                >
 
                   <el-row :gutter="10">
                     <el-col :span="8" v-for="f in basicData.form" style="text-align: right;">
@@ -137,18 +143,26 @@
                         <!--  :disabled="!(headerParam.isEdit && f.edit)" -->
 
                         <!-- 多选框 -->
-                        <el-form-item v-if="f.attribute == 'checkbox'" style="text-align: left;" :prop="f.prop">
+                        <el-form-item v-if="f.attribute == 'checkbox'" style="text-align: left;" :prop="f.prop"
+                        :rules="[{ required: f.required, message: `请选择${f.name}`, trigger: 'change' }]" >
                           <!-- :rules="[{ required: f.required, message: `请选择${f.name}`, trigger: 'change' }]" -->
 
-                          <el-checkbox :label="f.name" name="type" v-model="basicData.value[f.prop]" true-label="0"
-                                       false-label="2" :disabled="handleJudge(f)">
+                          <el-checkbox 
+                            :label="f.name" name="type" 
+                            v-model="basicData.value[f.prop]" 
+                            true-label="0"
+                            false-label="2" 
+                            :disabled="handleJudge(f)"
+                            size="mini"
+                          >
                           </el-checkbox>
                         </el-form-item>
 
                         <!-- 下拉框   -->
                         <el-form-item v-else-if="f.attribute == 'select'"
                                       :id="(updateButtonGroup && f.apiUrl) ? 'selected' : ''"
-                                      :prop="f.apiUrl ? `${f.prop}Name` : f.prop">
+                                      :prop="f.apiUrl ? `${f.prop}Name` : f.prop"
+                                      :rules="[{ required: f.required, message: `请选择${f.name}`, trigger: 'change' }]">
                           <!-- :rules="[{ required: f.required, message: `请选择${f.name}`, trigger: 'change' }]" -->
 
                           <template slot="label">
@@ -162,14 +176,16 @@
 
                           <!-- 参照 -->
                           <el-select v-if="f.apiUrl" v-model="basicData.value[`${f.prop}Name`]" placeholder="请选择"
+                              size="mini" :rules="[{ required: f.required, message: `请选择${f.name}`, trigger: 'change' }]"
                                      :key="basicData.value[f.prop]" :disabled="handleJudge(f)"
                                      @focus="f.apiUrl && handleQueryMore(f, '', { name: 'basicData', prop: f.prop })">
                             <div slot="empty"></div>
                           </el-select>
 
                           <!-- 字典 -->
-                          <el-select v-if="f.dictId" v-model="basicData.value[f.prop]" placeholder="请选择"
-                                     :key="basicData.value[f.prop]" :disabled="handleJudge(f)">
+                          <el-select v-if="f.dictId" v-model="basicData.value[f.prop]" placeholder="请选择" size="mini"
+                                     :key="basicData.value[f.prop]" :disabled="handleJudge(f)"
+                                     :rules="[{ required: f.required, message: `请选择${f.name}`, trigger: 'change' }]">
                             <el-option v-if="f.dictId" v-for="d in f.dictValue" :key="d.dictValue" :label="d.dictLabel"
                                        :value="d.dictValue">
                             </el-option>
@@ -186,7 +202,7 @@
                         </el-form-item>
 
                         <!--attribute 文本 数字 文本域 为null -->
-                        <el-form-item v-else :prop="f.prop">
+                        <el-form-item v-else :prop="f.prop" :rules="[{ required: f.required, message: `请选择${f.name}`, trigger: 'change' }]">
                           <!-- :rules="[{ required: f.required, message: `请输入${f.name}`, trigger: 'blur' }]" -->
 
                           <template slot="label">
@@ -198,8 +214,10 @@
                             </el-tooltip>
                           </template>
 
-                          <el-input size="small" v-model="basicData.value[f.prop]" :type="f.attribute || 'text'"
-                                    :readonly="handleJudge(f)">
+                          <el-input size="mini" v-model="basicData.value[f.prop]" :type="f.attribute || 'text'"
+                                    :readonly="handleJudge(f)"
+                                    :rules="[{ required: f.required, message: `请选择${f.name}`, trigger: 'change' }]"
+                                    >
                           </el-input>
                         </el-form-item>
 
@@ -247,7 +265,7 @@
 
                             <!-- 多选框 -->
                             <el-form-item v-if="m.attribute == 'checkbox'">
-                              <el-checkbox :label="m.name" name="type" v-model="medcineData.value[m.prop]"
+                              <el-checkbox :label="m.name" name="type" v-model="medcineData.value[m.prop]" size="mini"
                                            :disabled="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')"
                                            true-label="0" false-label="2">
                               </el-checkbox>
@@ -258,7 +276,7 @@
 
                               <!-- 参照弹窗 -->
                               <el-select v-if="m.apiUrl" v-model="medcineData.value[`${m.prop}Name`]" placeholder="请选择"
-                                         :key="medcineData.value[m.prop]"
+                                         :key="medcineData.value[m.prop]" size="mini"
                                          :disabled="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')"
                                          @focus="m.apiUrl && handleQueryMore(m, '', { name: 'medcineData', prop: m.prop })">
 
@@ -269,7 +287,7 @@
 
                               <!-- 下拉选择 -->
                               <el-select v-else v-model="medcineData.value[m.prop]" placeholder="请选择"
-                                         :key="medcineData.value[m.prop]"
+                                         :key="medcineData.value[m.prop]" size="mini"
                                          :disabled="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')"
                                          @focus="m.apiUrl && handleQueryMore(m, '', { name: 'medcineData', prop: m.prop })">
 
@@ -288,7 +306,7 @@
 
                             <!-- 文本、数字、textarae -->
                             <el-form-item v-else :label="m.name">
-                              <el-input size="small" v-model="medcineData.value[m.prop]" :type="m.attribute || 'text'"
+                              <el-input size="mini" v-model="medcineData.value[m.prop]" :type="m.attribute || 'text'"
                                         :readonly="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')">
                               </el-input>
                             </el-form-item>
@@ -345,16 +363,16 @@
                 <el-divider content-position="left">审计信息</el-divider>
                 <el-form :inline="true" label-position="right" :model="basicData.value">
                   <el-form-item label="创建人">
-                    <el-input v-model="basicData.value.createByName" size="small" readonly></el-input>
+                    <el-input v-model="basicData.value.createByName" size="mini" readonly></el-input>
                   </el-form-item>
                   <el-form-item label="创建时间">
-                    <el-input v-model="basicData.value.createTime" size="small" readonly></el-input>
+                    <el-input v-model="basicData.value.createTime" size="mini" readonly></el-input>
                   </el-form-item>
                   <el-form-item label="最后修改人">
-                    <el-input v-model="basicData.value.updateByName" size="small" readonly></el-input>
+                    <el-input v-model="basicData.value.updateByName" size="mini" readonly></el-input>
                   </el-form-item>
                   <el-form-item label="最后修改时间">
-                    <el-input v-model="basicData.value.updateTime" size="small" readonly></el-input>
+                    <el-input v-model="basicData.value.updateTime" size="mini" readonly></el-input>
                   </el-form-item>
 
                 </el-form>
@@ -402,24 +420,24 @@
           <template slot-scope="scope">
             <!-- :prop="mt.prop" -->
             <!-- 多选框 -->
-            <el-checkbox size="small" v-if="mt.attribute == 'checkbox'" :disabled="!(materialType.isEdit && mt.edit)"
+            <el-checkbox size="mini" v-if="mt.attribute == 'checkbox'" :disabled="!(materialType.isEdit && mt.edit)"
                          true-label="0" false-label="2" v-model="scope.row[mt.prop]"/>
 
             <!-- 下拉框 / 参照弹窗---- 药品类别编码 scope.row[`${mt.prop}Name`] -->
-            <el-select size="small" v-else-if="mt.attribute == 'select' && mt.apiUrl" placeholder="请选择"
+            <el-select size="mini" v-else-if="mt.attribute == 'select' && mt.apiUrl" placeholder="请选择"
                        :disabled="!(materialType.isEdit && mt.edit)" v-model="scope.row[mt.prop]"
                        :key="scope.row[mt.prop]"
                        @focus="mt.apiUrl && handleQueryMore(mt, '', { name: 'materialType', prop: scope.row })">
               <div slot="empty"></div>
             </el-select>
 
-            <!-- <el-select size="small" v-else-if="mt.attribute == 'select' && mt.dictId"  placeholder="请选择"
+            <!-- <el-select size="mini" v-else-if="mt.attribute == 'select' && mt.dictId"  placeholder="请选择"
               :disabled="!(materialType.isEdit && mt.edit)" v-model="scope.row[mt.prop]" :key="scope.row[mt.prop]">
               <el-option v-if="mt.dictId" v-for="d in mt.dictId" :key="d.dictValue" :label="d.dictLabel"
                 :value="d.dictValue"></el-option></el-select> -->
 
             <!-- 其他类型 -->
-            <el-input v-else size="small" v-model="scope.row[mt.prop]" :readonly="!(materialType.isEdit && mt.edit)"/>
+            <el-input v-else size="mini" v-model="scope.row[mt.prop]" :readonly="!(materialType.isEdit && mt.edit)"/>
           </template>
 
         </el-table-column>
@@ -438,9 +456,15 @@
 
 
     <!-- 其他页签的操作 -->
-    <el-dialog :title="otherDeatils.title" :visible.sync="otherDeatils.show" show-close width="70%"
-               :before-close="handleCloseOtherDetails" :close-on-press-escape="false" :close-on-click-modal="false"
-               class="otherDialog">
+    <el-dialog 
+      :title="otherDeatils.title" 
+      :visible.sync="otherDeatils.show" 
+      show-close width="70%"
+      :before-close="handleCloseOtherDetails" 
+      :close-on-press-escape="false" 
+      :close-on-click-modal="false"
+      class="otherDialog"
+    >
       <div v-loading="otherDeatils.loading">
         <!-- 其他标签页操作  修改、删除 -->
         <el-row :gutter="10" class="mb10">
@@ -567,7 +591,7 @@
       <div>
         <el-row>
           <el-col :span="1.5">
-            <el-input v-model="MoreDataDialog.key" placeholder="过滤" size="small" @change="handleFilterRefer"/>
+            <el-input v-model="MoreDataDialog.key" placeholder="过滤" size="mini" @change="handleFilterRefer"/>
           </el-col>
         </el-row>
         <!-- 树形 -->
@@ -1557,18 +1581,28 @@
       // 保存修改
       handleSave() {
         console.log('保存修改');
-        this.loading = true;
-        // 普通保存修改
-        this.updateButtonGroup && this.handleSaveMaterial(() => {
-          this.updateButtonGroup = false;
-          this.handleRefresh();
-        });
+        this.$refs['basicMessageRef'].validate(async (valid) => {
+          
+          if(valid){
+            this.loading = true;
+            // 普通保存修改
+            this.updateButtonGroup && this.handleSaveMaterial(() => {
+              this.updateButtonGroup = false;
+              this.handleRefresh();
+            });
 
-        // 维护新版本保存修改
-        this.maintainNewVersion && this.handleSaveNewVersion(() => {
-          this.maintainNewVersion = false;
-          this.handleRefresh();
+            // 维护新版本保存修改
+            this.maintainNewVersion && this.handleSaveNewVersion(() => {
+              this.maintainNewVersion = false;
+              this.handleRefresh();
+            })
+          }else {
+            this.$message.error('存在必填项未填写');
+            console.log('error submit!!');
+            return false;
+          }
         })
+        
       },
       // 物料类别列表选中
       handleSelectionType(list) {
@@ -2069,6 +2103,20 @@
           return item;
         })
       },
+      "basicData.value.isMedicine": {
+        handler(nVal, oVal) {
+          this.basicData.form = this.basicData.form.map(formItem =>{
+
+            if(formItem.prop === 'productionPermit'){
+
+              formItem.required = nVal == '0' ? true :false;
+
+            }
+            return formItem;
+          })
+        },
+        deep: true,
+      },
 
     },
 

+ 2 - 2
src/views/purchase/DemandSummary/add.vue

@@ -24,10 +24,10 @@
         <el-table-column show-overflow-tooltip label="品名" align="center" prop="materialName" width="180"/>
         <el-table-column show-overflow-tooltip label="规格" align="center" prop="specification"/>
         <el-table-column show-overflow-tooltip label="单位" align="center" prop="unit"/>
-        <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturer" width="150"/>
+        <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturerName" width="150"/>
         <el-table-column show-overflow-tooltip label="末级供应仓库存量" align="center" prop="lastWarehouseQty" width="150"/>
         <el-table-column show-overflow-tooltip label="月销量" align="center" prop="totalMonthlySales"/>
-        <el-table-column show-overflow-tooltip label="采购周期" align="center" prop="buyPeriod"/>
+        <el-table-column show-overflow-tooltip label="采购周期" align="center" prop="puPeriod"/>
         <el-table-column show-overflow-tooltip label="最终净需求量" align="center" prop="resDemandQty" width="150"/>
         <el-table-column show-overflow-tooltip label="最终采购量" align="center" prop="puQtyRes" width="150"/>
         <el-table-column show-overflow-tooltip label="需求客户" align="center" prop="customerName"/>

+ 1 - 1
src/views/purchase/DemandSummary/index.vue

@@ -295,7 +295,7 @@
             </template>
           </el-table-column>
           <el-table-column show-overflow-tooltip label="建议采购量" align="center" prop="suggestionPurchase" width="100px"/>
-          <el-table-column show-overflow-tooltip label="建议净采购量" align="center" prop="suggestBuyQty" width="100px"/>
+          <!-- <el-table-column show-overflow-tooltip label="建议净采购量" align="center" prop="suggestBuyQty" width="100px"/> -->
           <el-table-column show-overflow-tooltip label="最终采购量" align="center" prop="finalBuyQty" width="150">
             <template slot-scope="scope">
                 <el-input :disabled="scope.row.status !== '1' || lineDisable" v-model="scope.row.finalBuyQty"/>

+ 40 - 9
src/views/purchase/PurchaseDemandList/add.vue

@@ -56,7 +56,9 @@
 
          <el-col :span="1.5">
             <el-form-item label="客户负责人">
-              <el-input disabled v-model="basicForm.customerPrincipal" size="small" style="width: 200px"></el-input>
+              <el-select disabled size="small" v-model="basicForm.customerPrincipal" style="width: 200px">
+                <el-option v-for="item in manOptions" :key="item.id" :label="item.name" :value="item.code"/>
+              </el-select>
             </el-form-item>
           </el-col>
 
@@ -419,7 +421,7 @@
               </el-form-item>
             </template>
           </el-table-column> -->
-          <el-table-column show-overflow-tooltip label="末级供应库存组织" align="center" prop="superiorStockOrgName" width="200px"></el-table-column>
+          <el-table-column show-overflow-tooltip label="末级供应库存组织" align="center" prop="lastStockOrgName" width="200px"></el-table-column>
           <el-table-column show-overflow-tooltip label="中心仓可用量" align="center"  prop="centralWarehouseQty" width="200px"/>
           <el-table-column show-overflow-tooltip label="调拨单号" align="center"  prop="allotCode"></el-table-column>
           <el-table-column show-overflow-tooltip label="收货地址" align="center"  prop="deliveryAddressName" width="200px">
@@ -535,6 +537,7 @@ export default {
         remark: '',
         puDemandItemList: []
       },
+      delDemandItemList: [],
       options: [{
         value: 'Y', label: '是',
       }, {
@@ -554,6 +557,7 @@ export default {
       // },
       tableIndex: null,
       orgOptions: [],
+      manOptions: [],
       personOptions: [],
       deptOptions: [],
       customerOptions: [],
@@ -626,7 +630,9 @@ export default {
     },
     // 获取预留数量
     getYLSL(scope) {
-      scope.row.reservedQty = Math.ceil(scope.row.reservedProportion.replace('%', '') / 100 * scope.row.qty)
+      if (scope.row.reservedProportion) {
+        scope.row.reservedQty = Math.ceil(scope.row.reservedProportion.replace('%', '') / 100 * scope.row.qty)
+      }
       // 如果选择预留比例,预留周期必填
       if(scope.row.reservedQty && scope.row.reservedQty !== 0) {
         this.isYl = true
@@ -665,10 +671,12 @@ export default {
         this.$refs['basic'].validate((valid) => {
           if(valid) {
             if(this.sonPageStu == 'add') {
+              this.$modal.loading("操作中...");
               this.handleData()
               addDemand(this.basicForm).then(res => {
                 console.log(333)
                 if (res.code === 200) {
+                  this.$modal.closeLoading();
                   this.$modal.msgSuccess("保存成功");
                   this.$emit('jugislist', true)
                   let queryParams = {
@@ -679,10 +687,18 @@ export default {
                 }
               })
             } else if (this.sonPageStu == 'edit') {
+              this.$modal.loading("操作中...");
+              this.basicForm.puDemandItemList.push(...this.delDemandItemList)
               editDemand(this.basicForm).then(res => {
                 if (res.code === 200) {
+                  this.$modal.closeLoading();
                   this.$modal.msgSuccess("编辑成功");
-                  this.back()
+                  this.$emit('jugislist', true)
+                  let queryParams = {
+                    pageNum: 1,
+                    pageSize: 10
+                  }
+                  this.$emit('refresh', queryParams)
                 }
               })
             }
@@ -818,12 +834,23 @@ export default {
         this.BDZT = true
       }
     },
-    delLine(index) {
+    delLine(index, row) {
       console.log('删除行:', index)
+      console.log('改变行:', row)
       // this.basicForm.puDemandItemList = this.basicForm.puDemandItemList.filter(item => {
       //   return item.id !== row.id
       // })
-      this.basicForm.puDemandItemList.splice(index,1)
+      row.delFlag = '2'
+      // this.basicForm.puDemandItemList.splice(index,1)
+      let delList = []
+      delList = this.basicForm.puDemandItemList.filter(item => {
+        return item.delFlag == '2'
+      })
+      this.basicForm.puDemandItemList = this.basicForm.puDemandItemList.filter(item => {
+        return item.delFlag == '0'
+      })
+      this.delDemandItemList.push(...delList)
+      console.log('删除的数组',this.delDemandItemList)
     },
     back() {
       this.$emit('jugislist', true)
@@ -847,7 +874,8 @@ export default {
               this.basicForm = reciveForm
               if(this.basicForm.org) { this.reBackRefer('ORG_PARAM', this.basicForm.org) }
               if(this.basicForm.customer) { this.reBackRefer('CUSTOMER_PARAM', this.basicForm.customer) }
-              if(this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal) }
+              if(this.basicForm.customerPrincipal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.customerPrincipal, '客户负责人') }
+              if(this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal, '需求人员') }
               if(this.basicForm.demandDept) { this.reBackRefer('DEPT_PARAM', this.basicForm.demandDept) }
               // 详情时将收货仓库id赋值给stordocId
               // 如果业务类型为补单需求,则明细内补单供应商编码可以编辑
@@ -873,7 +901,7 @@ export default {
       this.dialog.config = val
     },
     // 回显参照框
-    reBackRefer(type, id) {
+    reBackRefer(type, id, title) {
       getRefer({type: type, id: id}).then(res => {
         if(type == 'ORG_PARAM') {
           this.orgOptions = res.rows
@@ -881,9 +909,12 @@ export default {
         if (type == 'CUSTOMER_PARAM') {
           this.customerOptions = res.rows
         }
-        if (type == 'CONTACTS_PARAM') {
+        if (type == 'CONTACTS_PARAM' && title == '需求人员') {
           this.personOptions = res.rows
         }
+        if (type == 'CONTACTS_PARAM' && title == '客户负责人') {
+          this.manOptions = res.rows
+        }
         if (type == 'DEPT_PARAM') {
           this.deptOptions = res.rows
         }

+ 2 - 2
src/views/purchase/apply/add/column.js

@@ -177,9 +177,9 @@ export const TabColumns = [
         referName: "MATERIAL_PARAM",
         dataMapping: {
           material: "id",
+          unit: "unitId",
           materialCode: "code",
           materialName: "name",
-          puUnit: "unitIdName",
           specification: "specification",
           manufacturer: "manufacturerIdName",
         },
@@ -204,7 +204,7 @@ export const TabColumns = [
         width: 200,
         referName: "UNIT_PARAM",
         dataMapping: {
-          puUnit: "name",
+          unit: "name",
         },
       },
       {

+ 52 - 8
src/views/purchase/apply/add/index.vue

@@ -2,8 +2,9 @@
 import Column from "./column";
 import useData from "../hooks/data";
 import useDicts from "../hooks/dicts";
-import useTable from "../hooks/table-function";
 import useMethods from "../hooks/function";
+import useTable from "../hooks/table-function";
+import { SAVE } from "@/api/business/purchase/apply";
 
 export default {
   name: "AddDrawer",
@@ -30,14 +31,17 @@ export default {
     },
     //
     async open(prop) {
-      const { open, fetchItem } = useMethods();
-      await open({ _this: this });
-      if (prop) await fetchItem({ _this: this, prop });
+      this.visible = true;
+      this.tabName = this.tabColumns[0].key;
+      if (prop) {
+        const { fetchItem } = useMethods();
+        this.params = await fetchItem({ _this: this, prop });
+      }
     },
     //
     async hide() {
-      const { hide } = useMethods();
-      await hide({ _this: this });
+      this.visible = false;
+      this.params = this.resetParams();
     },
     //
     async useRowAdd(prop) {
@@ -51,8 +55,48 @@ export default {
     },
     //
     async useSubmit(prop) {
-      const { add } = useMethods();
-      await add({ _this: this, prop });
+      this.$refs[prop].validate(async (valid) => {
+        if (valid) {
+          try {
+            // try
+            const {
+              priceApplyOrgs: _priceApplyOrgs,
+              priceApplyItems: _priceApplyItems,
+            } = this.params;
+            const id = undefined;
+            const priceApplyOrgs = _priceApplyOrgs.map((item) => ({
+              ...item,
+              id: undefined,
+              applyId: undefined,
+            }));
+            const priceApplyItems = _priceApplyItems.map((item) => ({
+              ...item,
+              id: undefined,
+              applyId: undefined,
+            }));
+            const params = {
+              ...this.params,
+              id,
+              priceApplyOrgs,
+              priceApplyItems,
+            };
+            const { msg, code } = await SAVE(params);
+            if (code === 200) {
+              this.hide();
+              this.$emit("success");
+              this.$notify.success(msg);
+            }
+          } catch (err) {
+            // catch
+            console.error(err);
+          } finally {
+            // finally
+            this.loading = false;
+          }
+        } else {
+          return false;
+        }
+      });
     },
   },
   created() {},

+ 1 - 1
src/views/purchase/apply/delete/index.vue

@@ -11,7 +11,7 @@ export default {
   methods: {
     //
     open(prop) {
-      this.$confirm("是否删除数据项?", "提示", {
+      return this.$confirm("是否删除数据项?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "info",

+ 30 - 8
src/views/purchase/apply/edit/index.vue

@@ -2,8 +2,9 @@
 import Column from "./column";
 import useData from "../hooks/data";
 import useDicts from "../hooks/dicts";
-import useTable from "../hooks/table-function";
 import useMethods from "../hooks/function";
+import useTable from "../hooks/table-function";
+import { SAVE } from "@/api/business/purchase/apply";
 
 export default {
   name: "EditDrawer",
@@ -46,14 +47,15 @@ export default {
     },
     //
     async open(prop) {
-      const { open, fetchItem } = useMethods();
-      await open({ _this: this });
-      if (prop) await fetchItem({ _this: this, prop });
+      this.visible = true;
+      this.tabName = this.tabColumns[0].key;
+      const { fetchItem } = useMethods();
+      this.params = await fetchItem({ _this: this, prop });
     },
     //
     async hide() {
-      const { hide } = useMethods();
-      await hide({ _this: this });
+      this.visible = false;
+      this.params = this.resetParams();
     },
     //
     async useRowAdd(prop) {
@@ -67,8 +69,28 @@ export default {
     },
     //
     async useSubmit(prop) {
-      const { edit } = useMethods();
-      await edit({ _this: this, prop });
+      this.$refs[prop].validate(async (valid) => {
+        if (valid) {
+          try {
+            // try
+            const params = { ...this.params };
+            const { msg, code } = await SAVE(params);
+            if (code === 200) {
+              this.hide();
+              this.$emit("success");
+              this.$notify.success(msg);
+            }
+          } catch (err) {
+            // catch
+            console.error(err);
+          } finally {
+            // finally
+            this.loading = false;
+          }
+        } else {
+          return false;
+        }
+      });
     },
   },
   created() {},

+ 6 - 0
src/views/purchase/apply/hooks/data.js

@@ -13,6 +13,11 @@ export default function useData(prop) {
     priceApplyItems: [],
     ...initParams(FormColumns),
   };
+  const resetParams = () => ({
+    priceApplyOrgs: [],
+    priceApplyItems: [],
+    ...initParams(FormColumns),
+  });
   const tabColumns = TabColumns;
   const tabName = "priceApplyItems";
   return {
@@ -25,5 +30,6 @@ export default function useData(prop) {
     params,
     tabColumns,
     tabName,
+    resetParams,
   };
 }

+ 2 - 82
src/views/purchase/apply/hooks/function.js

@@ -1,6 +1,6 @@
 import { REFER } from "@/components/popover-select/api";
 import { EXIST } from "@/api/business/purchase/catalogue";
-import { SAVE, ITEM } from "@/api/business/purchase/apply";
+import {  ITEM } from "@/api/business/purchase/apply";
 
 export default function useMethods() {
   const fetchItem = async ({ _this, prop }) => {
@@ -9,7 +9,7 @@ export default function useMethods() {
       _this.loading = true;
       const { code, data } = await ITEM(prop);
       if (code === 200) {
-        _this.params = data;
+        return data;
       }
     } catch (err) {
       // catch
@@ -50,7 +50,6 @@ export default function useMethods() {
           source.recentlyPrice = recentlyPrice;
           source.isApprovalFirst = isApprovalFirst;
           source.isPriceAdjustment = isPriceAdjustment;
-// _this.$u
         }
       } catch (err) {
         // catch
@@ -61,87 +60,8 @@ export default function useMethods() {
       }
     }
   };
-  const open = ({ _this }) => {
-    _this.visible = true;
-    _this.tabName = _this.tabColumns[0].key;
-  };
-  const hide = ({ _this }) => {
-    _this.visible = false;
-  };
-  const add = ({ _this, prop }) => {
-    _this.$refs[prop].validate(async (valid) => {
-      if (valid) {
-        try {
-          // try
-          const {
-            priceApplyOrgs: _priceApplyOrgs,
-            priceApplyItems: _priceApplyItems,
-          } = _this.params;
-          const id = undefined;
-          const priceApplyOrgs = _priceApplyOrgs.map((item) => ({
-            ...item,
-            id: undefined,
-            applyId: undefined,
-          }));
-          const priceApplyItems = _priceApplyItems.map((item) => ({
-            ...item,
-            id: undefined,
-            applyId: undefined,
-          }));
-          const { msg, code } = await SAVE({
-            ..._this.params,
-            id,
-            priceApplyOrgs,
-            priceApplyItems,
-          });
-          if (code === 200) {
-            _this.hide();
-            _this.$emit("success");
-            _this.$notify.success(msg);
-          }
-        } catch (err) {
-          // catch
-          console.error(err);
-        } finally {
-          // finally
-          _this.loading = false;
-        }
-      } else {
-        return false;
-      }
-    });
-  };
-  const edit = ({ _this, prop }) => {
-    _this.$refs[prop].validate(async (valid) => {
-      if (valid) {
-        try {
-          // try
-          const { msg, code } = await SAVE({
-            ..._this.params,
-          });
-          if (code === 200) {
-            _this.hide();
-            _this.$emit("success");
-            _this.$notify.success(msg);
-          }
-        } catch (err) {
-          // catch
-          console.error(err);
-        } finally {
-          // finally
-          _this.loading = false;
-        }
-      } else {
-        return false;
-      }
-    });
-  };
 
   return {
-    open,
-    hide,
-    add,
-    edit,
     fetchItem,
     fetchRefer,
   };

+ 23 - 6
src/views/purchase/apply/see/index.vue

@@ -26,19 +26,23 @@ export default {
   methods: {
     //
     async open(prop) {
-      const { open, fetchItem } = useMethods();
-      await open({ _this: this });
-      await fetchItem({ _this: this, prop });
+      this.visible = true;
+      this.tabName = this.tabColumns[0].key;
+      const { fetchItem } = useMethods();
+      this.params = await fetchItem({ _this: this, prop });
     },
     //
     async hide() {
-      const { hide } = useMethods();
-      await hide({ _this: this });
+      this.visible = false;
+    },
+    //
+    async useDelete(prop) {
+      const { useDelete } = this.$parent.$parent;
+      await useDelete(prop).then(() => this.hide());
     },
     //
     async useCopy(prop) {
       const { useCopy } = this.$parent.$parent;
-      await this.hide();
       await useCopy(prop);
     },
     //
@@ -80,6 +84,19 @@ export default {
         <el-tooltip
           class="item"
           effect="dark"
+          content="删 除"
+          placement="bottom-end"
+        >
+          <el-button
+            :size="size"
+            circle
+            icon="el-icon-delete"
+            @click="useDelete([params])"
+          ></el-button>
+        </el-tooltip>
+        <el-tooltip
+          class="item"
+          effect="dark"
           content="复 制"
           placement="bottom-end"
         >

+ 8 - 1
src/views/purchase/catalogue/column.js

@@ -106,7 +106,14 @@ export const SearchColumns = [
     },
   },
   { key: "source", title: "来源单据编号", inputType: "Input" },
-  { key: "material", title: "物料编码", inputType: "Input" },
+  {
+    key: "material",
+    title: "物料编码",
+    inputType: "PopoverSelect",
+    width: 200,
+    referName: "MATERIAL_PARAM",
+    valueKey: "code",
+  },
   {
     key: "status",
     title: "有效状态",

+ 0 - 4
src/views/purchase/contract/add/column.js

@@ -426,7 +426,6 @@ export const TabColumns = [
           customerName: "name",
         },
       },
-      { title: "备注", key: "remark", inputType: "Input", width: 200 },
     ],
   },
   {
@@ -438,7 +437,6 @@ export const TabColumns = [
       { title: "条款内容", key: "content", inputType: "Input" },
       { title: "变量序号", key: "variableRowno" },
       { title: "变量内容", key: "variableContent", inputType: "Input" },
-      { title: "备注", key: "remark", inputType: "Input" },
     ],
   },
   {
@@ -453,7 +451,6 @@ export const TabColumns = [
         inputType: "InputNumber",
         width: 200,
       },
-      { title: "备注", key: "remark", inputType: "Input" },
     ],
   },
   {
@@ -500,7 +497,6 @@ export const TabColumns = [
           paymentMeans: "name",
         },
       },
-      { title: "备注", key: "remark", inputType: "Input", width: 200 },
       {
         title: "需进度确认",
         key: "schedule",

+ 44 - 0
src/views/purchase/contract/alteration/index.vue

@@ -0,0 +1,44 @@
+<script>
+import { ALTERATION } from "@/api/business/purchase/contract";
+
+export default {
+  name: "DeleteDialog",
+  data() {
+    return {};
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    //
+    open(prop) {
+      this.$confirm("是否变更数据项?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "info",
+      })
+        .then(async () => {
+          try {
+            // try
+            const { msg, code } = await ALTERATION(prop);
+            if (code === 200) {
+              this.$emit("success");
+              this.$notify.success(msg);
+            }
+          } catch (err) {
+            // catch
+            console.error(err);
+          } finally {
+            // finally
+          }
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template></template>

+ 6 - 0
src/views/purchase/contract/column.js

@@ -5,6 +5,12 @@ export const FormColumns = [
   },
   { key: "code", title: "合同编码" },
   {
+    key: "status",
+    title: "状态",
+    inputType: "Select",
+    referName: "documents_status",
+  },
+  {
     key: "lastPuMoney",
     title: "上年度采购额",
   },

+ 14 - 3
src/views/purchase/contract/delete/index.vue

@@ -1,5 +1,5 @@
 <script>
-import useMethods from "../hooks/function";
+import { REMOVE } from "@/api/business/purchase/contract";
 
 export default {
   name: "DeleteDialog",
@@ -17,8 +17,19 @@ export default {
         type: "info",
       })
         .then(async () => {
-          const { remove } = useMethods();
-          await remove({ _this: this, prop });
+          try {
+            // try
+            const { msg, code } = await REMOVE(prop);
+            if (code === 200) {
+              this.$emit("success");
+              this.$notify.success(msg);
+            }
+          } catch (err) {
+            // catch
+            console.error(err);
+          } finally {
+            // finally
+          }
         })
         .catch((err) => {
           console.error(err);

+ 19 - 2
src/views/purchase/contract/edit/index.vue

@@ -16,7 +16,11 @@ export default {
       ...useData(Column),
     };
   },
-  computed: {},
+  computed: {
+    hasPowerAlteration: function () {
+      return this.$parent.$parent.hasPowerAlteration;
+    },
+  },
   watch: {
     "params.contractType": watchContractType(),
   },
@@ -58,6 +62,11 @@ export default {
       const { submit } = useMethods();
       await submit({ _this: this, prop, type: "EDIT" });
     },
+    //
+    async useAlteration(prop) {
+      const { useAlteration } = this.$parent.$parent;
+      await useAlteration(prop);
+    },
   },
   created() {},
   mounted() {},
@@ -81,6 +90,15 @@ export default {
           @click="hide"
         ></el-button>
         <el-button
+          v-if="hasPowerAlteration([params])"
+          :size="size"
+          circle
+          icon="el-icon-check"
+          @click="useAlteration([params])"
+        >
+        </el-button>
+        <el-button
+          v-else
           :size="size"
           circle
           icon="el-icon-check"
@@ -190,7 +208,6 @@ export default {
                 :name="column.key"
                 lazy
               >
-                <el-divider></el-divider>
                 <el-table :size="size" :data="params[column.key]">
                   <el-table-column label="序号">
                     <template slot-scope="scope">

+ 1 - 40
src/views/purchase/contract/hooks/function.js

@@ -1,12 +1,5 @@
 import { REFER } from "@/components/popover-select/api";
-import {
-  ADD,
-  EDIT,
-  ITEM,
-  CODE,
-  REMOVE,
-  TERMINATION,
-} from "@/api/business/purchase/contract";
+import { ADD, EDIT, ITEM, CODE } from "@/api/business/purchase/contract";
 
 export default function useMethods() {
   const fetchCode = async ({ _this }) => {
@@ -105,42 +98,10 @@ export default function useMethods() {
       }
     });
   };
-  const remove = async ({ _this, prop }) => {
-    try {
-      // try
-      const { msg, code } = await REMOVE(prop);
-      if (code === 200) {
-        _this.$emit("success");
-        _this.$notify.success(msg);
-      }
-    } catch (err) {
-      // catch
-      console.error(err);
-    } finally {
-      // finally
-    }
-  };
-  const termination = async ({ _this, prop }) => {
-    try {
-      // try
-      const { code } = await TERMINATION({ id: prop });
-      if (code === 200) {
-        _this.$emit("success");
-        _this.$notify.success(msg);
-      }
-    } catch (err) {
-      // catch
-      console.error(err);
-    } finally {
-      // finally
-    }
-  };
   return {
     open,
     hide,
     submit,
-    remove,
-    termination,
     fetchRefer,
     fetchCode,
     fetchItem,

+ 80 - 57
src/views/purchase/contract/index.vue

@@ -14,6 +14,8 @@ export default {
     RecordModel: () => import("./record/index.vue"),
     DeleteModel: () => import("./delete/index.vue"),
     TerminationModel: () => import("./termination/index.vue"),
+    PigeonholeModel: () => import("./pigeonhole/index.vue"),
+    AlterationModel: () => import("./alteration/index.vue"),
   },
   data() {
     return {
@@ -22,7 +24,7 @@ export default {
       searchColumns: SearchColumns,
       params: initParams(SearchColumns),
       tableData: [],
-      currentData: [],
+      selectData: [],
       tableColumns: FormColumns,
       page: { pageNum: 1, pageSize: 10, total: 0 },
     };
@@ -57,6 +59,7 @@ export default {
     },
     // 查 询
     useQuery(prop, page) {
+      this.selectData = [];
       this.fetchList(prop, page);
     },
     // 重 置
@@ -67,7 +70,7 @@ export default {
     },
     // 选 择
     useSelect(prop) {
-      this.currentData = [prop];
+      this.selectData = prop;
     },
     // 新 增
     async useAdd() {
@@ -80,15 +83,29 @@ export default {
       const { open } = this.$refs.DeleteModel;
       await open(id);
     },
+    hasPowerDelete(prop) {
+      if (prop.length === 1) {
+        const [{ status }] = prop;
+        if (status !== "2") return true;
+        else return false;
+      }
+    },
     // 编 辑
     async useEdit(prop) {
       const [{ id }] = prop;
       const { open } = this.$refs.EditModel;
       await open(id);
     },
+    hasPowerEdit(prop) {
+      if (prop.length === 1) {
+        const [{ status }] = prop;
+        if (status !== "2") return true;
+        else return false;
+      }
+    },
     // 明 细
     async useSee(prop) {
-      const [{ id }] = prop;
+      const { id } = prop;
       const { open } = this.$refs.SeeModel;
       await open(id);
     },
@@ -98,6 +115,38 @@ export default {
       const { open } = this.$refs.TerminationModel;
       await open(id);
     },
+    hasPowerTermination(prop) {
+      if (prop.length === 1) {
+        const [{ status }] = prop;
+        if (status === "2") return true;
+        else return false;
+      }
+    },
+    // 归 档
+    async usePigeonhole(prop) {
+      const [{ id }] = prop;
+      const { open } = this.$refs.PigeonholeModel;
+      await open(id);
+    },
+    hasPowerPigeonhole(prop) {
+      if (prop.length === 1) {
+        const [{ status }] = prop;
+        if (status === "2") return true;
+        else return false;
+      }
+    },
+    // 变 更
+    async useAlteration(prop) {
+      const { open } = this.$refs.AlterationModel;
+      await open(prop[0]);
+    },
+    hasPowerAlteration(prop) {
+      if (prop.length === 1) {
+        const [{ status }] = prop;
+        if (status === "2") return true;
+        else return false;
+      }
+    },
     // 导 出
     async useExport(prop) {
       const { pageNum, pageSize } = this.page;
@@ -143,6 +192,14 @@ export default {
       ref="TerminationModel"
       @success="useQuery(params, page)"
     ></termination-model>
+    <pigeonhole-model
+      ref="PigeonholeModel"
+      @success="useQuery(params, page)"
+    ></pigeonhole-model>
+    <alteration-model
+      ref="AlterationModel"
+      @success="useQuery(params, page)"
+    ></alteration-model>
     <el-form
       :size="size"
       :model="params"
@@ -175,35 +232,37 @@ export default {
       <el-button :size="size" @click="useAdd"> 新 增 </el-button>
       <el-button :size="size" @click="useRecord"> 期初补录 </el-button>
       <el-button
+        v-show="hasPowerDelete(selectData)"
         :size="size"
-        :disabled="!currentData.length"
-        @click="useEdit(currentData)"
+        @click="useDelete(selectData)"
       >
-        编 辑
+        删 除
       </el-button>
       <el-button
+        v-show="hasPowerTermination(selectData)"
         :size="size"
-        :disabled="!currentData.length"
-        @click="useDelete(currentData)"
+        :disabled="!selectData.length"
+        @click="useTermination(selectData)"
       >
-        删 除
+        终 止
       </el-button>
       <el-button
+        v-show="hasPowerPigeonhole(selectData)"
         :size="size"
-        :disabled="!currentData.length"
-        @click="useTermination(currentData)"
+        @click="usePigeonhole(selectData)"
       >
-        终 止
+        归 档
       </el-button>
-      <el-button :size="size" :disabled="!currentData.length">
+      <el-button
+        v-show="hasPowerAlteration(selectData)"
+        :size="size"
+        @click="useAlteration(selectData)"
+      >
         变 更
       </el-button>
-      <el-button :size="size" :disabled="!currentData.length">
-        归 档
-      </el-button>
       <el-button
         :size="size"
-        :disabled="!currentData.length"
+        :disabled="!selectData.length"
         @click="useExport(params)"
       >
         导 出
@@ -214,10 +273,13 @@ export default {
       :size="size"
       :data="tableData"
       highlight-current-row
-      @row-click="useSelect"
       @row-dblclick="useSee"
+      @selection-change="useSelect"
+      @row-click="useSelect([$event])"
       style="width: 100%; margin: 20px 0 0 0"
     >
+      <el-table-column fixed width="55" align="center" type="selection">
+      </el-table-column>
       <el-table-column
         v-for="(column, index) in tableColumns"
         :key="index"
@@ -240,45 +302,6 @@ export default {
           <span v-else>{{ scope.row[column.key] }}</span>
         </template>
       </el-table-column>
-      <!-- <el-table-column fixed="right" label="操作" width="150">
-        <template slot-scope="scope">
-          <el-button
-            type="text"
-            size="small"
-            @click.native.prevent="useEdit(scope.row)"
-          >
-            编 辑
-          </el-button>
-          <el-button
-            type="text"
-            size="small"
-            @click.native.prevent="useEdit(scope.row)"
-          >
-            变 更
-          </el-button>
-          <el-button
-            type="text"
-            size="small"
-            @click.native.prevent="useEdit(scope.row)"
-          >
-            归 档
-          </el-button>
-          <el-button
-            type="text"
-            size="small"
-            @click.native.prevent="useTermination(scope.row)"
-          >
-            终 止
-          </el-button>
-          <el-button
-            type="text"
-            size="small"
-            @click.native.prevent="useDelete(scope.row)"
-          >
-            删 除
-          </el-button>
-        </template>
-      </el-table-column> -->
     </el-table>
     <pagination
       :total="page.total"

+ 97 - 0
src/views/purchase/contract/pigeonhole/index.vue

@@ -0,0 +1,97 @@
+<script>
+import { PIGEONHOLE } from "@/api/business/purchase/contract";
+
+export default {
+  name: "DeleteDialog",
+  data() {
+    return {
+      size: "mini",
+      title: "归 档",
+      visible: false,
+      loading: false,
+      params: { id: "", pigeonholeFile: "" },
+    };
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    //
+    open(prop) {
+      this.visible = true;
+      this.params.id = prop;
+    },
+    //
+    hide() {
+      this.visible = false;
+      this.params.id = "";
+      this.params.pigeonholeFile = "";
+    },
+    //
+    async submit(prop) {
+      try {
+        // try
+        this.loading = true;
+        const { id, pigeonholeFile } = prop;
+        const { msg, code } = await PIGEONHOLE({ id, pigeonholeFile });
+        if (code === 200) {
+          this.hide();
+          this.$emit("success");
+          this.$notify.success({ title: msg });
+        }
+      } catch (err) {
+        // catch
+        console.error(err);
+      } finally {
+        // loading
+        this.loading = false;
+      }
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template>
+  <el-dialog
+    width="25%"
+    :show-close="false"
+    :visible.sync="visible"
+    @close="hide"
+  >
+    <div
+      slot="title"
+      style="display: flex; justify-content: space-between; align-items: center"
+    >
+      <span>{{ title }}</span>
+      <span>
+        <el-button
+          :size="size"
+          :disabled="loading"
+          circle
+          icon="el-icon-close"
+          @click="visible = false"
+        >
+        </el-button>
+        <el-button
+          :size="size"
+          :disabled="!params.pigeonholeFile || loading"
+          circle
+          icon="el-icon-check"
+          @click="submit(params)"
+        >
+        </el-button>
+      </span>
+    </div>
+    <el-form
+      :size="size"
+      :model="params"
+      label-width="0px"
+      label-position="right"
+    >
+      <el-form-item prop="pigeonholeFile" label="">
+        <file-upload v-model="params.pigeonholeFile" :limit="1"></file-upload>
+      </el-form-item>
+    </el-form>
+  </el-dialog>
+</template>

+ 107 - 1
src/views/purchase/contract/see/index.vue

@@ -15,7 +15,23 @@ export default {
       ...useData(Column),
     };
   },
-  computed: {},
+  computed: {
+    hasPowerEdit: function () {
+      return this.$parent.$parent.hasPowerEdit;
+    },
+    hasPowerDelete: function () {
+      return this.$parent.$parent.hasPowerDelete;
+    },
+    hasPowerAlteration: function () {
+      return this.$parent.$parent.hasPowerAlteration;
+    },
+    hasPowerPigeonhole: function () {
+      return this.$parent.$parent.hasPowerPigeonhole;
+    },
+    hasPowerTermination: function () {
+      return this.$parent.$parent.hasPowerTermination;
+    },
+  },
   watch: {},
   methods: {
     //
@@ -29,6 +45,31 @@ export default {
       const { hide } = useMethods();
       await hide({ _this: this });
     },
+    //
+    async useEdit(prop) {
+      const { useEdit } = this.$parent.$parent;
+      await useEdit(prop);
+    },
+    //
+    async useDelete(prop) {
+      const { useDelete } = this.$parent.$parent;
+      await useDelete(prop);
+    },
+    //
+    async useTermination(prop) {
+      const { useTermination } = this.$parent.$parent;
+      await useTermination(prop);
+    },
+    //
+    async usePigeonhole(prop) {
+      const { usePigeonhole } = this.$parent.$parent;
+      await usePigeonhole(prop);
+    },
+    //
+    async useAlteration(prop) {
+      const { useAlteration } = this.$parent.$parent;
+      await useAlteration(prop);
+    },
   },
   created() {},
   mounted() {},
@@ -51,6 +92,71 @@ export default {
           icon="el-icon-close"
           @click="hide"
         ></el-button>
+        <el-tooltip
+          v-if="hasPowerDelete([params])"
+          effect="dark"
+          content="删 除"
+          placement="bottom-end"
+        >
+          <el-button
+            :size="size"
+            circle
+            icon="el-icon-delete"
+            @click="useDelete([params])"
+          ></el-button>
+        </el-tooltip>
+        <el-tooltip
+          v-if="hasPowerEdit([params])"
+          effect="dark"
+          content="编 辑"
+          placement="bottom-end"
+        >
+          <el-button
+            :size="size"
+            circle
+            icon="el-icon-edit"
+            @click="useEdit([params])"
+          ></el-button>
+        </el-tooltip>
+        <el-tooltip
+          v-if="hasPowerTermination([params])"
+          effect="dark"
+          content="终 止"
+          placement="bottom-end"
+        >
+          <el-button
+            :size="size"
+            circle
+            icon="el-icon-light-rain"
+            @click="useTermination([params])"
+          ></el-button>
+        </el-tooltip>
+        <el-tooltip
+          v-if="hasPowerPigeonhole([params])"
+          effect="dark"
+          content="归 档"
+          placement="bottom-end"
+        >
+          <el-button
+            :size="size"
+            circle
+            icon="el-icon-lightning"
+            @click="usePigeonhole([params])"
+          ></el-button>
+        </el-tooltip>
+        <el-tooltip
+          v-if="hasPowerAlteration([params])"
+          effect="dark"
+          content="变 更"
+          placement="bottom-end"
+        >
+          <el-button
+            :size="size"
+            circle
+            icon="el-icon-heavy-rain"
+            @click="useAlteration([params])"
+          ></el-button>
+        </el-tooltip>
       </span>
     </template>
     <el-descriptions :size="size" :column="column" border style="margin: 10px">

+ 14 - 3
src/views/purchase/contract/termination/index.vue

@@ -1,5 +1,5 @@
 <script>
-import useMethods from "../hooks/function";
+import { TERMINATION } from "@/api/business/purchase/contract";
 
 export default {
   name: "TerminationDialog",
@@ -17,8 +17,19 @@ export default {
         type: "info",
       })
         .then(async () => {
-          const { termination } = useMethods();
-          await termination({ _this: this, prop });
+          try {
+            // try
+            const { code } = await TERMINATION({ id: prop });
+            if (code === 200) {
+              this.$emit("success");
+              this.$notify.success(msg);
+            }
+          } catch (err) {
+            // catch
+            console.error(err);
+          } finally {
+            // finally
+          }
         })
         .catch((err) => {
           console.error(err);

+ 1 - 1
src/views/purchase/task/column.js

@@ -36,7 +36,7 @@ export const TableColumns = [
   },
   // { key: "currency", title: "币种" },
   { key: "currencyName", title: "币种" },
-  { key: "billYpe", title: "交易类型" },
+  // { key: "billYpe", title: "交易类型" },
   { key: "source", title: "需求来源" },
   // { key: "customer", title: "收货客户" },
   { key: "customerName", title: "收货客户" },

+ 1 - 1
src/views/purchase/task/first-direct/index.vue

@@ -65,7 +65,7 @@ export default {
         if (code === 200) {
           this.hide();
           this.$emit("success");
-          this.$notify.success({ title: msg, duration: 0 });
+          this.$notify.success({ title: msg, duration: 3000 });
         }
       } catch (err) {
         // catch