Browse Source

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

002201 2 years ago
parent
commit
2b43042c0c

+ 10 - 0
src/api/business/purchase/purchase-order.js

@@ -89,6 +89,15 @@ const close = (data) => {
   });
 }
 
+// 采购订单发送NC
+const toNc = (data) => {
+  return request({
+    url: `/pu/order/toNc`,
+    method: "post",
+    data,
+  });
+}
+
 export default {
   list,
   details,
@@ -100,5 +109,6 @@ export default {
   getPrice,
   documentsReturn,
   close,
+  toNc,
 
 }

+ 11 - 10
src/views/material/requisition/add.vue

@@ -158,8 +158,11 @@
                 </el-form-item>
               </el-col>
               <el-col :span="8">
-                <el-form-item label="税类编码" prop="rateCode">
-                  <el-input :disabled="disable" v-model="basicForm.rateCode"></el-input>
+                <el-form-item label="运输条件" prop="transportationCondition">
+                  <el-select v-model="basicForm.transportationCondition" placeholder="请选择" clearable :disabled="disable">
+                    <el-option v-for="item in dict.type.sys_conditions_carriage" :key="item.value" :label="item.label"
+                      :value="item.value" />
+                  </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="8">
@@ -233,14 +236,6 @@
                 </el-form-item>
               </el-col>
               <el-col :span="8">
-                <el-form-item label="运输条件" prop="transportationCondition">
-                  <el-select v-model="basicForm.transportationCondition" placeholder="请选择" clearable :disabled="disable">
-                    <el-option v-for="item in dict.type.sys_conditions_carriage" :key="item.value" :label="item.label"
-                      :value="item.value" />
-                  </el-select>
-                </el-form-item>
-              </el-col>
-              <el-col :span="8">
                 <el-form-item label="物料税类" prop="materialRate">
                   <el-select ref="taxs" v-model="basicForm.materialRate" placeholder="请选择" clearable :disabled="disable"
                     @focus="chooseTax">
@@ -248,6 +243,11 @@
                   </el-select>
                 </el-form-item>
               </el-col>
+              <el-col :span="8">
+                <el-form-item label="税类编码" prop="rateCode">
+                  <el-input disabled v-model="basicForm.rateCode"></el-input>
+                </el-form-item>
+              </el-col>
             </el-row>
             <el-row :gutter="20">
               <el-col :span="8">
@@ -1396,6 +1396,7 @@ export default {
     acceptTax(selections) {
       this.taxOptions = selections
       this.basicForm.materialRate = selections[0].id
+      this.basicForm.rateCode = selections[0].code
       this.getTaxDetails(selections[0].id)
     },
     // 物料税类显示列表

+ 7 - 1
src/views/purchase/PurchaseDemandList/add.vue

@@ -387,7 +387,7 @@
           <el-table-column label="补单供应商编码" align="center"  prop="additionalSupplier" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable :disabled="sonDisable || BDZT" size="small" v-model="scope.row.additionalSupplier" @focus="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')">
+                <el-input clearable :disabled="sonDisable || BDZT" size="small" v-model="scope.row.additionalSupplier" @clear="clearHang(scope.$index, '选择补单供应商')" @focus="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')">
                   <el-button size="small" :disabled="sonDisable || BDZT" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')"></el-button>
                 </el-input>
               </el-form-item>
@@ -789,6 +789,8 @@ export default {
               if(this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal) }
               if(this.basicForm.demandDept) { this.reBackRefer('DEPT_PARAM', this.basicForm.demandDept) }
               // 详情时将收货仓库id赋值给stordocId
+              // 如果业务类型为补单需求,则明细内补单供应商编码可以编辑
+              if(this.basicForm.billType == 'BDXQ') { this.BDZT = false } else { this.BDZT = true }
             }
           })
         }
@@ -984,6 +986,10 @@ export default {
         this.basicForm.puDemandItemList[index].contactsPhone = null
         this.basicForm.puDemandItemList[index].address = null
       }
+      if (title == '选择补单供应商') {
+        this.basicForm.puDemandItemList[index].additionalSupplierName = null
+        this.basicForm.puDemandItemList[index].additionalSupplier = null
+      }
     },
   }
 }

+ 1 - 1
src/views/purchase/purchase-order/add/column.js

@@ -153,7 +153,7 @@ export const Columns = [
     key: "status",
     title: "单据状态",
     inputType: "Select",
-    referName: "sys_status", // 字典名
+    referName: "documents_status", // 字典名
     disabled: true,
     isShow:true,
   },

+ 1 - 1
src/views/purchase/purchase-order/add/index.vue

@@ -250,7 +250,7 @@ export default {
       });
     },
     // 子表参照改变之后
-    handleReferChange(val, source, type) {
+    handleReferChange(val,type, source) {
       console.log(val, 'val');
       console.log(source, 'source');
       console.log(type, 'type');

+ 26 - 12
src/views/purchase/purchase-order/column.js

@@ -1,7 +1,5 @@
 import {
   initPage,
-  initLayout,
-  initPageSizes,
   initParams,
   initColumns,
   initDicts,
@@ -18,6 +16,13 @@ export const TableColumns = [
     referName: "sys_order_type",
   },
   { key: "code", title: "订单编号", search: true, inputType: "Input" },
+  {
+    key: "status",
+    title: "单据状态",
+    inputType: "Select",
+    width:80,
+    referName: "sys_status", // 字典名
+  },
   { key: "billDate", title: "订单日期" },
   // { key: "supplier", title: "供应商" },
   { key: "supplierName", title: "供应商", search: true, inputType: "Input" },
@@ -36,11 +41,13 @@ export const TableColumns = [
     key: "isArrival",
     title: "到货超期",
     inputType: 'Checkbox',
+    width:80,
   },
   {
     key: "isBack",
     title: "退货",
     inputType: 'Checkbox',
+    width:80,
   },
   // { key: "freezeCause", title: "冻结原因" },
   { key: "qty", title: "总数量" },
@@ -62,6 +69,7 @@ export const TableColumns = [
     key: "isInvoice",
     title: "发票标识",
     inputType: 'Checkbox',
+    width:80,
   },
   { key: "rebateMoney", title: "订单使用返利金额" },
   { key: "deductionMoney", title: "订单抵扣余款金额" },
@@ -77,6 +85,7 @@ export const TableColumns = [
     key: "isUrgency",
     title: "紧急程度",
     inputType: 'Checkbox',
+    width:80,
   },
   // { key: "agent", title: "代理人" }, // 建议删除
   { key: "agentName", title: "代理人" },
@@ -84,6 +93,7 @@ export const TableColumns = [
     key: "isClose",
     title: "最终关闭",
     inputType: 'Checkbox',
+    width:80,
   },
   { key: "applyPaymentMoney", title: "累计付款申请金额" },
   { key: "paymentMoney", title: "累计付款金额" },
@@ -103,12 +113,7 @@ export const TableColumns = [
   { key: "createTime", title: "制单日期/创建时间" },
   { key: "remark", title: "备注" },
   { key: "updateTime", title: "最后修改时间" },
-  {
-    key: "status",
-    title: "单据状态",
-    inputType: "Select",
-    referName: "sys_status", // 字典名
-  },
+
   { key: "oaDemandNo", title: "OA需求单号" },
   { key: "address", title: "收货地址" },
   { key: "contacts", title: "收获联系人" },
@@ -116,13 +121,14 @@ export const TableColumns = [
     key: "isSendWms",
     title: "已同步WMS",
     inputType: 'Checkbox',
+    width:120,
   },
-  { key: "retReason", title: "退换原因" },
+  { key: "retReasonName", title: "退换原因" },
   { key: "closeTime", title: "最终关闭日期" },
-  { key: "processType", title: "处理方式" },
+  { key: "processTypeName", title: "处理方式" },
   { key: "isEnd", title: "整单关闭标识" },
-  { key: "projectNow", title: "在建工程项目" },
-  { key: "operatingItems", title: "经营性项目" },
+  { key: "projectNowName", title: "在建工程项目" },
+  { key: "operatingItemsName", title: "经营性项目" },
   { key: "isArrivalReson", title: "到货超期原因" },
   { key: "midOrderNo", title: "中台采购订单号" }
 ];
@@ -146,6 +152,7 @@ export const TabColumns = [
         title: "医药物料",
         width: 180,
         inputType: 'Checkbox',
+        width:80,
       },
       { key: "manufacturer", title: "生产厂家代理人", width: 180 },
       { key: "isDrug", title: "物料药品属性", width: 180 },
@@ -163,26 +170,31 @@ export const TabColumns = [
         key: "isStorage",
         title: "入库关闭",
         inputType: 'Checkbox',
+        width:80,
       },
       {
         key: "isInvoice",
         title: "开票关闭",
         inputType: 'Checkbox',
+        width:80,
       },
       {
         key: "isArrival",
         title: "到货关闭",
         inputType: 'Checkbox',
+        width:80,
       },
       {
         key: "isPayment",
         title: "付款关闭",
         inputType: 'Checkbox',
+        width:80,
       },
       {
         key: "isGift",
         title: "赠品",
         inputType: 'Checkbox',
+        width:80,
       },
       { key: "warehouse", title: "收货仓库", width: 180 },
       { key: "place", title: "收货地点", width: 180 },
@@ -208,11 +220,13 @@ export const TabColumns = [
         key: "isBatchLock",
         title: "批号锁定标识",
         inputType: 'Checkbox',
+        width:80,
       },
       {
         key: "isReplenishment",
         title: "补单标识",
         inputType: 'Checkbox',
+        width:80,
       },
       { key: "isUrgency", title: "紧急标识" },
       { key: "originalQty", title: "原始数量" },

+ 1 - 1
src/views/purchase/purchase-order/components/FileUploadCenter/index.vue

@@ -57,7 +57,7 @@ export default {
     // 文件类型, 例如['png', 'jpg', 'jpeg']
     fileType: {
       type: Array,
-      default: () => ["doc", "xls", "ppt", "txt", "pdf", "jpg"],
+      default: () => ["doc", "xls", "ppt", "txt", "pdf", "jpg", "png"],
     },
     // 是否显示提示
     isShowTip: {

+ 1 - 1
src/views/purchase/purchase-order/edit/index.vue

@@ -183,7 +183,7 @@ export default {
     beforeOpen() {
     },
     // 子表参照改变之后
-    handleReferChange(val, source, type) {
+    handleReferChange(val,  type,source) {
       console.log(val, 'val');
       console.log(source, 'source');
       console.log(type, 'type');

+ 92 - 51
src/views/purchase/purchase-order/index.vue

@@ -4,8 +4,6 @@ import { TableColumns, SearchColumns, TabColumns, SelectColumns } from "./column
 import orderApi from "@/api/business/purchase/purchase-order";
 import {
   initPage,
-  initLayout,
-  initPageSizes,
   initParams,
   initColumns,
   initDicts,
@@ -25,8 +23,7 @@ export default {
     return {
       loading: false,
       isSimpleSearch: true,
-      pageSizes: initPageSizes(),
-      layout: initLayout(),
+      pageSizes: [10, 20, 50, 100],
       page: initPage(),
       searchColumns: SearchColumns,
       params: initParams(SearchColumns),
@@ -75,16 +72,7 @@ export default {
       //   title: this.isSimpleSearch ? "Simple Search" : "All Search",
       // });
     },
-    // 页大小变
-    handleSizeChange(prop) {
-      this.page.pageSize = prop;
-      this.fetchList(this.params, this.page);
-    },
-    // 当前页变
-    handleCurrentChange(prop) {
-      this.page.pageNum = prop;
-      this.fetchList(this.params, this.page);
-    },
+
     // 刷新操作
     handleRefreshList() {
       this.fetchList(this.params, this.page);
@@ -136,7 +124,6 @@ export default {
     },
     // 获取子表信息
     async handleDetailsData(row) {
-      console.log(row, '获取详情信息');
       try {
         const { code, msg, data } = await orderApi.details(row.id);
         if (code === 200) {
@@ -262,15 +249,16 @@ export default {
       console.log(this.checkedList, 'this.checkedList');
 
     },
-
-
-
   },
 };
 </script>
 
 <template>
-  <el-card v-loading="loading" style="width: calc(100% - 24px); height: 100%; margin: 10px" :body-style="{ padding: 0 }">
+  <el-card 
+    v-loading="loading" 
+    style="width: calc(100% - 24px); height: 100%; margin: 10px" 
+    :body-style="{ padding: 0 }"
+  >
     <SeeDrawer ref="seeDrawerFef"></SeeDrawer>
     <AddDrawer ref="addDrawerFef" @close="handleRefreshList"></AddDrawer>
     <EditDrawer ref="editDrawerFef" @close="handleRefreshList"></EditDrawer>
@@ -285,7 +273,11 @@ export default {
       <el-row :gutter="24" style="display:flex; flex-wrap: wrap;">
         <el-col :span="20">
           <el-row :gutter="20">
-            <el-col v-for="column in showSearchColumns" :key="column.title" :xl="6" :lg="6" :md="8" :sm="12" :xs="24">
+            <el-col 
+              v-for="column in showSearchColumns" 
+              :key="column.title" 
+              :xl="6" :lg="6" :md="8" :sm="12" :xs="24"
+            >
               <el-form-item :prop="column.key" :label="column.title">
                 <el-input v-model="params[column.key]" :placeholder="column.placeholder"></el-input>
               </el-form-item>
@@ -300,10 +292,10 @@ export default {
       </el-row>
     </el-form>
 
-    <el-divider>
+    <!-- <el-divider>
       <i :class="isSimpleSearch ? 'el-icon-arrow-down' : 'el-icon-arrow-up'" style="cursor: pointer"
         @click="handleSearchChange"></i>
-    </el-divider>
+    </el-divider> -->
 
     <!-- 操作 -->
     <el-row :gutter="24" style="padding: 0 20px">
@@ -333,20 +325,40 @@ export default {
       </el-col>
     </el-row>
 
-    <el-table @row-dblclick="handleOpenSeeDrawer" @row-click="handleDetailsData" :data="tableData" size="mini"
-      highlight-current-row style="width: 100%; margin: 20px 0 0 0" @select="handleSelect" height="450">
+    <el-table 
+      @row-dblclick="handleOpenSeeDrawer" 
+      @row-click="handleDetailsData" 
+      :data="tableData" 
+      size="mini"
+      highlight-current-row
+      @select="handleSelect"
+      height="450"
+      style="width: 100%; margin: 20px 0 0 0"
+    >
       <el-table-column type="selection" width="45"></el-table-column>
       <el-table-column type="index" width="50" label="序号"></el-table-column>
-      <el-table-column v-for="(column, index) in tableColumns" :key="index" :prop="column.key" :label="column.title"
-        :width="column.width || 180" :show-overflow-tooltip="column.showOverflowTooltip || true">
+      <el-table-column 
+        v-for="(column, index) in tableColumns" 
+        :key="index" 
+        :prop="column.key" 
+        :label="column.title"
+        :width="column.width || 180" 
+        :show-overflow-tooltip="column.showOverflowTooltip || true"
+      >
 
         <template slot-scope="scope">
-          <dict-tag v-if="column.referName" size="small" :value="scope.row[column.key]"
-            :options="dict.type[column.referName]" />
-
-          <el-checkbox v-else-if="column.inputType === 'Checkbox'" v-model="scope.row[column.key]" disabled true-label="Y"
-            false-label="N">
-          </el-checkbox>
+          <dict-tag v-if="column.referName" 
+            size="small" 
+            :value="scope.row[column.key]"
+            :options="dict.type[column.referName]"
+           />
+
+          <el-checkbox v-else-if="column.inputType === 'Checkbox'"
+            v-model="scope.row[column.key]" 
+            disabled 
+            true-label="Y"
+            false-label="N"
+          > </el-checkbox>
           <span v-else>{{ scope.row[column.key] }}</span>
         </template>
       </el-table-column>
@@ -356,35 +368,64 @@ export default {
           <el-button type="text" size="small" @click.stop="handleOpenEditDrawer(scope.row)"
             v-hasPermi="['material:order:edit']">
             {{ scope.row.status == '2' ? '修订' : '编辑' }}</el-button>
-          <!-- 0=自由态,1=审批中,2=已审核,3=已驳回 -->
-          <el-button type="text" size="small" @click.stop="handleDeleteList(scope.row)"
-            v-hasPermi="['material:order:remove']">删除</el-button>
-          <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" type="text" size="mini"
-            v-hasPermi="['material:order:toOa']" @click.stop="handleSubmit(scope.row)">提交</el-button>
+          <!-- 0=自由态,1=审批中,2=已审核,3=已驳回 4=提交中-->
+          <el-button 
+            v-if="(scope.row.status == '0' || scope.row.status == '3') && scope.row.source == '3'" 
+            type="text" 
+            size="small" 
+            @click.stop="handleDeleteList(scope.row)"
+            v-hasPermi="['material:order:remove']"
+          >删除</el-button>
+          <el-button 
+            v-if="scope.row.status == '0' || scope.row.status == '3'" 
+            type="text" 
+            size="mini"
+            v-hasPermi="['material:order:toOa']" 
+            @click.stop="handleSubmit(scope.row)"
+          >提交</el-button>
         </template>
       </el-table-column>
 
     </el-table>
-    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :total="page.total"
-      :page-sizes="pageSizes" :page-size="page.pageSize" :current-page="page.pageNum" hide-on-single-page :layout="layout"
-      style="text-align: right;margin-top: 10px;">
-    </el-pagination>
 
-    <el-tabs v-model="tabName" @tab-click="handleTabClick" style="width: 100%;padding: 20px 10px">
-      <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
+    <pagination
+      v-show="page.total>0"
+      :total="page.total"
+      :page.sync="page.pageNum"
+      :limit.sync="page.pageSize"
+      @pagination="fetchList(params, page)"
+    />
 
+    <el-tabs v-model="tabName" @tab-click="handleTabClick" style="width: 100%;padding: 20px 10px">
+      <el-tab-pane 
+        v-for="(column, index) in tabColumns" 
+        :key="index" 
+        :label="column.title" 
+        :name="column.key"
+      >
         <el-table :data="tabTableDatas[column.key]" style="width: 100%" highlight-current-row
           :height="tabTableDatas[column.key].length ? 300 : 100">
           <el-table-column type="index" width="50" label="序号"></el-table-column>
-          <el-table-column v-for="(cColumn, cIndex)  in column.tableColumns" :key="cIndex" :prop="cColumn.key"
-            :label="cColumn.title" :width="cColumn.width || 180"
-            :show-overflow-tooltip="cColumn.showOverflowTooltip || true">
+          <el-table-column 
+            v-for="(cColumn, cIndex)  in column.tableColumns" 
+            :key="cIndex" 
+            :prop="cColumn.key"
+            :label="cColumn.title" 
+            :width="cColumn.width || 180"
+            :show-overflow-tooltip="cColumn.showOverflowTooltip || true"
+          >
             <template slot-scope="scope">
-              <dict-tag v-if="cColumn.referName" size="small" :value="scope.row[cColumn.key]"
-                :options="dict.type[cColumn.referName]" />
-              <el-checkbox v-else-if="cColumn.inputType === 'Checkbox'" v-model="scope.row[cColumn.key]" disabled
-                true-label="Y" false-label="N">
-              </el-checkbox>
+              <dict-tag v-if="cColumn.referName" 
+                size="small" 
+                :value="scope.row[cColumn.key]"
+                :options="dict.type[cColumn.referName]"
+               />
+              <el-checkbox v-else-if="cColumn.inputType === 'Checkbox'" 
+                v-model="scope.row[cColumn.key]"
+                disabled
+                true-label="Y" 
+                false-label="N"
+              ></el-checkbox>
               <span v-else>{{ scope.row[cColumn.key] }}</span>
             </template>
           </el-table-column>

+ 60 - 0
src/views/purchase/purchase-order/see/index.vue

@@ -68,6 +68,46 @@ export default {
       this.setVisible(false);
       this.params = initParams(Columns);
     },
+    handleRefresh(){
+      let {id} = this.params;
+      this.fetchItem(id);
+    },
+    // 发送NC
+    async handleSendNC(){
+      console.log('发送NC');
+
+      try {
+        let {code} = await orderApi.toNc({ puOrderId:this.params.id});
+
+        if(code == 200){
+          this.handleRefresh();
+        }
+      } catch (error) {
+        
+      }finally{
+
+      }
+    },
+    // 判断是否能发送NC
+    judgeIsToNC(){
+
+      let {source,status,deliveryStatus} = this.params;
+
+      // 自制 & 状态为:自由态、驳回
+      if(source === '3' &&(status === '0' || status === '3')){
+
+        // 发送NC之后展示 SUCCESS("0","成功"),SEND_IN("1","发送中"),FAILURE("2","失败");
+        //    未发送                发送过但未成功
+        if(!deliveryStatus || (deliveryStatus && deliveryStatus !== '0')){
+
+          return true;
+        }
+
+        return false;
+      }
+
+      return false;
+    },
     beforeOpen() { },
   },
   created() { },
@@ -94,6 +134,26 @@ export default {
           ">
           <h3>查看</h3>
           <div style="text-align: right">
+            <el-button size="mini" @click="handleRefresh">刷新</el-button>
+            <template v-if="judgeIsToNC()">
+              <el-tooltip
+                class="box-item"
+                effect="dark"
+                :key="params.deliveryStatus"
+                :content="params.deliveryMsg"
+                placement="bottom-end"
+              >
+                <el-button 
+                  :key="params.deliveryStatus"
+                  :disabled="params.deliveryStatus === '1' "
+                  size="mini" 
+                  type="primary"
+                  @click="handleSendNC"
+                >{{  params.deliveryStatus === '1' ? '发送中' :
+                    (params.deliveryStatus === '2'? '重新发送NC' : '发送NC')
+                }}</el-button>
+              </el-tooltip>
+            </template>
             <el-button size="mini" @click="handleCancel">取 消</el-button>
           </div>
         </div>