Ver Fonte

调整采购员

002390 há 2 anos atrás
pai
commit
004dbfc12f

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

@@ -71,6 +71,15 @@ const getPrice = (data) => {
   });
 }
 
+// 采购订单退回
+const documentsReturn = (data) => {
+  return request({
+    url: `/pu/order/documentsReturn`,
+    method: "put",
+    data,
+  });
+}
+
 export default {
   list,
   details,
@@ -80,5 +89,6 @@ export default {
   revision,
   remove,
   getPrice,
+  documentsReturn,
 
 }

+ 1 - 1
src/components/input-dialog/components/CONTACTS_PARAM.js

@@ -1,4 +1,4 @@
-// 客户部门
+// 联系人部门
 export default [
   {
     key: "code",

+ 16 - 19
src/views/purchase/purchase-order/add/column.js

@@ -19,6 +19,10 @@ export const Columns = [
     require: true,
     config: {
       optionsName: "sys_order_type", // 字典名
+      dataMapping: {
+        billType: "code",
+        billTypeName: "name",
+      },
     },
   },
   // { key: "billTypeName", title: "订单类型名称", },
@@ -84,12 +88,12 @@ export const Columns = [
     title: "采购员",
     type: "InputDialog",
     config: {
-      componentName: "ORG_PARAM",
+      componentName: "CONTACTS_PARAM",
       dataMapping: {
-        buyer: "userId",
-        buyerName: "userName",
-        puDept: "deptId",
-        puDeptName: "deptName",
+        buyer: "code",
+        buyerName: "name",
+        // puDept: "deptId",
+        // puDeptName: "deptName",
       },
     },
     require: true,
@@ -228,14 +232,14 @@ export const Columns = [
   { key: "supplierPersonalName", title: "供应商业务员名称", type: "Input", },
   { key: "isDeliver", title: "是否发货", type: "Checkbox", },
   {
-    key: "retReason",
+    key: "retReasonName",
     title: "退换原因",
     type: "InputDialog",
     config: {
       componentName: "RETREASON_PARAM",
       dataMapping: {
         retReason: "code",
-        // retReasonName: "name",
+        retReasonName: "name",
       },
     },
   },
@@ -253,26 +257,26 @@ export const Columns = [
   },
   { key: "isEnd", title: "整单关闭标识", type: "Input", },
   {
-    key: "projectNow",
+    key: "projectNowName",
     title: "在建工程项目",
     type: "InputDialog",
     config: {
       componentName: "PROJECT_PARAM",
       dataMapping: {
         projectNow: "code",
-        // processTypeName: "name",
+        projectNowName: "name",
       },
     },
   },
   {
-    key: "operatingItems",
+    key: "operatingItemsName",
     title: "经营性项目",
     type: "InputDialog",
     config: {
       componentName: "OPERATING_PARAM",
       dataMapping: {
         operatingItems: "code",
-        // processTypeName: "name",
+        operatingItemsName: "name",
       },
     },
   },
@@ -306,11 +310,10 @@ export const TabColumns = [
     title: '物料信息',
     key: 'puOrderItemList',
     tableColumns: [
-      // { key: "id", title: "主键" },
       { key: "rowNo", title: "行号", type: "Input", },
       { key: "orderId", title: "采购订单ID", type: "Input", },
       // {key: "material",title: "物料",type: "Input",   },
-      { key: "materialName", title: "物料名称", type: "Input", },
+      { key: "materialName", title: "物料", type: "Input", },
       {
         key: "materialCode",
         title: "物料编码",
@@ -410,13 +413,9 @@ export const TabColumns = [
       { key: "isDistributionPrice", title: "配送价", type: "Input", },
       { key: "createByName", title: "创建人名称", type: "Input", },
       { key: "updateByName", title: "更新人名称", type: "Input", },
-      // { key: "materialClassifyOne", title: "物料一级分类",type: "Input", },
       { key: "materialClassifyOneName", title: "物料一级分类名称", type: "Input", },
-      // { key: "materialClassifyTwo", title: "物料二级分类",type: "Input", },
       { key: "materialClassifyTwoName", title: "物料二级分类名称", type: "Input", },
-      // { key: "materialClassifyThree", title: "物料三级分类",type: "Input", },
       { key: "materialClassifyThreeName", title: "物料三级分类名称", type: "Input", },
-      // { key: "materialClassifyFour", title: "物料四级分类",type: "Input", },
       { key: "materialClassifyFourName", title: "物料四级分类名称", type: "Input", },
       { key: "price", title: "无税单价", type: "Input", }
     ]
@@ -425,7 +424,6 @@ export const TabColumns = [
     title: '执行结果',
     key: 'puOrderExecuteList',
     tableColumns: [
-      // { key: "id", title: "主键",type: "Input", },
       { key: "orderId", title: "采购订单ID", type: "Input", },
       { key: "rowno", title: "行号", type: "Input", },
       {
@@ -441,7 +439,6 @@ export const TabColumns = [
           },
         },
       },
-      // { key: "materialName", title: "物料名称", type: "Input", },
       { key: "specification", title: "规格", type: "Input", },
       { key: "qty", title: "数量", type: "Input", },
       { key: "stroageQty", title: "累计到货主数量", type: "Input", },

+ 24 - 10
src/views/purchase/purchase-order/add/index.vue

@@ -40,15 +40,16 @@ export default {
     };
   },
   computed: {},
-  watch: {},
+  watch: {
+
+  },
   methods: {
     beforeOpen() {
-      const { deptName, deptId, name, id, orgName, orgId } =
-        this.$store.state.user;
+      const { deptName, deptId, name, nickName, orgName, orgId } = this.$store.state.user;
       this.params.puOrg = orgId;
       this.params.puOrgName = orgName;
-      this.params.buyer = id;
-      this.params.buyerName = name;
+      this.params.buyer = name;
+      this.params.buyerName = nickName;
       this.params.puDept = deptId;
       this.params.puDeptName = deptName;
     },
@@ -57,10 +58,22 @@ export default {
     },
     // 增行
     addTableRow(prop) {
-      const arr = this.tabColumns.find(
-        (element) => element.key === this.tabName
-      ).tableColumns;
-      prop.push(initParams(arr, "key", "value"));
+
+      for (const key in this.params) {
+
+        if (Array.isArray(this.params[key])) {
+
+          const arr = this.tabColumns.find(
+            (element) => element.key === key
+          ).tableColumns;
+          this.params[key].push(initParams(arr, "key", "value"));
+        }
+      }
+
+      // const arr = this.tabColumns.find(
+      //   (element) => element.key === this.tabName
+      // ).tableColumns;
+      // prop.push(initParams(arr, "key", "value"));
     },
     // 删行
     delTableRow(prop, index) {
@@ -120,7 +133,7 @@ export default {
     },
   },
   created() {
-    console.log("ADD CREATED");
+    console.log("ADD CREATED", this.params);
   },
   mounted() { },
   destroyed() { },
@@ -200,6 +213,7 @@ export default {
           </el-col>
         </el-row>
       </el-card>
+
       <el-card :body-style="{
         padding: '20px',
         display: 'flex',

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

@@ -135,7 +135,7 @@ export default {
     },
   },
   created() {
-    console.log("ADD CREATED");
+    console.log("EDIT CREATED");
     console.log(this.params, 'this.params');
   },
   mounted() { },

+ 34 - 7
src/views/purchase/purchase-order/index.vue

@@ -130,6 +130,7 @@ export default {
         puOrderItemList: [],
         puOrderExecuteList: [],
       },
+      checkedList: [],
     };
   },
   computed: {
@@ -268,7 +269,27 @@ export default {
     // 提交
     async handleSubmit(row) {
 
-    }
+    },
+    judgeIsSendBack() {
+      console.log(this.checkedList, 'this.checkedList');
+
+      if (this.checkedList.length == 1) {
+
+        if(this.checkedList[0].source != 3){
+
+          return false
+        }
+      }
+      return true;
+    },
+    //  退回
+    handleSendBack() {
+
+    },
+    handleSelect(selection, row) {
+      this.checkedList = selection;
+      console.log(this.checkedList, 'this.checkedList');
+    },
 
   },
 };
@@ -292,7 +313,8 @@ export default {
           </el-row>
         </el-col>
         <el-col :span="4" style="text-align: right; padding-right: 40px">
-          <el-button type="primary" size="mini" @click="handleQueryList">搜索</el-button>
+          <el-button type="primary" size="mini" @click="handleQueryList"
+            v-hasPermi="['material:order:query']">搜索</el-button>
           <el-button size="mini" @click="handleResetList">重置</el-button>
         </el-col>
       </el-row>
@@ -308,13 +330,15 @@ export default {
       <!-- <el-col :span="6">123</el-col> -->
       <el-col :span="24" style="text-align: right;margin: 0 10px 0 0">
         <el-button-group style="margin-left: 10px">
-          <el-button size="mini" type="danger" @click="handleOpenAddDrawer">新增</el-button>
+          <el-button size="mini" type="danger" @click="handleOpenAddDrawer"
+            v-hasPermi="['material:order:add']">新增</el-button>
           <el-button size="mini">复制</el-button>
 
         </el-button-group>
 
         <el-button-group style="margin-left: 10px">
-          <el-button size="mini">退回</el-button>
+          <el-button size="mini" @click="handleSendBack" :key="checkedList.length"
+            :disabled="judgeIsSendBack">退回</el-button>
         </el-button-group>
 
         <el-button-group style="margin-left: 10px">
@@ -327,7 +351,8 @@ export default {
     </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">
+      highlight-current-row style="width: 100%; margin: 20px 0 0 0" @select="handleSelect">
+      <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">
@@ -335,10 +360,12 @@ export default {
       <el-table-column fixed="right" label="操作" width="120">
         <template slot-scope="scope">
           <!-- <el-button @click.stop="handleOpenSeeDrawer(scope.row)" type="text" size="small">查看</el-button> -->
-          <el-button type="text" size="small" @click.stop="handleOpenEditDrawer(scope.row)">
+          <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)">删除</el-button>
+          <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"
             @click.stop="handleSubmit(scope.row)">提交</el-button>
         </template>