simple hace 4 años
padre
commit
9c3b1e37f5

+ 1 - 1
config/index.js

@@ -12,7 +12,7 @@ module.exports = {
     assetsRoot: path.resolve(__dirname, '../dist'),
     assetsSubDirectory: 'static',
     assetsPublicPath: './',
-    productionSourceMap: true,
+    productionSourceMap: false,
     // Gzip off by default as many popular static hosts such as
     // Surge or Netlify already gzip all static assets for you.
     // Before setting to `true`, make sure to:

+ 14 - 2
config/util.js

@@ -19,11 +19,14 @@ export const filter_param = (o) => {
 export const toChinesNum = (num) => {
   let changeNum = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
   let unit = ["", "拾", "佰", "仟", "万"];
+  let sUnit = ["分", "角"];
+  let newSNum = "";
+  let otNum = num;
   num = parseInt(num);
   let getWan = (temp) => {
     let strArr = temp.toString().split("").reverse();
     let newNum = "";
-    for (var i = 0; i < strArr.length; i++) {
+    for (let i = 0; i < strArr.length; i++) {
       newNum = (i == 0 && strArr[i] == 0 ? "" : (i > 0 && strArr[i] == 0 && strArr[i - 1] == 0 ? "" : changeNum[strArr[i]] + (strArr[i] == 0 ? unit[0] : unit[i]))) + newNum;
     }
     return newNum;
@@ -33,7 +36,16 @@ export const toChinesNum = (num) => {
   if (noWan.toString().length < 4) {
     noWan = "0" + noWan;
   }
-  return overWan ? getWan(overWan) + "万" + getWan(noWan) : getWan(num);
+  if (otNum.toString().split('.').length > 1) {
+    let sNum = otNum.toString().split('.')[1].split("").reverse();
+    for (let i = 0; i < sNum.length; i++) {
+      newSNum = (i == 0 && sNum[i] == 0 ? "" : (i > 0 && sNum[i] == 0 && sNum[i - 1] == 0 ? "" : changeNum[sNum[i]] + (sNum[i] == 0 ? sUnit[0] : sUnit[i]))) + newSNum;
+    }
+    return overWan ? getWan(overWan) + "万" + getWan(noWan) + '元' + newSNum : getWan(num) + '元' + newSNum;
+  } else {
+    console.log(2222222222222222222)
+    return overWan ? getWan(overWan) + "万" + getWan(noWan) + '元整' : getWan(num) + "元整";
+  }
 }
 
 export const phoneFun = function (phones) {

+ 14 - 6
src/page/baseInfo/components/supply/supplyEdit.vue

@@ -248,7 +248,7 @@
           <Col span="4" class-name="upl">附件</Col>
           <Col span="10" class-name="uplf">
             <Upload
-            v-if="canEdit"
+              v-if="canEdit"
               :headers="uploadHeaders"
               style="width: 80%"
               multiple
@@ -572,12 +572,19 @@ import {
   tbiStockGoods //获取物料列表
 } from "@/service/getData";
 export default {
-  props: ["gpId", "gysflList", "gyspjList", "ssqyList", "fgcgyList","canBeEdit"],
+  props: [
+    "gpId",
+    "gysflList",
+    "gyspjList",
+    "ssqyList",
+    "fgcgyList",
+    "canBeEdit"
+  ],
   watch: {
-    canBeEdit(val){
-      console.log('edit'+val)
-      this.canEdit = val?true:false
-      this.editing = val?true:false
+    canBeEdit(val) {
+      console.log("edit" + val);
+      this.canEdit = val ? true : false;
+      this.editing = val ? true : false;
     }
   },
   data() {
@@ -1298,6 +1305,7 @@ export default {
       stockGoodsByGpID(postData).then(res => {
         if (res.status == 200) {
           this.table1Data = res.data;
+          this.page1Total = res.data.total;
         } else {
           this.$message.error(res.message);
         }

+ 4 - 3
src/page/baseInfo/supply.vue

@@ -252,7 +252,8 @@ export default {
   },
   methods: {
     goDetail(row, index) {
-      this.editRow(row.gpId, row.gpInfoType,false)
+      // this.editRow(row.gpId, row.gpInfoType,false)
+      this.editRow(row.gpId, row.gpInfoType);
       //参考跳转
       // window.open(
       //   `https://test.hajwy.com/purchase-web/#/viewPurchaseApply?id=${row.id}`
@@ -292,14 +293,14 @@ export default {
       exportGoodProviderInfo(postData);
     },
     //供应商详情,默认可编辑
-    editRow(id, type,canBeEdit=true) {
+    editRow(id, type, canBeEdit = true) {
       if (type == "2") {
         this.$refs.edit.editing = false;
         this.$refs.edit.canEdit = false;
       }
       this.editId = id;
       this.editShow = true;
-      this.canBeEdit = canBeEdit
+      this.canBeEdit = canBeEdit;
       this.$refs.edit.getGys();
     },
     //删除供应商

+ 7 - 1
src/page/purchase/components/balance/balanceAdd.vue

@@ -217,7 +217,11 @@
           </Col>
           <Col span="10" class="upl" style="padding: 5px">
             <div v-for="(item, index) in form.filesList" :key="index">
-              <a :href="item.filePath" :download="item.fileName" target="_blank">{{ item.fileName }}</a>
+              <a
+                :href="item.docUrl ? item.docUrl : 'javascript:void(0);'"
+                :download="item.fileName"
+                :target="item.docUrl ? '_blank' : '_self'"
+              >{{ item.fileName }}</a>
               <span
                 v-if="form.spzt != '2' && form.spzt != '3' && form.spzt !='5'"
                 style="float: right; cursor:pointer"
@@ -581,6 +585,7 @@ export default {
       editPurchaseSettlement(postData).then(res => {
         if (res.status == 200) {
           this.$Message.success("编辑结算详情成功!");
+          this.getJs(this.settlementId);
         } else {
           this.$Message.error(res.message);
         }
@@ -664,6 +669,7 @@ export default {
           this.form.jssqbh = res.data.settlementCode;
           this.form.xdsj = res.data.orderTime;
           this.settlementId = res.data.settlementId;
+          this.form.filesList = res.data.attachmentList;
           this.balanceType = "edit";
         } else {
           this.$Message.error(res.message);

+ 38 - 10
src/page/purchase/components/order/orderAdd.vue

@@ -10,7 +10,10 @@
             @click="submitCgdd"
             v-if="(orderType == 'edit') && (form.spzt == '1' || form.spzt == '4')"
           >提交</Button>
-          <Button @click="addCgdd" v-if="form.ddzt == '1' || form.ddzt == '2'">保存</Button>
+          <Button
+            @click="addCgdd"
+            v-if="form.spzt != '3' && (form.ddzt == '1' || form.ddzt == '2')"
+          >保存</Button>
           <Button @click="cancel">取消</Button>
         </div>
         <Row class="mainCont">
@@ -105,6 +108,7 @@
               :value="form.xdrq"
               @on-change="form.xdrq=$event"
               type="datetime"
+              :options="xdrqOption"
               placeholder="请选择"
               :disabled="form.spzt == '2' || form.spzt == '3'"
             ></DatePicker>
@@ -230,7 +234,11 @@
           </Col>
           <Col span="10" class="upl" style="padding: 5px">
             <div v-for="(item, index) in form.filesList" :key="index">
-              <a :href="item.filePath" :download="item.fileName" target="_blank">{{ item.fileName }}</a>
+              <a
+                :href="item.docUrl ? item.docUrl : 'javascript:void(0);'"
+                :download="item.fileName"
+                :target="item.docUrl ? '_blank' : '_self'"
+              >{{ item.fileName }}</a>
               <span
                 v-if="form.spzt == '1' || form.spzt == '4'"
                 style="float: right; cursor:pointer"
@@ -273,7 +281,7 @@
             <InputNumber
               :min="1"
               :precision="2"
-              :disabled="form.spzt == '2' || row.isCancel == '1'"
+              :disabled="form.spzt == '2' || form.spzt == '3' || row.isCancel == '1'"
               v-model="tableData[index].purchaseNum"
               placeholder="请输入"
               style="width: 95%"
@@ -301,6 +309,7 @@
               :transfer="true"
               format="yyyy-MM-dd HH:mm:ss"
               type="datetime"
+              :options="xdrqOption"
               :value="tableData[index].plannedArrivalTime"
               @on-change="tableData[index].plannedArrivalTime=$event"
               placeholder="请选择"
@@ -309,20 +318,20 @@
           </template>
           <template slot-scope="{ row, index }" slot="isNumControl">
             <RadioGroup v-model="tableData[index].isNumControl">
-              <Radio :label="1" :disabled="form.spzt == '2' || form.spzt == '3'">
+              <Radio :label="0" :disabled="form.spzt == '2' || form.spzt == '3'">
                 <span>是</span>
               </Radio>
-              <Radio :label="2" :disabled="form.spzt == '2' || form.spzt == '3'">
+              <Radio :label="1" :disabled="form.spzt == '2' || form.spzt == '3'">
                 <span>否</span>
               </Radio>
             </RadioGroup>
           </template>
           <template slot-scope="{ row, index }" slot="isTimeControl">
             <RadioGroup v-model="tableData[index].isTimeControl">
-              <Radio :label="1" :disabled="form.spzt == '2' || form.spzt == '3'">
+              <Radio :label="0" :disabled="form.spzt == '2' || form.spzt == '3'">
                 <span>是</span>
               </Radio>
-              <Radio :label="2" :disabled="form.spzt == '2' || form.spzt == '3'">
+              <Radio :label="1" :disabled="form.spzt == '2' || form.spzt == '3'">
                 <span>否</span>
               </Radio>
             </RadioGroup>
@@ -422,6 +431,15 @@ export default {
           return date && date.valueOf() < new Date(this.form.xdrq);
         }
       },
+      xdrqOption: {
+        disabledDate: date => {
+          let nDate = new Date();
+          let dn = +new Date(
+            `${nDate.getFullYear()}-${nDate.getMonth() + 1}-${nDate.getDate()}`
+          );
+          return date.valueOf() < dn;
+        }
+      },
       // glqyList: [{ label: "test", value: 1 }],
       glxmList: [],
       cgrList: [{ label: "test", value: 1 }],
@@ -457,7 +475,7 @@ export default {
           title: "物料名称",
           key: "materialName",
           tooltip: "true",
-          width: 100
+          width: 200
         },
         {
           title: "规格型号",
@@ -676,7 +694,7 @@ export default {
                 title: "物料名称",
                 key: "materialName",
                 tooltip: "true",
-                width: 100
+                width: 200
               },
               {
                 title: "规格型号",
@@ -781,6 +799,7 @@ export default {
           this.form.gysmc = data.gpName;
           this.form.jhdd = data.deliveryPlace;
           this.requestId = data.requestId;
+          this.form.filesList = data.attachmentList;
           this.orderType = "edit";
           for (let item in data.detailList) {
             tableArr.push({
@@ -987,6 +1006,7 @@ export default {
           this.form.dgbh = res.data.orderCode;
           this.form.bt = res.data.title;
           this.form.jhdd = res.data.deliveryPlace;
+          this.form.filesList = res.data.attachmentList;
           this.orderType = "edit";
         } else {
           this.$Message.error(res.message);
@@ -996,6 +1016,14 @@ export default {
     //新增明细
     mxAddShow() {
       this.contentShow = false;
+      if (this.tableData.length > 0) {
+        this.$refs.mxAdd.searchForm.ck = String(this.tableData[0].storehouseId);
+        this.$refs.mxAdd.ckLock = true;
+      } else {
+        this.$refs.mxAdd.searchForm.ck = "";
+        this.$refs.mxAdd.ckLock = false;
+      }
+      this.$refs.mxAdd.gpId = this.form.gys;
       this.$refs.mxAdd.orderId = this.orderId;
       this.$refs.mxAdd.approvalState = this.form.spzt;
       this.$refs.mxAdd.orderState = this.form.ddzt;
@@ -1100,7 +1128,7 @@ export default {
           title: "物料名称",
           key: "materialName",
           tooltip: "true",
-          width: 100
+          width: 200
         },
         {
           title: "规格型号",

+ 64 - 36
src/page/purchase/components/order/orderMxAdd.vue

@@ -7,7 +7,7 @@
       </div>
       <Row :gutter="10" style="margin-bottom: 10px">
         <Col span="4">
-          <Select clearable v-model="searchForm.ck" placeholder="仓库名">
+          <Select clearable v-model="searchForm.ck" :disabled="ckLock" placeholder="仓库名">
             <Option v-for="item in ckList" :value="item.twId" :key="item.twId">{{ item.twName }}</Option>
           </Select>
         </Col>
@@ -57,7 +57,8 @@
 import {
   queryPurchasePoolList,
   tbiGoodsCategoryList,
-  warehouseList
+  warehouseList,
+  getMaterialPrice
 } from "@/service/getData";
 export default {
   data() {
@@ -67,6 +68,8 @@ export default {
       orderState: "",
       areaId: "",
       projectId: "",
+      ckLock: true,
+      gpId: "",
       type: "",
       //新增物料申请表单
       addForm: {
@@ -82,6 +85,7 @@ export default {
       },
       //表格查询内容
       searchForm: {
+        ck: "",
         yjfl: "", //一级分类
         ejfl: "", // 二级分类
         wlmc: "" //物料编码或名称
@@ -211,10 +215,14 @@ export default {
       this.getTableData();
     },
     tableOnSelect(selection, row) {
-      this.tableSelect = selection;
+      this.tableSelect = selection.sort((a, b) => {
+        a.id - b.id;
+      });
     },
     tableOnCancel(selection, row) {
-      this.tableSelect = selection;
+      this.tableSelect = selection.sort((a, b) => {
+        a.id - b.id;
+      });
     },
     //获取仓库
     getCk() {
@@ -237,47 +245,67 @@ export default {
     //批量添加物料
     plAdd() {
       if (!this.tableSelect.length) {
-        this.$Message.error('请至少选择一个物料。');
+        this.$Message.error("请至少选择一个物料。");
         return false;
       }
       let ck = this.tableSelect[0].storehouseId;
       let arr = [];
+      let postArr = [];
       for (let item in this.tableSelect) {
         if (this.tableSelect[item].storehouseId != ck) {
-          this.$Message.error('请选择同一仓库下的物料。');
+          this.$Message.error("请选择同一仓库下的物料。");
           return false;
+        } else {
+          postArr.push({
+            applyDetailId: this.tableSelect[item].id,
+            code: this.tableSelect[item].materialCode,
+            gpId: this.gpId
+          });
         }
-        let date = new Date();
-        let dateArr = `${date.getFullYear()}-${date.getMonth() +
-          1}-${date.getDate()} 00:00:00`;
-        arr.push({
-          applyDetailId: this.tableSelect[item].id,
-          applyRuleId: this.tableSelect[item].purchaseApplyId,
-          applyRuleCode: this.tableSelect[item].code,
-          code: this.tableSelect[item].materialCode,
-          firstClassName: this.tableSelect[item].firstClassName,
-          materialName: this.tableSelect[item].materialName,
-          brandName: this.tableSelect[item].brandName,
-          specs: this.tableSelect[item].specs,
-          unit: this.tableSelect[item].unit,
-          amount: Number(this.tableSelect[item].amount),
-          billedAmount: this.tableSelect[item].billedAmount,
-          inventory: this.tableSelect[item].inventory,
-          storehouseName: this.tableSelect[item].storehouseName,
-          storehouseId: this.tableSelect[item].storehouseId,
-          price: Number(this.tableSelect[item].referencePrice),
-          purchaseNum: 0,
-          plannedArrivalTime: dateArr,
-          isNumControl: 2,
-          isTimeControl: 2,
-          checkNum: null,
-          applySurplusNum: this.tableSelect[item].noBilledAmount,
-          warehousedNum: 0,
-          remark: ""
-        });
       }
-      this.$emit("plAdd", arr);
-      this.$emit("return");
+      getMaterialPrice(postArr).then(res => {
+        if (res.status == 200) {
+          let resArr = res.data.sort((a, b) => {
+            a.applyDetailId - b.applyDetailId;
+          });
+          for (let item in resArr) {
+            let date = new Date();
+            let dateArr = `${date.getFullYear()}-${date.getMonth() +
+              1}-${date.getDate()} 00:00:00`;
+            arr.push({
+              applyDetailId: this.tableSelect[item].id,
+              applyRuleId: this.tableSelect[item].purchaseApplyId,
+              applyRuleCode: this.tableSelect[item].code,
+              code: this.tableSelect[item].materialCode,
+              firstClassName: this.tableSelect[item].firstClassName,
+              materialName: this.tableSelect[item].materialName,
+              brandName: this.tableSelect[item].brandName,
+              specs: this.tableSelect[item].specs,
+              unit: this.tableSelect[item].unit,
+              amount: Number(this.tableSelect[item].amount),
+              billedAmount: this.tableSelect[item].billedAmount,
+              inventory: this.tableSelect[item].inventory,
+              storehouseName: this.tableSelect[item].storehouseName,
+              storehouseId: this.tableSelect[item].storehouseId,
+              price: Number(resArr[item].price),
+              purchaseNum: Number(this.tableSelect[item].noBilledAmount),
+              plannedArrivalTime: dateArr,
+              isNumControl: 1,
+              isTimeControl: 1,
+              checkNum: null,
+              applySurplusNum: this.tableSelect[item].noBilledAmount,
+              warehousedNum: 0,
+              remark: ""
+            });
+          }
+          this.$emit("plAdd", arr);
+          this.$emit("return");
+        } else {
+          this.$Message.error(res.message);
+        }
+      });
+      // this.$emit("plAdd", arr);
+      // this.$emit("return");
     }
   }
 };

+ 9 - 7
src/page/purchase/components/order/orderPrint.vue

@@ -35,10 +35,7 @@
             :span="7"
             class="infor"
           >仓库名称:{{ printData.detailList.length == 0 ? "" : printData.detailList[0].detailList[0].storehouseName }}</Col>
-          <Col
-            :span="7"
-            class="infor"
-          >交货时间:{{ printData.deliveryTime }}</Col>
+          <Col :span="7" class="infor">交货时间:{{ printData.deliveryTime }}</Col>
           <Col :span="5" class="infor">收货人:{{ printData.receivedName }}</Col>
           <Col :span="5" class="infor">TEL:{{ printData.receivedTel }}</Col>
           <Col :span="24" class="infor">交货地点:{{ printData.deliveryPlace }}</Col>
@@ -74,7 +71,7 @@
             <tr>
               <td colspan="2">总金额:</td>
               <td>大写:</td>
-              <td colspan="5">{{ chinesePrice+'元' }}</td>
+              <td colspan="5">{{ chinesePrice }}</td>
               <td>小写:</td>
               <td>¥{{ printData.totalPrice }} -</td>
             </tr>
@@ -102,7 +99,7 @@
                   <span class="square" />/现金(约45天付款)。
                 </p>
                 <p>5、供方如向我司相关人员行贿或所供产品出现规格、数量与送货单不符、以假充真等情形的,我司有权按该产品金额“以一罚十”标准要求乙方承担违约责任;如发现有假发票,我司将有权不给予付款并追究其相关法律责任。</p>
-                <p>6、以上价格已含增值税专用发票3%,发票抬头:东莞市光大物业管理有限公司。</p>
+                <p>6、以上价格已含发票,发票抬头:东莞市光大物业管理有限公司。</p>
                 <p>7、备注:订单日期{{ printData.orderTime ? printData.orderTime.split(' ')[0] : "" }}</p>
               </td>
             </tr>
@@ -141,7 +138,12 @@ export default {
       findPurchaseOrder(postData).then(res => {
         if (res.status == 200) {
           this.printData = res.data;
-          this.chinesePrice = toChinesNum(res.data.totalPrice);
+          if (!res.data.totalPrice) {
+            res.data.totalPrice = 0;
+            this.chinesePrice = "零元整";
+          } else {
+            this.chinesePrice = toChinesNum(res.data.totalPrice);
+          }
         }
       });
     }

+ 37 - 4
src/page/purchase/components/plan/planAdd.vue

@@ -89,11 +89,15 @@
               format="yyyy年MM月"
               :value="form.date"
               @on-change="form.date=$event"
+              :options="jhyfOption"
               type="month"
               placeholder="请选择"
             ></DatePicker>
           </Col>
-          <Col span="4" class-name="tables">分管采购员</Col>
+          <Col span="4" class-name="tables">
+            分管采购员
+            <span class="mustSpan">*</span>
+          </Col>
           <Col span="4" class-name="tables">
             <Select
               v-model="form.fgcgy"
@@ -149,7 +153,11 @@
           </Col>
           <Col span="10" class="upl" style="padding: 5px">
             <div v-for="(item, index) in form.filesList" :key="index">
-              <a :href="item.filePath" :download="item.fileName" target="_blank">{{ item.fileName }}</a>
+              <a
+                :href="item.docUrl ? item.docUrl : 'javascript:void(0);'"
+                :download="item.fileName"
+                :target="item.docUrl ? '_blank' : '_self'"
+              >{{ item.fileName }}</a>
               <span
                 v-if="form.spzt == '0'  || form.spzt == '3' || form.spzt == '4'"
                 style="float: right; cursor:pointer"
@@ -241,6 +249,7 @@
               :disabled="form.spzt == '2'  || form.spzt == '1'"
               :transfer="true"
               format="yyyy-MM-dd"
+              :options="jhdhsjOption"
               type="date"
               :value="tableData[index].arriveTime"
               @on-change="tableData[index].arriveTime=$event"
@@ -296,6 +305,7 @@
               type="date"
               :value="pldhsj"
               @on-change="pldhsj=$event"
+              :options="jhdhsjOption"
               placeholder="请选择"
               style="width: 95%"
             ></DatePicker>
@@ -343,6 +353,22 @@ export default {
         token: localStorage.token,
         userId: localStorage.user_id
       },
+      jhyfOption: {
+        disabledDate(date) {
+          let nDate = new Date();
+          let dn = +new Date(`${nDate.getFullYear()}-${nDate.getMonth() + 1}`);
+          return date.valueOf() < dn;
+        }
+      },
+      jhdhsjOption: {
+        disabledDate(date) {
+          let nDate = new Date();
+          let dn = +new Date(
+            `${nDate.getFullYear()}-${nDate.getMonth() + 1}-${nDate.getDate()}`
+          );
+          return date.valueOf() < dn;
+        }
+      },
       form: {
         status: "", //申购计划状态
         jhdjh: "", // 计划单据号
@@ -492,7 +518,12 @@ export default {
   methods: {
     //批量设置弹窗
     plszOpen() {
-      this.plszShow = true;
+      if (!this.tableSelect.length) {
+        this.$Message.error("请至少选择一条物料明细!");
+        return false;
+      } else {
+        this.plszShow = true;
+      }
     },
     plszOk() {
       let ck = this.plrkck ? this.plrkck : "";
@@ -699,7 +730,7 @@ export default {
     },
     //新增申购计划
     addSgjh() {
-      let mustArr = ["ssqy", "ssxm", "jhlx", "date"];
+      let mustArr = ["ssqy", "ssxm", "jhlx", "date", "fgcgy"];
       for (let i in mustArr) {
         if (!this.form[mustArr[i]]) {
           this.$Message.error("请将信息填写完整!");
@@ -736,6 +767,7 @@ export default {
             this.$Message.success("新建申购计划成功!");
             this.form.bt = res.data.title;
             this.form.jhdjh = res.data.code;
+            this.form.filesList = res.data.attachmentList;
             this.id = res.data.id;
             this.planType = "edit";
             let getData = {
@@ -803,6 +835,7 @@ export default {
         this.spinShow = false;
         if (res.status == 200) {
           this.$Message.success("编辑申购计划成功!");
+          this.getSgjh(this.id);
           // this.cancel();
         } else {
           this.$Message.error(res.message);

+ 55 - 16
src/page/purchase/components/plan/planMxAdd.vue

@@ -4,7 +4,7 @@
       <!-- <p slot="title">添加申购计划物料</p>
       <div slot="extra">
         <Button @click="$emit('return')">返回</Button>
-      </div> -->
+      </div>-->
       <Row :gutter="10" style="margin-bottom: 10px">
         <Col span="5">
           <Select clearable v-model="searchForm.yjfl" @on-change="yjflChange" placeholder="一级分类">
@@ -48,13 +48,20 @@
     </Card>
     <Modal v-model="addShow" width="700" title="新增物料申请" @on-ok="addOk">
       <Row class="mainCont">
-        <Col span="6" class-name="tables">物料名称</Col>
+        <Col span="6" class-name="tables">
+          物料名称
+          <span class="mustSpan">*</span>
+        </Col>
         <Col span="6" class-name="tables">
           <Input v-model="addForm.wlmc" style="width: 95%" placeholder="物料编码或名称" />
         </Col>
-        <Col span="6" class-name="tables">物料一级分类</Col>
         <Col span="6" class-name="tables">
-          <Select clearable
+          物料一级分类
+          <span class="mustSpan">*</span>
+        </Col>
+        <Col span="6" class-name="tables">
+          <Select
+            clearable
             v-model="addForm.yjfl"
             style="width: 95%"
             @on-change="addYjflChange"
@@ -63,7 +70,10 @@
             <Option v-for="item in yjflList" :value="item.gcId" :key="item.gcId">{{ item.gcName }}</Option>
           </Select>
         </Col>
-        <Col span="6" class-name="tables">物料二级分类</Col>
+        <Col span="6" class-name="tables">
+          物料二级分类
+          <span class="mustSpan">*</span>
+        </Col>
         <Col span="6" class-name="tables">
           <Select clearable v-model="addForm.ejfl" style="width: 95%" :transfer="true">
             <Option
@@ -73,25 +83,37 @@
             >{{ item.gcName }}</Option>
           </Select>
         </Col>
-        <Col span="6" class-name="tables">计量单位</Col>
+        <Col span="6" class-name="tables">
+          计量单位
+          <span class="mustSpan">*</span>
+        </Col>
         <Col span="6" class-name="tables">
           <Select clearable v-model="addForm.jldw" style="width: 95%" :transfer="true">
             <Option v-for="item in jldwList" :value="item.value" :key="item.value">{{ item.label }}</Option>
           </Select>
         </Col>
-        <Col span="6" class-name="tables">规格型号</Col>
+        <Col span="6" class-name="tables">
+          规格型号
+          <span class="mustSpan">*</span>
+        </Col>
         <Col span="6" class-name="tables">
           <Input v-model="addForm.ggxh" style="width: 95%" placeholder="请输入" />
         </Col>
-        <Col span="6" class-name="tables">物料类型</Col>
+        <Col span="6" class-name="tables">
+          物料类型
+          <span class="mustSpan">*</span>
+        </Col>
         <Col span="6" class-name="tables">
           <Select clearable v-model="addForm.wllx" style="width: 95%" :transfer="true">
             <Option v-for="item in wllxList" :value="item.value" :key="item.value">{{ item.label }}</Option>
           </Select>
         </Col>
-        <Col span="6" class-name="tables">市场价格(元)</Col>
         <Col span="6" class-name="tables">
-          <Input v-model="addForm.scjg" style="width: 95%" placeholder="请输入" />
+          市场价格(元)
+          <span class="mustSpan">*</span>
+        </Col>
+        <Col span="6" class-name="tables">
+          <InputNumber v-model="addForm.scjg" style="width: 95%" placeholder="请输入" />
         </Col>
         <Col span="6" class-name="tables"></Col>
         <Col span="6" class-name="tables"></Col>
@@ -130,7 +152,7 @@ export default {
         jldw: "", //计量单位
         ggxh: "", //规格型号
         wllx: "", //物料类型
-        scjg: "", //市场价格
+        scjg: 0, //市场价格
         sqsm: "" //申请说明
       },
       //表格查询内容
@@ -153,7 +175,7 @@ export default {
         {
           type: "selection",
           width: 60,
-          align: "center",
+          align: "center"
         },
         {
           title: "物料编码",
@@ -223,7 +245,6 @@ export default {
     addOpen() {
       this.addShow = true;
     },
-    addOk() {},
     addCancel() {
       this.addForm.wlmc = "";
       this.addForm.ejfl = "";
@@ -231,11 +252,25 @@ export default {
       this.addForm.jldw = "";
       this.addForm.ggxh = "";
       this.addForm.wllx = "";
-      this.addForm.scjg = "";
+      this.addForm.scjg = 0;
       this.addForm.sqsm = "";
       this.addShow = false;
     },
     addOk() {
+      let mustArr = ["wlmc", "yjfl", "ejfl", "jldw", "ggxh", "wllx", "scjg"];
+      for (let i in mustArr) {
+        if (!this.addForm[mustArr[i]]) {
+          this.$Message.error("请将信息填写完整!");
+          return false;
+        }
+        if (
+          this.addForm[mustArr[i]] == "" ||
+          this.addForm[mustArr[i]].length == 0
+        ) {
+          this.$Message.error("请将信息填写完整!");
+          return false;
+        }
+      }
       let postData = {
         sgName: this.addForm.wlmc,
         sgGcId: this.addForm.ejfl,
@@ -275,7 +310,7 @@ export default {
         gcId: this.searchForm.ejfl,
         sgNo: this.searchForm.wlmc,
         // sgName: "",
-        projectId: this.projectId.split(',')[0],
+        projectId: this.projectId.split(",")[0]
       };
       this.tableLoading = true;
       tbiStockGoodsList(postData).then(res => {
@@ -314,7 +349,7 @@ export default {
           unit: this.tableSelect[item].measureUnit,
           referencePrice: this.tableSelect[item].salePrice,
           inventory: this.tableSelect[item].numbers,
-          isCancel:0,
+          isCancel: 0,
           amount: 0,
           storehouseId: "", //入库仓库ID  主界面选择
           storehouseName: "", //入库仓库  主界面选择
@@ -333,6 +368,10 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.mustSpan {
+  color: red;
+  margin-left: 2px;
+}
 ivu-card-head-inner,
 .ivu-card-head p {
   display: inline-block;

+ 45 - 11
src/page/purchase/components/pool/poolAdd.vue

@@ -5,11 +5,14 @@
       <Card style="width:100%" :bordered="false" :dis-hover="true">
         <p slot="title">采购订单详情</p>
         <div slot="extra">
-          <!-- <Button
+          <Button
             @click="submitCgdd"
             v-if="(orderType == 'edit') && (form.spzt == '1' || form.spzt == '4')"
-          >提交</Button>-->
-          <Button @click="editCgdd" v-if="form.spzt == '1' || form.spzt == '' || form.spzt == '4'">保存</Button>
+          >提交</Button>
+          <Button
+            @click="editCgdd"
+            v-if="form.spzt == '1' || form.spzt == '' || form.spzt == '4'"
+          >保存</Button>
           <Button @click="cancel">取消</Button>
         </div>
         <Row class="mainCont">
@@ -90,6 +93,7 @@
               style="width: 95%"
               format="yyyy-MM-dd HH:mm:ss"
               :value="form.xdrq"
+              :options="xdrqOption"
               @on-change="form.xdrq=$event"
               type="datetime"
               placeholder="请选择"
@@ -146,9 +150,7 @@
                 :key="item.gpId"
               >{{ item.gpName }}</Option>
             </Select>
-            <span
-              v-else
-            >{{ this.gysList.filter(a => a.gpId == form.gys)[0].gpName }}</span>
+            <span v-else>{{ this.gysList.filter(a => a.gpId == form.gys)[0].gpName }}</span>
           </Col>
           <Col span="4" class-name="tables">供方负责人</Col>
           <Col span="4" class-name="tables">{{ form.gffzr }}</Col>
@@ -271,20 +273,20 @@
           </template>
           <template slot-scope="{ row, index }" slot="isNumControl">
             <RadioGroup v-model="tableData[index].isNumControl">
-              <Radio :label="1" :disabled="form.spzt == '2' || form.spzt == '3'">
+              <Radio :label="0" :disabled="form.spzt == '2' || form.spzt == '3'">
                 <span>是</span>
               </Radio>
-              <Radio :label="2" :disabled="form.spzt == '2' || form.spzt == '3'">
+              <Radio :label="1" :disabled="form.spzt == '2' || form.spzt == '3'">
                 <span>否</span>
               </Radio>
             </RadioGroup>
           </template>
           <template slot-scope="{ row, index }" slot="isTimeControl">
             <RadioGroup v-model="tableData[index].isTimeControl">
-              <Radio :label="1" :disabled="form.spzt == '2' || form.spzt == '3'">
+              <Radio :label="0" :disabled="form.spzt == '2' || form.spzt == '3'">
                 <span>是</span>
               </Radio>
-              <Radio :label="2" :disabled="form.spzt == '2' || form.spzt == '3'">
+              <Radio :label="1" :disabled="form.spzt == '2' || form.spzt == '3'">
                 <span>否</span>
               </Radio>
             </RadioGroup>
@@ -360,6 +362,15 @@ export default {
           return date && date.valueOf() < new Date(this.form.xdrq);
         }
       },
+      xdrqOption: {
+        disabledDate: date => {
+          let nDate = new Date();
+          let dn = +new Date(
+            `${nDate.getFullYear()}-${nDate.getMonth() + 1}-${nDate.getDate()}`
+          );
+          return date.valueOf() < dn;
+        }
+      },
       glxmList: [],
       cgrList: [{ label: "test", value: 1 }],
       djlxList: [],
@@ -632,6 +643,21 @@ export default {
         }
       });
     },
+    //提交订单
+    submitCgdd() {
+      let gpName = this.gysList.filter(a => a.gpId == this.form.gys);
+      let postData = {
+        orderId: this.orderId
+      };
+      submitPurchaseOrder(postData).then(res => {
+        if (res.status == 200) {
+          this.$Message.success("提交采购订单成功!");
+          this.form.spzt = "2";
+        } else {
+          this.$Message.error(res.message);
+        }
+      });
+    },
     //获取采购订单详情
     getCgddXq(id) {
       this.orderId = id;
@@ -718,6 +744,14 @@ export default {
     //新增明细
     mxAddShow() {
       this.contentShow = false;
+      if (this.tableData.length > 0) {
+        this.$refs.mxAdd.searchForm.ck = String(this.tableData[0].storehouseId);
+        this.$refs.mxAdd.ckLock = true;
+      } else {
+        this.$refs.mxAdd.searchForm.ck = "";
+        this.$refs.mxAdd.ckLock = false;
+      }
+      this.$refs.mxAdd.gpId = this.form.gys;
       this.$refs.mxAdd.orderId = this.orderId;
       this.$refs.mxAdd.approvalState = this.form.spzt;
       this.$refs.mxAdd.orderState = this.form.ddzt;
@@ -780,7 +814,7 @@ export default {
       this.tableData = [];
       this.deleteIds = [];
       this.spinShow = false;
-      this.orderType = 'add';
+      this.orderType = "add";
       this.$emit("return");
     }
   },

+ 73 - 36
src/page/purchase/components/pool/poolMxAdd.vue

@@ -7,7 +7,7 @@
       </div>
       <Row :gutter="10" style="margin-bottom: 10px">
         <Col span="4">
-          <Select clearable v-model="searchForm.ck" placeholder="仓库名">
+          <Select clearable v-model="searchForm.ck" :disabled="ckLock" placeholder="仓库名">
             <Option v-for="item in ckList" :value="item.twId" :key="item.twId">{{ item.twName }}</Option>
           </Select>
         </Col>
@@ -57,7 +57,8 @@
 import {
   queryPurchasePoolList,
   tbiGoodsCategoryList,
-  warehouseList
+  warehouseList,
+  getMaterialPrice
 } from "@/service/getData";
 export default {
   data() {
@@ -66,6 +67,8 @@ export default {
       approvalState: "",
       orderState: "",
       areaId: "",
+      gpId: "",
+      ckLock: "",
       projectId: "",
       type: "",
       //新增物料申请表单
@@ -82,6 +85,7 @@ export default {
       },
       //表格查询内容
       searchForm: {
+        ck: "",
         yjfl: "", //一级分类
         ejfl: "", // 二级分类
         wlmc: "" //物料编码或名称
@@ -187,10 +191,10 @@ export default {
         pageSize: 10,
         firstClassId: this.searchForm.yjfl,
         secondClassId: this.searchForm.ejfl,
-        areaIds: this.areaId.split(',')[0],
+        areaIds: this.areaId.split(",")[0],
         queryText1: this.searchForm.wlmc,
         queryText2: "",
-        projectIds: this.projectId.split(',')[0],
+        projectIds: this.projectId.split(",")[0],
         // projectIds: 10,
         storehouseId: this.searchForm.ck
       };
@@ -206,16 +210,20 @@ export default {
       this.getTableData();
     },
     tableOnSelect(selection, row) {
-      this.tableSelect = selection;
+      this.tableSelect = selection.sort((a, b) => {
+        a.id - b.id;
+      });
     },
     tableOnCancel(selection, row) {
-      this.tableSelect = selection;
+      this.tableSelect = selection.sort((a, b) => {
+        a.id - b.id;
+      });
     },
     //获取仓库
     getCk() {
       let postData = {
-        areaId: this.areaId.split(',')[0],
-        projectId: this.projectId.split(',')[0]
+        areaId: this.areaId.split(",")[0],
+        projectId: this.projectId.split(",")[0]
       };
       warehouseList(postData).then(res => {
         if (res.status == 200) {
@@ -231,37 +239,66 @@ export default {
     },
     //批量添加物料
     plAdd() {
+      if (!this.tableSelect.length) {
+        this.$Message.error("请至少选择一个物料。");
+        return false;
+      }
+      let ck = this.tableSelect[0].storehouseId;
       let arr = [];
+      let postArr = [];
       for (let item in this.tableSelect) {
-        let date = new Date();
-        let dateArr = `${date.getFullYear()}-${date.getMonth() +
-          1}-${date.getDate()} 00:00:00`;
-        arr.push({
-          applyDetailId: this.tableSelect[item].id,
-          applyRuleId: this.tableSelect[item].purchaseApplyId,
-          applyRuleCode: this.tableSelect[item].code,
-          code: this.tableSelect[item].materialCode,
-          firstClassName: this.tableSelect[item].firstClassName,
-          materialName: this.tableSelect[item].materialName,
-          brandName: this.tableSelect[item].brandName,
-          specs: this.tableSelect[item].specs,
-          unit: this.tableSelect[item].unit,
-          amount: Number(this.tableSelect[item].amount),
-          billedAmount: this.tableSelect[item].billedAmount,
-          inventory: this.tableSelect[item].inventory,
-          storehouseName: this.tableSelect[item].storehouseName,
-          price: Number(this.tableSelect[item].referencePrice),
-          purchaseNum: 0,
-          plannedArrivalTime: dateArr,
-          isNumControl: 1,
-          isTimeControl: 1,
-          applySurplusNum: this.tableSelect[item].amount,
-          warehousedNum: 0,
-          remark: ""
-        });
+        if (this.tableSelect[item].storehouseId != ck) {
+          this.$Message.error("请选择同一仓库下的物料。");
+          return false;
+        } else {
+          postArr.push({
+            applyDetailId: this.tableSelect[item].id,
+            code: this.tableSelect[item].materialCode,
+            gpId: this.gpId
+          });
+        }
       }
-      this.$emit("plAdd", arr);
-      this.$emit("return");
+      getMaterialPrice(postArr).then(res => {
+        if (res.status == 200) {
+          let resArr = res.data.sort((a, b) => {
+            a.applyDetailId - b.applyDetailId;
+          });
+          for (let item in resArr) {
+            let date = new Date();
+            let dateArr = `${date.getFullYear()}-${date.getMonth() +
+              1}-${date.getDate()} 00:00:00`;
+            arr.push({
+              applyDetailId: this.tableSelect[item].id,
+              applyRuleId: this.tableSelect[item].purchaseApplyId,
+              applyRuleCode: this.tableSelect[item].code,
+              code: this.tableSelect[item].materialCode,
+              firstClassName: this.tableSelect[item].firstClassName,
+              materialName: this.tableSelect[item].materialName,
+              brandName: this.tableSelect[item].brandName,
+              specs: this.tableSelect[item].specs,
+              unit: this.tableSelect[item].unit,
+              amount: Number(this.tableSelect[item].amount),
+              billedAmount: this.tableSelect[item].billedAmount,
+              inventory: this.tableSelect[item].inventory,
+              storehouseName: this.tableSelect[item].storehouseName,
+              storehouseId: this.tableSelect[item].storehouseId,
+              price: Number(resArr[item].price),
+              purchaseNum: Number(this.tableSelect[item].noBilledAmount),
+              plannedArrivalTime: dateArr,
+              isNumControl: 1,
+              isTimeControl: 1,
+              checkNum: null,
+              applySurplusNum: this.tableSelect[item].noBilledAmount,
+              warehousedNum: 0,
+              remark: ""
+            });
+          }
+          this.$emit("plAdd", arr);
+          this.$emit("return");
+        } else {
+          this.$Message.error(res.message);
+        }
+      });
     }
   }
 };

+ 6 - 4
src/page/purchase/purchaseBalance.vue

@@ -286,11 +286,12 @@ export default {
     });
   },
   methods: {
-    goDetail(row){
-      window.open(`https://test.hajwy.com/purchase-web/#/viewPurchaseSett?id=${row.settlementId}`)
+    goDetail(row) {
+      this.editRow(row);
+      // window.open(
+      //   `https://test.hajwy.com/purchase-web/#/viewPurchaseSett?id=${row.settlementId}`
+      // );
       // window.open(`/#/viewPurchaseSett?id=${row.settlementId}`)
-
-
     },
     resizePage() {
       this.resizeHeight = window.innerHeight - 282;
@@ -404,6 +405,7 @@ export default {
     tableOnSelect(selection, row) {},
     pageChange(val) {
       this.pageNum = val;
+      this.getTableData();
     }
   },
   mounted: function() {

+ 5 - 4
src/page/purchase/purchaseOrder.vue

@@ -116,7 +116,7 @@
               @click="printRow(row)"
             >打印</a>
             <a href="javascript:;" @click="cgddxd(row.orderId)" v-if="row.orderState == '2'">下单</a>
-            <a href="javascript:;" @click="cgddqx(row.orderId)" v-if="row.orderState == '2'">取消订单</a>
+            <!-- <a href="javascript:;" @click="cgddqx(row.orderId)" v-if="row.orderState == '2'">取消订单</a> -->
           </div>
         </template>
       </Table>
@@ -283,9 +283,10 @@ export default {
   },
   methods: {
     goDetail(row) {
-      window.open(
-        `https://test.hajwy.com/purchase-web/#/viewPurchaseOrder?id=${row.orderId}`
-      );
+      this.editRow(row);
+      // window.open(
+      //   `https://test.hajwy.com/purchase-web/#/viewPurchaseOrder?id=${row.orderId}`
+      // );
       // window.open(`/#/viewPurchaseOrder?id=${row.orderId}`)
     },
     resizePage() {

+ 18 - 7
src/page/purchase/purchasePlan.vue

@@ -111,7 +111,7 @@
         </template>
         <template slot-scope="{ row, index }" slot="action">
           <div>
-            <a href="javascript:;" @click="editRow(row)" v-if="row.applyStatus != '3'">编辑</a>
+            <a href="javascript:;" @click="editRow(row)">编辑</a>
             <!-- <a href="javascript:;">复制</a> -->
             <a href="javascript:;" v-if="row.applyStatus == '0'" @click="deleteRow(row)">删除</a>
             <a
@@ -318,9 +318,13 @@ export default {
   },
   methods: {
     goDetail(row, index) {
-      window.open(
-        `https://test.hajwy.com/purchase-web/#/viewPurchaseApply?id=${row.id}`
-      );
+      if (row.applyStatus != "3") {
+        this.editRow(row);
+      } else {
+        window.open(
+          `https://test.hajwy.com/purchase-web/#/viewPurchaseApply?id=${row.id}`
+        );
+      }
       // window.open(`/#/viewPurchaseApply?id=${row.id}`);
     },
     resizePage() {
@@ -358,6 +362,7 @@ export default {
         postData.createStartTime = this.searchForm.zdrq[0];
         postData.createEndTime = this.searchForm.zdrq[1];
       }
+      console.log(postData, 11111111111111111);
       exportPurchaseInfo(postData);
     },
     //打印
@@ -402,9 +407,15 @@ export default {
     },
     //行编辑
     editRow(row) {
-      this.addShow = true;
-      this.$refs.add.planType = "edit";
-      this.$refs.add.getSgjh(row.id);
+      if (row.applyStatus != "3") {
+        this.addShow = true;
+        this.$refs.add.planType = "edit";
+        this.$refs.add.getSgjh(row.id);
+      } else {
+        window.open(
+          `https://test.hajwy.com/purchase-web/#/viewPurchaseApply?id=${row.id}`
+        );
+      }
     },
     //行删除
     deleteRow(row) {

+ 15 - 3
src/page/purchase/purchasePool.vue

@@ -89,6 +89,7 @@
             format="yyyy-MM-dd HH:mm:ss"
             :value="addForm.xdrq"
             @on-change="addForm.xdrq=$event"
+            :options="xdrqOption"
             type="datetime"
             placeholder="请选择"
           ></DatePicker>
@@ -202,6 +203,15 @@ export default {
           return date && date.valueOf() < new Date(this.addForm.xdrq);
         }
       },
+      xdrqOption: {
+        disabledDate: date => {
+          let nDate = new Date();
+          let dn = +new Date(
+            `${nDate.getFullYear()}-${nDate.getMonth() + 1}-${nDate.getDate()}`
+          );
+          return date.valueOf() < dn;
+        }
+      },
       tableColumn: [
         {
           type: "selection",
@@ -336,13 +346,13 @@ export default {
         firstClassId: this.searchForm.yjfl,
         secondClassId: this.searchForm.ejfl,
         areaIds: this.searchForm.ssqy,
-        queryText1: this.searchForm.title?this.searchForm.title:'',
+        queryText1: this.searchForm.title ? this.searchForm.title : "",
         queryText2: this.searchForm.sgjh,
         projectIds: this.searchForm.ssxm
         // storehouseId: this.searchForm.ck
       };
-      let res = await exportPurchasePool(postData)
-      console.log(res)
+      let res = await exportPurchasePool(postData);
+      console.log(res);
     },
     resizePage() {
       this.resizeHeight = window.innerHeight - 282;
@@ -373,6 +383,7 @@ export default {
     },
     addReturn() {
       this.contentShow = true;
+      this.getTableData();
       // this.$router.push("/index/purchaseOrder");
     },
     gysChange(val) {
@@ -471,6 +482,7 @@ export default {
               amount: Number(this.tableSelect[i].amount),
               billedAmount: this.tableSelect[i].billedAmount,
               inventory: this.tableSelect[i].inventory,
+              storehouseId: this.tableSelect[i].storehouseId,
               storehouseName: this.tableSelect[i].storehouseName,
               price: Number(this.tableSelect[i].referencePrice),
               purchaseNum: 0,

+ 67 - 102
src/page/purchaseView/allot.vue

@@ -3,166 +3,124 @@
     <!-- 页面主体内容 -->
     <div class="planAddContent" v-show="contentShow">
       <Card style="width:100%" :bordered="false" :dis-hover="true">
-        <p slot="title">内部调拨详情</p>
+        <p key="title">内部调拨详情</p>
         <Row class="mainCont">
           <Col span="4" class-name="tables">调拨单号</Col>
-          <Col span="4" class-name="tables"></Col>
+          <Col span="4" class-name="tables">{{ form.irNo }}</Col>
           <Col span="4" class-name="tables">调出项目</Col>
-          <Col span="4" class-name="tables"></Col>
+          <Col span="4" class-name="tables">{{ form.projectName }}</Col>
           <Col span="4" class-name="tables">调入项目</Col>
-          <Col span="4" class-name="tables"></Col>
+          <Col span="4" class-name="tables">{{ form.projectNameIn }}</Col>
           <Col span="4" class-name="tables">调出仓库</Col>
-          <Col span="4" class-name="tables"></Col>
+          <Col span="4" class-name="tables">{{ form.twName }}</Col>
           <Col span="4" class-name="tables">调入仓库</Col>
-          <Col span="4" class-name="tables"></Col>
+          <Col span="4" class-name="tables">{{ form.twNameIn }}</Col>
           <Col span="4" class-name="tables">调拨日期</Col>
-          <Col span="4" class-name="tables"></Col>
+          <Col span="4" class-name="tables">{{ form.produceDate }}</Col>
           <Col span="4" class-name="tables">总价(元)</Col>
-          <Col span="4" class-name="tables"></Col>
+          <Col span="4" class-name="tables">{{ form.allnumbers }}</Col>
           <Col span="4" class-name="tables">申请人</Col>
-          <Col span="4" class-name="tables"></Col>
+          <Col span="4" class-name="tables">{{ form.warehouseUser }}</Col>
           <Col span="4" class-name="tables">审批状态</Col>
-          <Col span="4" class-name="tables"></Col>
+          <Col span="4" class-name="tables">{{ form.allocationState }}</Col>
           <Col span="4" class-name="tables">状态</Col>
-          <Col span="4" class-name="tables"></Col>
+          <Col span="4" class-name="tables">{{ form.allocationStatus }}</Col>
           <Col span="4" class-name="tables">出库日期</Col>
-          <Col span="4" class-name="tables"></Col>
+          <Col span="4" class-name="tables">{{ form.outDate }}</Col>
           <Col span="4" class-name="tables">入库日期</Col>
-          <Col span="4" class-name="tables"></Col>
+          <Col span="4" class-name="tables">{{ form.inDate }}</Col>
         </Row>
         <Row class="mainCont">
           <Col span="4" class-name="tables">说明</Col>
-          <Col span="20" class-name="tables">{{ form.sm }}</Col>
+          <Col span="20" class-name="tables">{{ form.irRemark }}</Col>
         </Row>
         <Spin size="large" fix v-if="spinShow"></Spin>
       </Card>
       <Card style="width:100%" :bordered="false" :dis-hover="true">
-        <p slot="title">申购计划明细</p>
-        <Table :columns="tableColumn" style="width: 100%" :data="tableData" :loading="tableLoading">
-          <template slot-scope="{ row, index }" slot="amount">
-            <div>{{ row.amount }}</div>
-          </template>
-          <template slot-scope="{ row, index }" slot="storehouseId">{{ row.storehouseName }}</template>
-          <template slot-scope="{ row, index }" slot="linkedPersonName">
-            <span>{{ row.linkedPersonName }}</span>
-          </template>
-          <template slot-scope="{ row, index }" slot="billType">
-            {{ djList.filter(a => a.value == row.billType)[0].label }}
-          </template>
-          <template slot-scope="{ row, index }" slot="referenceTotalPrice">
-            <span>{{ row.amount * row.referencePrice }}</span>
-          </template>
-          <template slot-scope="{ row, index }" slot="arriveTime">{{ row.arriveTime }}</template>
-          <!-- @on-change="((val, date) => tableDateChange(val, date ,index))" -->
-          <template slot-scope="{ row, index }" slot="remark">{{ row.remark }}</template>
-        </Table>
+        <p key="title">内部调拨明细</p>
+        <Table :columns="tableColumn" style="width: 100%" :data="tableData" :loading="tableLoading"></Table>
       </Card>
     </div>
   </div>
 </template>
 
 <script>
-import {
-  queryPurchaseApplyInfo4OA,
-  getJobList,
-  warehouseList,
-  getLabelByCode4Purchase
-} from "@/service/getData";
+import { getDetailRecord } from "@/service/getData";
 export default {
   data() {
     return {
       form: {
-
+        irNo: "", //调拨单号
+        projectName: "", //调出项目
+        projectNameIn: "", //调入项目
+        twName: "", //调出仓库
+        twNameIn: "", //调入仓库
+        produceDate: "", //调拨日期
+        allnumbers: "", //总价
+        warehouseUser: "", //申请人
+        allocationState: "", //审批状态
+        allocationStatus: "", //状态
+        outDate: "", //出库日期
+        inDate: "", //入库日期
+        irRemark: "" //说明
       },
+      contentShow: true,
+      spinShow: false,
       tableColumn: [
-        {
-          type: "selection",
-          width: 60,
-          align: "center"
-        },
         {
           title: "物料编码",
-          key: "code",
-          tooltip: "true",
-          width: 100
+          key: "sgNo",
+          tooltip: "true"
         },
         {
           title: "物料分类",
-          key: "firstClassName",
-          tooltip: "true",
-          width: 100
+          key: "gcFirst",
+          tooltip: "true"
         },
         {
           title: "物料名称",
-          key: "materialName",
-          tooltip: "true",
-          width: 100
+          key: "sgName",
+          tooltip: "true"
         },
         {
           title: "规格型号",
-          key: "specs",
-          tooltip: "true",
-          width: 100
+          key: "standardModel",
+          tooltip: "true"
         },
         {
           title: "单位",
-          key: "unit",
-          tooltip: "true",
-          width: 100
+          key: "measureUnit",
+          tooltip: "true"
         },
         {
           title: "库存量",
-          key: "inventory",
-          tooltip: "true",
-          width: 100
-        },
-        {
-          title: "申购数量",
-          slot: "amount",
-          tooltip: "true",
-          width: 100
+          key: "cumulativeNumbers",
+          tooltip: "true"
         },
         {
-          title: "参考单价(元)",
-          key: "referencePrice",
-          tooltip: "true",
-          width: 120
+          title: "可调拨数量",
+          key: "alreadyNumbers",
+          tooltip: "true"
         },
         {
-          title: "参考总价(元)",
-          slot: "referenceTotalPrice",
-          tooltip: "true",
-          width: 120
+          title: "调拨数量",
+          key: "numbers",
+          tooltip: "true"
         },
         {
-          title: "入库仓库",
-          slot: "storehouseId",
-          tooltip: "true",
-          width: 100
-        },
-        {
-          title: "对接人",
-          slot: "linkedPersonName",
-          tooltip: "true",
-          width: 100
-        },
-        {
-          title: "单据类型",
-          slot: "billType",
-          tooltip: "true",
-          width: 100
+          title: "参考单价(元)",
+          key: "salePrice",
+          tooltip: "true"
         },
         {
-          title: "计划到货时间",
-          slot: "arriveTime",
-          tooltip: "true",
-          width: 130
+          title: "参考总价(元)",
+          key: "totalMoney",
+          tooltip: "true"
         },
         {
           title: "备注",
-          slot: "remark",
-          tooltip: "true",
-          width: 100
+          key: "remark",
+          tooltip: "true"
         }
       ],
       tableData: [],
@@ -171,9 +129,16 @@ export default {
     };
   },
   created() {
+    if (this.$route.query.param) {
+      getDetailRecord({ irId: this.$route.query.param }).then(res => {
+        this.form = {
+          ...res.data
+        };
+        this.tableData = res.data.data;
+      });
+    }
   },
-  methods: {
-  }
+  methods: {}
 };
 </script>
 

+ 2 - 3
src/router/index.js

@@ -37,10 +37,9 @@ export const router = new VueRouter(RouterConfig);
 router.beforeEach((to, from, next) => {
   iView.LoadingBar.start();
   next();
-  if (to.path == '/viewPurchaseApply' || to.path == '/viewPurchaseSett' || to.path == '/viewPurchaseOrder') {
-    console.log("asdasdasdasdasdasd");
+  if (to.path == '/viewPurchaseApply' || to.path == '/viewPurchaseSett' || to.path == '/viewPurchaseOrder' || to.path == '/viewInternalAllocation') {
     next()
-  }else if (to.query.token && to.query.token != '') {
+  } else if (to.query.token && to.query.token != '') {
     var token = to.query.token;
     next('/tokenLogin/' + token);
   } else {

+ 5 - 0
src/router/router.js

@@ -46,6 +46,11 @@ const routes = [{
       component: resolve => {
         require(['@/page/purchaseView/order'], resolve);
       }
+    }, {
+      path: '/viewInternalAllocation',
+      component: resolve => {
+        require(['@/page/purchaseView/allot'], resolve);
+      }
     },
     {
       path: '/index',

+ 5 - 1
src/service/getData.js

@@ -65,6 +65,8 @@ export const getJobList = (data) => fetch('/common/getJobList', '/purchase', dat
 export const stockGoodsByGpID = (data) => fetch('/common/stockGoodsByGpID', '/purchase', data, 'JSON2', 'GET');
 //通用 --- 供应商  ----  查询计量单位
 export const getLabelByCode4Purchase = (data) => fetch('/dictDetail/getLabelByCode4Purchase', '/purchase', data, 'JSON2', 'GET');
+//通用 --- 内部调拨  ---- 获取内部调拨详情
+export const getDetailRecord = (data) => fetch('/common/getDetailRecord', '/purchase', data, 'JSON2', 'GET');
 /*
  *采购管理
  *供应商模块接口
@@ -142,7 +144,7 @@ export const tbiStockGoodsList = (data) => fetch(`
 /common/tbiStockGoodsList`, '/purchase', data, 'JSON2', 'GET');
 //申购计划 ---  申购计划导出
 export const exportPurchaseInfo = (data) => download(`
-/purchaseApply/exportPurchaseInfo`, '/purchase', "data", 'JSON', 'POST', 'JSON');
+/purchaseApply/exportPurchaseInfo`, '/purchase', data, 'JSON', 'POST', 'JSON');
 //申购计划 ---  申购计划打印
 export const printPurchaseApplyDetailVO = (data) => fetch(`
 /purchaseApply/printPurchaseApplyDetailVO`, '/purchase', data, 'JSON2', 'POST');
@@ -189,6 +191,8 @@ export const editPurchaseOrder = (data) => fetch(`/purchaseOrder/editPurchaseOrd
 export const editPurchaseOrderState = (data) => fetch(`/purchaseOrder/editPurchaseOrderState${data}`, '/purchase', data, 'JSON2', 'POST');
 //采购订单 ---  取消采购结算明细
 export const editPurchaseOrderDetailState = (data) => fetch(`/purchaseOrder/editPurchaseOrderDetailState?id=${data}`, '/purchase', "", 'JSON2', 'POST');
+//采购订单 ---  根据供应商获取物料报价
+export const getMaterialPrice = (data) => fetch(`/purchaseOrder/getMaterialPrice`, '/purchase', data, 'JSON2', 'POST');
 
 /*
  *采购管理