simple hace 3 años
padre
commit
3867d75136

+ 1 - 1
config/index.js

@@ -27,7 +27,7 @@ module.exports = {
   },
   dev: {
     env: require('./dev.env'),
-    host: 'localhost',
+    host: '172.18.0.116',
     port: process.env.PORT || 8085,
     autoOpenBrowser: true,
     assetsSubDirectory: 'static',

+ 9 - 9
src/page/baseInfo/supply.vue

@@ -201,35 +201,35 @@ export default {
           title: "供应商编码",
           key: "gpNumber",
           tooltip: true,
-          width: 100,
+          minWidth: 100,
           resizable: true,
         },
         {
           title: "供应商名称",
           key: "gpName",
           tooltip: true,
-          width: 200,
+          minWidth: 200,
           resizable: true,
         },
         {
           title: "供应商简称",
           key: "gpAbbreviation",
           tooltip: true,
-          width: 120,
+          minWidth: 120,
           resizable: true,
         },
         {
           title: "联系人",
           key: "gpLinker",
           tooltip: true,
-          width: 120,
+          minWidth: 120,
           resizable: true,
         },
         {
           title: "联系电话",
           key: "gpLinkTell",
           tooltip: true,
-          width: 120,
+          minWidth: 120,
           resizable: true,
         },
         // {
@@ -246,28 +246,28 @@ export default {
           title: "所属区域",
           key: "gpRegionName",
           tooltip: true,
-          width: 120,
+          minWidth: 120,
           resizable: true,
         },
         {
           title: "分管采购员",
           key: "gpBuyerName",
           tooltip: true,
-          width: 120,
+          minWidth: 120,
           resizable: true,
         },
         {
           title: "启用状态",
           slot: "gpEnabledState",
           tooltip: true,
-          width: 120,
+          minWidth: 120,
           resizable: true,
         },
         {
           title: "创建或同步时间",
           key: "createDate",
           tooltip: true,
-          width: 150,
+          minWidth: 150,
           resizable: true,
         },
       ],

+ 8 - 8
src/page/purchase/components/balance/balanceAdd.vue

@@ -269,7 +269,7 @@
           {
             title: "入库单",
             key: "warehouseEntry",
-            width: 200,
+            minWidth: 200,
             tooltip: true,
             resizable: true,
           },
@@ -277,49 +277,49 @@
             title: "总价(元)",
             key: "totalPrice",
             tooltip: true,
-            width: 120,
+            minWidth: 120,
             resizable: true,
           },
           {
             title: "采购人",
             key: "purchaserName",
             tooltip: true,
-            width: 120,
+            minWidth: 120,
             resizable: true,
           },
           {
             title: "采购人联系方式",
             key: "purchaserTel",
             tooltip: true,
-            width: 120,
+            minWidth: 120,
             resizable: true,
           },
           {
             title: "下单时间",
             key: "orderTime",
             tooltip: true,
-            width: 120,
+            minWidth: 120,
             resizable: true,
           },
           {
             title: "入库时间",
             key: "storehouseTime",
             tooltip: true,
-            width: 120,
+            minWidth: 120,
             resizable: true,
           },
           {
             title: "入库仓库",
             key: "storehouseName",
             tooltip: true,
-            width: 120,
+            minWidth: 120,
             resizable: true,
           },
           {
             title: "仓管员",
             key: "warehouseKeeper",
             tooltip: true,
-            width: 120,
+            minWidth: 120,
             resizable: true,
           },
         ],

+ 967 - 776
src/page/purchase/components/pool/poolAdd.vue

@@ -2,52 +2,87 @@
   <div>
     <!-- 页面主体内容 -->
     <div class="planAddContent" v-show="contentShow && !printShow">
-      <Card style="width:100%" :bordered="false" :dis-hover="true">
+      <Card style="width: 100%" :bordered="false" :dis-hover="true">
         <p slot="title">采购订单详情</p>
         <div slot="extra">
           <Button v-if="form.spzt != '1'" @click="toSpjl">查看审批记录</Button>
-          <Button @click="submitCgdd" :disabled="submitLoading"
-            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 href="javascript:;" v-if="form.ddzt != '6' && form.spzt != '4'" @click="printRow()">打印</Button>
+          <Button
+            @click="submitCgdd"
+            :disabled="submitLoading"
+            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
+            href="javascript:;"
+            v-if="form.ddzt != '6' && form.spzt != '4'"
+            @click="printRow()"
+            >打印</Button
+          >
           <Button @click="cancel">返回</Button>
         </div>
         <Row class="mainCont">
           <Col span="4" class-name="tables">订购编号</Col>
           <Col span="4" class-name="tables">
-          <!-- <span v-if="orderType == 'add'">保存成功后生成</span>
+            <!-- <span v-if="orderType == 'add'">保存成功后生成</span>
             <span v-else>{{ form.dgbh }}</span>-->
-          {{ orderType == 'add' ? '保存成功后生成' : form.dgbh }}
+            {{ orderType == "add" ? "保存成功后生成" : form.dgbh }}
           </Col>
           <Col span="4" class-name="tables">标题</Col>
           <Col span="4" class-name="tables">
-          <span v-if="orderType == 'add'">保存成功后生成</span>
-          <span v-else>{{ form.bt }}</span>
+            <span v-if="orderType == 'add'">保存成功后生成</span>
+            <span v-else>{{ form.bt }}</span>
           </Col>
           <Col span="4" class-name="tables">总价(元)</Col>
           <Col span="4" class-name="tables">{{ form.totalPrice }}</Col>
           <Col span="4" class-name="tables">
-          关联区域
-          <span class="mustSpan">*</span>
+            关联区域
+            <span class="mustSpan">*</span>
           </Col>
           <Col span="4" class-name="tables">
-          <Select clearable v-model="form.glqy" style="width: 95%" v-if="orderType == 'add'" @on-change="ssqyChange"
-            disabled>
-            <Option v-for="item in glqyList" :value="item.areaId + ',' + item.areaName" :key="item.areaId">
-              {{ item.areaName }}</Option>
-          </Select>
-          <span v-else>{{ form.glqy.split(',')[1] }}</span>
+            <Select
+              clearable
+              v-model="form.glqy"
+              style="width: 95%"
+              v-if="orderType == 'add'"
+              @on-change="ssqyChange"
+              disabled
+            >
+              <Option
+                v-for="item in glqyList"
+                :value="item.areaId + ',' + item.areaName"
+                :key="item.areaId"
+              >
+                {{ item.areaName }}</Option
+              >
+            </Select>
+            <span v-else>{{ form.glqy.split(",")[1] }}</span>
           </Col>
           <Col span="4" class-name="tables">
-          关联项目
-          <span class="mustSpan">*</span>
+            关联项目
+            <span class="mustSpan">*</span>
           </Col>
           <Col span="4" class-name="tables">
-          <Select clearable v-model="form.glxm" style="width: 95%" v-if="orderType == 'add'" disabled>
-            <Option v-for="item in glxmList" :value="item.projectId + ',' + item.projectName" :key="item.projectId">
-              {{ item.projectName }}</Option>
-          </Select>
-          <span v-else>{{ form.glxm.split(',')[1] }}</span>
+            <Select
+              clearable
+              v-model="form.glxm"
+              style="width: 95%"
+              v-if="orderType == 'add'"
+              disabled
+            >
+              <Option
+                v-for="item in glxmList"
+                :value="item.projectId + ',' + item.projectName"
+                :key="item.projectId"
+              >
+                {{ item.projectName }}</Option
+              >
+            </Select>
+            <span v-else>{{ form.glxm.split(",")[1] }}</span>
           </Col>
           <!-- <Col span="4" class-name="tables">单据类型</Col>
           <Col span="4" class-name="tables">
@@ -65,65 +100,105 @@
           <Col span="4" class-name="tables">{{ form.cgr }}</Col>
           <Col span="4" class-name="tables">采购人联系方式</Col>
           <Col span="4" class-name="tables">
-          <Input v-model="form.cgrlxfs" :disabled="form.spzt == '2' || form.spzt == '3'" placeholder="请输入"
-            style="width: 95%" />
+            <Input
+              v-model="form.cgrlxfs"
+              :disabled="form.spzt == '2' || form.spzt == '3'"
+              placeholder="请输入"
+              style="width: 95%"
+            />
           </Col>
           <Col span="4" class-name="tables">
-          下单日期
-          <span class="mustSpan">*</span>
+            下单日期
+            <span class="mustSpan">*</span>
           </Col>
           <Col span="4" class-name="tables">
-          <DatePicker style="width: 95%" format="yyyy-MM-dd HH:mm:ss" :value="form.xdrq" :options="xdrqOption"
-            @on-change="form.xdrq=$event" type="datetime" placeholder="请选择"
-            :disabled="form.spzt == '2' || form.spzt == '3'"></DatePicker>
+            <DatePicker
+              style="width: 95%"
+              format="yyyy-MM-dd HH:mm:ss"
+              :value="form.xdrq"
+              :options="xdrqOption"
+              @on-change="form.xdrq = $event"
+              type="datetime"
+              placeholder="请选择"
+              :disabled="form.spzt == '2' || form.spzt == '3'"
+            ></DatePicker>
           </Col>
           <Col span="4" class-name="tables">
-          交货时间
-          <span class="mustSpan">*</span>
+            交货时间
+            <span class="mustSpan">*</span>
           </Col>
           <Col span="4" class-name="tables">
-          <DatePicker :disabled="form.xdrq == '' || form.spzt != '1'" style="width: 95%" format="yyyy-MM-dd"
-            :value="form.jhsj" :options="jhsjOptions" @on-change="form.jhsj=$event" type="date" placeholder="请选择">
-          </DatePicker>
+            <DatePicker
+              :disabled="form.xdrq == '' || form.spzt != '1'"
+              style="width: 95%"
+              format="yyyy-MM-dd"
+              :value="form.jhsj"
+              :options="jhsjOptions"
+              @on-change="form.jhsj = $event"
+              type="date"
+              placeholder="请选择"
+            >
+            </DatePicker>
           </Col>
           <Col span="4" class-name="tables">交货地点</Col>
           <Col span="4" class-name="tables">{{ form.jhdd }}</Col>
           <Col span="4" class-name="tables">
-          收货人
-          <span class="mustSpan">*</span>
+            收货人
+            <span class="mustSpan">*</span>
           </Col>
           <Col span="4" class-name="tables">
-          <Input v-model="form.shr" :disabled="form.spzt == '2' || form.spzt == '3'" placeholder="请输入"
-            style="width: 95%" />
+            <Input
+              v-model="form.shr"
+              :disabled="form.spzt == '2' || form.spzt == '3'"
+              placeholder="请输入"
+              style="width: 95%"
+            />
           </Col>
           <Col span="4" class-name="tables">
-          收货人联系方式
-          <span class="mustSpan">*</span>
+            收货人联系方式
+            <span class="mustSpan">*</span>
           </Col>
           <Col span="4" class-name="tables">
-          <Input v-model="form.shrlxfs" :disabled="form.spzt == '2' || form.spzt == '3'" placeholder="请输入"
-            style="width: 95%" />
+            <Input
+              v-model="form.shrlxfs"
+              :disabled="form.spzt == '2' || form.spzt == '3'"
+              placeholder="请输入"
+              style="width: 95%"
+            />
           </Col>
           <Col span="4" class-name="tables">
-          供应商
-          <span class="mustSpan">*</span>
+            供应商
+            <span class="mustSpan">*</span>
           </Col>
           <Col span="12" class-name="tables">
-          <Select clearable v-model="form.gys" @on-change="gysChange" filterable style="width: 95%"
-            v-if="orderType == 'add'">
-            <Option v-for="item in gysList" :disabled="form.spzt == '2' || form.spzt == '3'" :value="item.gpId"
-              :key="item.gpId">{{ item.gpName }}</Option>
-          </Select>
-          <span v-else>{{ this.gysList.filter(a => a.gpId == form.gys)[0].gpName }}</span>
+            <Select
+              clearable
+              v-model="form.gys"
+              @on-change="gysChange"
+              filterable
+              style="width: 95%"
+              v-if="orderType == 'add'"
+            >
+              <Option
+                v-for="item in gysList"
+                :disabled="form.spzt == '2' || form.spzt == '3'"
+                :value="item.gpId"
+                :key="item.gpId"
+                >{{ item.gpName }}</Option
+              >
+            </Select>
+            <span v-else>{{
+              this.gysList.filter((a) => a.gpId == form.gys)[0].gpName
+            }}</span>
           </Col>
           <Col span="4" class-name="tables">
-          供方负责人
-          <span class="mustSpan">*</span>
+            供方负责人
+            <span class="mustSpan">*</span>
           </Col>
           <Col span="4" class-name="tables">{{ form.gffzr }}</Col>
           <Col span="4" class-name="tables">
-          供应商联系电话
-          <span class="mustSpan">*</span>
+            供应商联系电话
+            <span class="mustSpan">*</span>
           </Col>
           <Col span="4" class-name="tables">{{ form.gyslxdh }}</Col>
           <Col span="4" class-name="tables">关联申购计划</Col>
@@ -132,849 +207,965 @@
           <Col span="4" class-name="tables"></Col>-->
           <Col span="4" class-name="tables">审批状态</Col>
           <Col span="4" class-name="tables">
-          <span v-if="form.spzt == ''">-</span>
-          <span v-if="form.spzt == '1'">未提交</span>
-          <span v-if="form.spzt == '2'">审核中</span>
-          <span v-if="form.spzt == '3'">审核通过</span>
-          <span v-if="form.spzt == '4'">审核拒绝</span>
+            <span v-if="form.spzt == ''">-</span>
+            <span v-if="form.spzt == '1'">未提交</span>
+            <span v-if="form.spzt == '2'">审核中</span>
+            <span v-if="form.spzt == '3'">审核通过</span>
+            <span v-if="form.spzt == '4'">审核拒绝</span>
           </Col>
           <Col span="4" class-name="tables">审批通过时间</Col>
           <Col span="4" class-name="tables">-</Col>
           <Col span="4" class-name="tables">订单状态</Col>
           <Col span="4" class-name="tables">
-          <span v-if="form.ddzt == ''">-</span>
-          <span v-if="form.ddzt == '1'">未下单</span>
-          <span v-if="form.ddzt == '2'">待下单</span>
-          <span v-if="form.ddzt == '3'">已下单</span>
-          <span v-if="form.ddzt == '4'">入库中</span>
-          <span v-if="form.ddzt == '5'">已入库</span>
-          <span v-if="form.ddzt == '6'">已取消</span>
-          </Col>
-          <Col span="4" class-name="tables">
-          </Col>
-          <Col span="4" class-name="tables">
+            <span v-if="form.ddzt == ''">-</span>
+            <span v-if="form.ddzt == '1'">未下单</span>
+            <span v-if="form.ddzt == '2'">待下单</span>
+            <span v-if="form.ddzt == '3'">已下单</span>
+            <span v-if="form.ddzt == '4'">入库中</span>
+            <span v-if="form.ddzt == '5'">已入库</span>
+            <span v-if="form.ddzt == '6'">已取消</span>
           </Col>
+          <Col span="4" class-name="tables"> </Col>
+          <Col span="4" class-name="tables"> </Col>
         </Row>
-        <Row class="uplCont" type="flex" justify="center" style="align-items: stretch">
+        <Row
+          class="uplCont"
+          type="flex"
+          justify="center"
+          style="align-items: stretch"
+        >
           <Col span="4" class-name="upl">附件</Col>
           <Col span="6" class-name="uplf">
-          <Upload :headers="uploadHeaders" style="width: 80%" multiple type="drag"
-            :disabled="form.spzt == '2' || form.spzt == '3'" action="/purchase/common/uploadFile"
-            :before-upload="beforeUpload" :on-success="uploadFilesSuccess" :show-upload-list="false"
-            :on-progress="upFilesLoading">
-            <!-- :default-file-list="xzwgForm.filesList" -->
-            <div style="padding: 5px 0">
-              <Icon type="md-cloud-upload" size="36" style="color: #3399ff"></Icon>
-              <span>点击或将文件拖拽到这里上传</span>
-            </div>
-          </Upload>
+            <Upload
+              :headers="uploadHeaders"
+              style="width: 80%"
+              multiple
+              type="drag"
+              :disabled="form.spzt == '2' || form.spzt == '3'"
+              action="/purchase/common/uploadFile"
+              :before-upload="beforeUpload"
+              :on-success="uploadFilesSuccess"
+              :show-upload-list="false"
+              :on-progress="upFilesLoading"
+            >
+              <!-- :default-file-list="xzwgForm.filesList" -->
+              <div style="padding: 5px 0">
+                <Icon
+                  type="md-cloud-upload"
+                  size="36"
+                  style="color: #3399ff"
+                ></Icon>
+                <span>点击或将文件拖拽到这里上传</span>
+              </div>
+            </Upload>
           </Col>
           <Col span="6" class="upl" style="padding: 5px">
-          <div v-for="(item, index) in form.filesList" :key="index">
-            <a :href="item.docUrl ? item.docUrl : 'javascript:void(0);'" :download="item.fileName"
-              target="_blank">{{ item.fileName }}</a>
-            <span style="float: right; cursor:pointer" @click="form.filesList.splice(index, 1)">x</span>
-          </div>
-          <p v-if="uploading" style="text-align: center">上传中...</p>
+            <div v-for="(item, index) in form.filesList" :key="index">
+              <a
+                :href="item.docUrl ? item.docUrl : 'javascript:void(0);'"
+                :download="item.fileName"
+                target="_blank"
+                >{{ item.fileName }}</a
+              >
+              <span
+                style="float: right; cursor: pointer"
+                @click="form.filesList.splice(index, 1)"
+                >x</span
+              >
+            </div>
+            <p v-if="uploading" style="text-align: center">上传中...</p>
           </Col>
           <Col span="4" class-name="upl">
-          发票抬头
-          <span class="mustSpan">*</span>
+            发票抬头
+            <span class="mustSpan">*</span>
           </Col>
           <Col span="4" class-name="upl">
-          <Select v-model="form.fptt" style="width: 95%" :disabled="form.spzt == '2' || form.spzt == '3'">
-            <Option v-for="item in fpttList" :value="item.value" :key="item.value">{{ item.label }}</Option>
-          </Select>
+            <Select
+              v-model="form.fptt"
+              style="width: 95%"
+              :disabled="form.spzt == '2' || form.spzt == '3'"
+            >
+              <Option
+                v-for="item in fpttList"
+                :value="item.value"
+                :key="item.value"
+                >{{ item.label }}</Option
+              >
+            </Select>
           </Col>
         </Row>
         <Row class="mainCont">
           <Col span="4" class-name="tables">说明</Col>
-          <Col span="20" class-name="tables">
-          <Input v-model="form.sm" :disabled="form.spzt == '2' || form.spzt == '3'" placeholder="请输入" type="textarea"
-            style="width: 99%" />
+          <Col span="20" class-name="tables" style="padding: 10px 0">
+            <Input
+              v-model="form.sm"
+              :disabled="form.spzt == '2' || form.spzt == '3'"
+              placeholder="请输入"
+              type="textarea"
+              style="width: 99%"
+            />
           </Col>
         </Row>
         <Spin size="large" fix v-if="spinShow"></Spin>
       </Card>
-      <Card style="width:100%" :bordered="false" :dis-hover="true">
+      <Card style="width: 100%" :bordered="false" :dis-hover="true">
         <p slot="title">采购明细</p>
         <div slot="extra">
-          <Button type="primary" @click="mxAddShow" :disabled="orderType == 'add'">新增明细</Button>
+          <Button
+            type="primary"
+            @click="mxAddShow"
+            :disabled="orderType == 'add'"
+            >新增明细</Button
+          >
         </div>
-        <Table :columns="tableColumn" style="width: 100%" :data="tableData" :loading="tableLoading" border
-          @on-select="tableOnSelect" highlight-row>
+        <Table
+          :columns="tableColumn"
+          style="width: 100%"
+          :data="tableData"
+          :loading="tableLoading"
+          border
+          @on-select="tableOnSelect"
+          highlight-row
+        >
           <template slot-scope="{ row, index }" slot="purchaseNum">
-            <InputNumber :min="1" :precision="2" :active-change="false" :disabled="form.spzt == '2'" v-model="tableData[index].purchaseNum"
-              placeholder="请输入" style="width: 95%" />
+            <InputNumber
+              :min="1"
+              :precision="2"
+              :active-change="false"
+              :disabled="form.spzt == '2'"
+              v-model="tableData[index].purchaseNum"
+              placeholder="请输入"
+              style="width: 95%"
+            />
           </template>
           <template slot-scope="{ row, index }" slot="price">
-            <InputNumber :min="1" :precision="3" :active-change="false" :disabled="form.spzt == '2' || form.spzt == '3'"
-              v-model="tableData[index].price" placeholder="请输入" style="width: 95%" />
+            <InputNumber
+              :min="1"
+              :precision="3"
+              :active-change="false"
+              :disabled="form.spzt == '2' || form.spzt == '3'"
+              v-model="tableData[index].price"
+              placeholder="请输入"
+              style="width: 95%"
+            />
           </template>
           <template slot-scope="{ row, index }" slot="totalPrice">
-            <div>{{ (tableData[index].price * tableData[index].purchaseNum).toFixed(3) }}</div>
+            <div>
+              {{
+                (tableData[index].price * tableData[index].purchaseNum).toFixed(
+                  3
+                )
+              }}
+            </div>
           </template>
           <template slot-scope="{ row, index }" slot="plannedArrivalTime">
-            <DatePicker :disabled="form.spzt == '2' || form.spzt == '3'" :transfer="true" format="yyyy-MM-dd HH:mm:ss"
-              type="datetime" :value="tableData[index].plannedArrivalTime"
-              @on-change="tableData[index].plannedArrivalTime=$event" placeholder="请选择" style="width: 95%"></DatePicker>
+            <DatePicker
+              :disabled="form.spzt == '2' || form.spzt == '3'"
+              :transfer="true"
+              format="yyyy-MM-dd HH:mm:ss"
+              type="datetime"
+              :value="tableData[index].plannedArrivalTime"
+              @on-change="tableData[index].plannedArrivalTime = $event"
+              placeholder="请选择"
+              style="width: 95%"
+            ></DatePicker>
           </template>
           <template slot-scope="{ row, index }" slot="isNumControl">
             <RadioGroup v-model="tableData[index].isNumControl">
-              <Radio :label="0" :disabled="form.spzt == '2' || form.spzt == '3'">
+              <Radio
+                :label="0"
+                :disabled="form.spzt == '2' || form.spzt == '3'"
+              >
                 <span>是</span>
               </Radio>
-              <Radio :label="1" :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="0" :disabled="form.spzt == '2' || form.spzt == '3'">
+              <Radio
+                :label="0"
+                :disabled="form.spzt == '2' || form.spzt == '3'"
+              >
                 <span>是</span>
               </Radio>
-              <Radio :label="1" :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="remark">
-            <Input :disabled="form.spzt != '1'" :maxlength="200" v-model="tableData[index].remark" placeholder="请输入"
-              style="width: 95%" />
+            <Input
+              :disabled="form.spzt != '1'"
+              :maxlength="200"
+              v-model="tableData[index].remark"
+              placeholder="请输入"
+              style="width: 95%"
+            />
           </template>
           <template slot-scope="{ row, index }" slot="cz">
             <div>
-              <a href="javascript:;" v-if="form.spzt != '2'" @click="deleteRow(index)">删除</a>
+              <a
+                href="javascript:;"
+                v-if="form.spzt != '2'"
+                @click="deleteRow(index)"
+                >删除</a
+              >
             </div>
           </template>
         </Table>
       </Card>
     </div>
     <!-- 计划明细新增 -->
-    <poolMxAdd ref="mxAdd" @plAdd="plAdd" @return="contentShow = true" v-show="!contentShow" />
-    <poolPrint ref="print" @return="() => {printShow = false;}" v-show="printShow" />
+    <poolMxAdd
+      ref="mxAdd"
+      @plAdd="plAdd"
+      @return="contentShow = true"
+      v-show="!contentShow"
+    />
+    <poolPrint
+      ref="print"
+      @return="
+        () => {
+          printShow = false;
+        }
+      "
+      v-show="printShow"
+    />
   </div>
 </template>
 
 <script>
-  import {
-    phoneFun
-  } from "../../../../../config/util";
-  import {
-    addPurchaseOrder,
-    findPurchaseOrder,
-    editPurchaseOrder,
-    getLabelByCode,
-    getProjectList,
-    submitPurchaseOrder,
-    getLabelByCode4Purchase,
-  } from "@/service/getData";
-  import poolMxAdd from "./poolMxAdd";
-  import poolPrint from "./poolPrint";
-  export default {
-    name: "poolAdd",
-    props: ["gysList", "glqyList", "djlxList", "fpttList"],
-    components: {
-      poolMxAdd,
-      poolPrint,
-    },
-    data() {
-      return {
-        submitLoading: false,
-        orderType: "add",
-        orderId: "",
-        lazyTableData: [],
-        uploadHeaders: {
-          token: localStorage.token,
-          userId: localStorage.user_id,
-        },
-        gysGo: true,
-        spinShow: false,
-        contentShow: true,
-        printShow: false,
-        requestId: "",
-        form: {
-          dgbh: "", //订购编号
-          bt: "", //标题
-          glqy: "", //关联区域
-          glxm: "", //关联项目
-          cgr: localStorage.user_name, //采购人
-          cgrlxfs: "", //采购人联系方式
-          xdrq: "", //下单日期
-          jhsj: "", //交货时间
-          jhdd: "", //交货地点
-          shr: "", //收货人
-          shrlxfs: "", //收货人联系方式
-          djlx: "", //单据类型
-          gys: "", //供应商
-          gysmc: "", //供应商名称
-          gffzr: "", //供方负责人
-          gyslxdh: "", //供应商联系电话
-          totalPrice: 0, //总价
-          sm: "", //说明
-          spzt: 1, //审批状态
-          sptgsj: "", //审批通过时间
-          ddzt: "", //订单状态
-          glsgjh: "", //关联申购计划
-          fptt: "", //发票抬头
-          filesList: [],
-        },
-        jhsjOptions: {
-          disabledDate: (date) => {
-            return date && date.valueOf() < new Date(this.form.xdrq);
-          },
+import { phoneFun } from "../../../../../config/util";
+import {
+  addPurchaseOrder,
+  findPurchaseOrder,
+  editPurchaseOrder,
+  getLabelByCode,
+  getProjectList,
+  submitPurchaseOrder,
+  getLabelByCode4Purchase,
+} from "@/service/getData";
+import poolMxAdd from "./poolMxAdd";
+import poolPrint from "./poolPrint";
+export default {
+  name: "poolAdd",
+  props: ["gysList", "glqyList", "djlxList", "fpttList"],
+  components: {
+    poolMxAdd,
+    poolPrint,
+  },
+  data() {
+    return {
+      submitLoading: false,
+      orderType: "add",
+      orderId: "",
+      lazyTableData: [],
+      uploadHeaders: {
+        token: localStorage.token,
+        userId: localStorage.user_id,
+      },
+      gysGo: true,
+      spinShow: false,
+      contentShow: true,
+      printShow: false,
+      requestId: "",
+      form: {
+        dgbh: "", //订购编号
+        bt: "", //标题
+        glqy: "", //关联区域
+        glxm: "", //关联项目
+        cgr: localStorage.user_name, //采购人
+        cgrlxfs: "", //采购人联系方式
+        xdrq: "", //下单日期
+        jhsj: "", //交货时间
+        jhdd: "", //交货地点
+        shr: "", //收货人
+        shrlxfs: "", //收货人联系方式
+        djlx: "", //单据类型
+        gys: "", //供应商
+        gysmc: "", //供应商名称
+        gffzr: "", //供方负责人
+        gyslxdh: "", //供应商联系电话
+        totalPrice: 0, //总价
+        sm: "", //说明
+        spzt: 1, //审批状态
+        sptgsj: "", //审批通过时间
+        ddzt: "", //订单状态
+        glsgjh: "", //关联申购计划
+        fptt: "", //发票抬头
+        filesList: [],
+      },
+      jhsjOptions: {
+        disabledDate: (date) => {
+          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;
-          },
+      },
+      xdrqOption: {
+        disabledDate: (date) => {
+          let nDate = new Date();
+          let dn = +new Date(
+            `${nDate.getFullYear()}-${nDate.getMonth() + 1}-${nDate.getDate()}`
+          );
+          return date.valueOf() < dn;
         },
-        glxmList: [],
-        cgrList: [{
+      },
+      glxmList: [],
+      cgrList: [
+        {
           label: "test",
-          value: 1
-        }],
-        // fpttList: [],
-        // djlxList: [],
-        gffzrList: [{
+          value: 1,
+        },
+      ],
+      // fpttList: [],
+      // djlxList: [],
+      gffzrList: [
+        {
           label: "test",
-          value: 1
-        }],
-        uploading: false,
-        // 批量设置
-        plszShow: false,
-        plrkck: "",
-        pldhsj: "",
-        // table
-        tableColumn: [{
-            title: "申购计划",
-            key: "applyRuleCode",
-            tooltip: true,
-            width: 100,
+          value: 1,
+        },
+      ],
+      uploading: false,
+      // 批量设置
+      plszShow: false,
+      plrkck: "",
+      pldhsj: "",
+      // table
+      tableColumn: [
+        {
+          title: "申购计划",
+          slot: "applyRuleCode",
+          tooltip: true,
+          width: 100,
           resizable: true,
-          },
-          {
-            title: "物料编码",
-            key: "code",
-            tooltip: true,
-            width: 100,
-            resizable: true,
-          },
-          {
-            title: "物料分类",
-            key: "firstClassName",
-            tooltip: true,
-            width: 100,
-            resizable: true,
-          },
-          {
-            title: "物料名称",
-            key: "materialName",
-            tooltip: true,
-            width: 100,
-            resizable: true,
-          },
-          // {
-          //   title: "品牌",
-          //   key: "brandName",
-          //   tooltip: true,
-          //   width: 100
-          // },
-          {
-            title: "规格型号",
-            key: "specs",
-            tooltip: true,
-            width: 100,
-            resizable: true,
-          },
-          {
-            title: "单位",
-            key: "unit",
-            tooltip: true,
-            width: 100,
-            resizable: true,
-          },
-          {
-            title: "计划数量",
-            key: "amount",
-            tooltip: true,
-            width: 100,
-            resizable: true,
-          },
-          {
-            title: "已下订数量",
-            key: "billedAmount",
-            tooltip: true,
-            width: 100,
-            resizable: true,
-          },
-          {
-            title: "累计入库数量",
-            key: "warehousedNum",
-            tooltip: true,
-            width: 120,
-            resizable: true,
-          },
-          {
-            title: "待采购数量",
-            key: "applySurplusNum",
-            tooltip: true,
-            width: 120,
-            resizable: true,
-          },
-          {
-            title: "采购数量",
-            slot: "purchaseNum",
-            tooltip: true,
-            width: 100,
-            resizable: true,
-          },
-          {
-            title: "单价(元)",
-            slot: "price",
-            tooltip: true,
-            width: 100,
-            resizable: true,
-          },
-          {
-            title: "总价(元)",
-            slot: "totalPrice",
-            tooltip: true,
-            width: 100,
-            resizable: true,
-          },
-          {
-            title: "入库仓库",
-            key: "storehouseName",
-            tooltip: true,
-            width: 130,
-            resizable: true,
-          },
-          {
-            title: "计划到货时间",
-            slot: "plannedArrivalTime",
-            tooltip: true,
-            width: 150,
-            resizable: true,
-          },
-          {
-            title: "数量管控",
-            slot: "isNumControl",
-            tooltip: true,
-            width: 100,
-            resizable: true,
-          },
-          {
-            title: "时间管控",
-            slot: "isTimeControl",
-            tooltip: true,
-            width: 100,
-            resizable: true,
-          },
-          {
-            title: "备注",
-            slot: "remark",
-            tooltip: true,
-            width: 100,
-            resizable: true,
-          },
-          {
-            title: "操作",
-            slot: "cz",
-            tooltip: true,
-            width: 60,
-            resizable: true,
-          },
-        ],
-        tableData: [],
-        tableSelect: [],
-        deleteIds: [],
-        tableLoading: false,
-      };
+        },
+        {
+          title: "物料编码",
+          key: "code",
+          tooltip: true,
+          width: 140,
+          resizable: true,
+        },
+        {
+          title: "物料分类",
+          key: "firstClassName",
+          tooltip: true,
+          width: 120,
+          resizable: true,
+        },
+        {
+          title: "物料名称",
+          key: "materialName",
+          tooltip: true,
+          width: 150,
+          resizable: true,
+        },
+        {
+          title: "规格型号",
+          key: "specs",
+          tooltip: true,
+          width: 100,
+          resizable: true,
+        },
+        {
+          title: "单位",
+          key: "unit",
+          tooltip: true,
+          width: 80,
+          resizable: true,
+        },
+        {
+          title: "采购数量",
+          slot: "purchaseNum",
+          tooltip: true,
+          width: 100,
+          resizable: true,
+        },
+        {
+          title: "单价(元)",
+          slot: "price",
+          tooltip: true,
+          width: 100,
+          resizable: true,
+        },
+        {
+          title: "总价(元)",
+          slot: "totalPrice",
+          tooltip: true,
+          width: 100,
+          resizable: true,
+        },
+        {
+          title: "入库仓库",
+          key: "storehouseName",
+          tooltip: true,
+          width: 130,
+          resizable: true,
+        },
+        {
+          title: "计划到货时间",
+          slot: "plannedArrivalTime",
+          tooltip: true,
+          width: 150,
+          resizable: true,
+        },
+        {
+          title: "备注",
+          slot: "remark",
+          tooltip: true,
+          width: 100,
+          resizable: true,
+        },
+        {
+          title: "计划数量",
+          key: "amount",
+          tooltip: true,
+          width: 100,
+          resizable: true,
+        },
+        {
+          title: "已下订数量",
+          key: "billedAmount",
+          tooltip: true,
+          width: 100,
+          resizable: true,
+        },
+        {
+          title: "累计入库数量",
+          key: "warehousedNum",
+          tooltip: true,
+          width: 120,
+          resizable: true,
+        },
+        {
+          title: "待采购数量",
+          key: "applySurplusNum",
+          tooltip: true,
+          width: 120,
+          resizable: true,
+        },
+
+        {
+          title: "数量管控",
+          slot: "isNumControl",
+          tooltip: true,
+          width: 120,
+          resizable: true,
+        },
+        {
+          title: "时间管控",
+          slot: "isTimeControl",
+          tooltip: true,
+          width: 120,
+          resizable: true,
+        },
+        {
+          title: "状态",
+          slot: "isCancel",
+          tooltip: true,
+          width: 100,
+          resizable: true,
+        },
+        {
+          title: "操作",
+          slot: "cz",
+          tooltip: true,
+          width: 60,
+          resizable: true,
+        },
+      ],
+      tableData: [],
+      tableSelect: [],
+      deleteIds: [],
+      tableLoading: false,
+    };
+  },
+  created() {},
+  methods: {
+    //批量设置弹窗
+    plszOpen() {
+      this.plszShow = true;
     },
-    created() {},
-    methods: {
-      //批量设置弹窗
-      plszOpen() {
-        this.plszShow = true;
-      },
-      plszOk() {},
-      plszCancel() {},
-      //表单上传
-      beforeUpload() {},
-      upFilesLoading() {
-        this.uploading = true;
-      },
-      uploadFilesSuccess(response, file, fileList) {
-        this.uploading = false;
-        this.form.filesList.push({
-          fileName: response.data.fileName,
-          filePath: response.data.filePath,
-          fileDetailType: "",
-        });
-      },
-      getData(areaId, projectId, lazyTableData) {
-        this.lazyTableData = lazyTableData;
-        this.form.glqy =
-          Number(areaId) +
+    plszOk() {},
+    plszCancel() {},
+    //表单上传
+    beforeUpload() {},
+    upFilesLoading() {
+      this.uploading = true;
+    },
+    uploadFilesSuccess(response, file, fileList) {
+      this.uploading = false;
+      this.form.filesList.push({
+        fileName: response.data.fileName,
+        filePath: response.data.filePath,
+        fileDetailType: "",
+      });
+    },
+    getData(areaId, projectId, lazyTableData) {
+      this.lazyTableData = lazyTableData;
+      this.form.glqy =
+        Number(areaId) +
+        "," +
+        this.glqyList.filter((a) => a.areaId == areaId)[0].areaName;
+      let postData = {
+        areaId: areaId,
+        userId: localStorage.user_id,
+      };
+      getProjectList(postData).then((res) => {
+        this.glxmList = res.items;
+        this.form.glxm =
+          projectId +
           "," +
-          this.glqyList.filter((a) => a.areaId == areaId)[0].areaName;
-        let postData = {
-          areaId: areaId,
-          userId: localStorage.user_id,
-        };
-        getProjectList(postData).then((res) => {
-          this.glxmList = res.items;
-          this.form.glxm =
-            projectId +
-            "," +
-            res.items.filter((a) => a.projectId == projectId)[0].projectName;
-        });
-      },
-      //供应商切换
-      gysChange(val) {
-        this.gysGo = true;
-        let gys = this.gysList.filter((a) => a.gpId == val);
-        if (gys.length > 0) {
-          let sup = gys[0];
-          if (!sup.gpcName || !sup.gpcPhone) {
-            this.$Message.error(
-              "该供应商用户信息不完整,请完善该供应商信息再选择此供应商!"
-            );
-            this.gysGo = false;
-            this.form.gffzr = "";
-            this.form.gyslxdh = "";
-            return false;
-          }
-          this.form.gffzr = sup.gpcName;
-          this.form.gyslxdh = sup.gpcPhone;
-          // bank开户行   unionpay银行账号
-        }
-      },
-      //所属区域切换
-      ssqyChange() {
-        if (!this.form.glqy) {
-          return false;
-        }
-        let postData = {
-          areaId: this.form.glqy.split(",")[0],
-          userId: localStorage.user_id,
-        };
-        getProjectList(postData).then((res) => {
-          this.form.glxm = "";
-          this.glxmList = res.items;
-        });
-      },
-      //编辑采购订单
-      editCgdd() {
-        let mustArr = [
-          "glqy",
-          "glxm",
-          "xdrq",
-          "jhsj",
-          "cgrlxfs",
-          "shr",
-          "shrlxfs",
-          "gys",
-          "fptt",
-        ];
-        for (let i in mustArr) {
-          if (mustArr[i] == "cgrlxfs") {
-            if (!phoneFun(this.form[mustArr[i]])) {
-              this.$Message.error("请填写正确的采购人联系方式!");
-              return false;
-            }
-          }
-          if (mustArr[i] == "shrlxfs") {
-            if (!phoneFun(this.form[mustArr[i]])) {
-              this.$Message.error("请填写正确的收货人联系方式!");
-              return false;
-            }
-          }
-          if (!this.form[mustArr[i]]) {
-            this.$Message.error("请将信息填写完整!");
-            return false;
-          }
-          if (this.form[mustArr[i]] == "" || this.form[mustArr[i]].length == 0) {
-            this.$Message.error("请将信息填写完整!");
-            return false;
-          }
-        }
-        if (!this.gysGo) {
+          res.items.filter((a) => a.projectId == projectId)[0].projectName;
+      });
+    },
+    //供应商切换
+    gysChange(val) {
+      this.gysGo = true;
+      let gys = this.gysList.filter((a) => a.gpId == val);
+      if (gys.length > 0) {
+        let sup = gys[0];
+        if (!sup.gpcName || !sup.gpcPhone) {
           this.$Message.error(
-            "供应商信息不完整,请完善供应商信息或选择其他供应商!"
+            "该供应商用户信息不完整,请完善该供应商信息再选择此供应商!"
           );
+          this.gysGo = false;
+          this.form.gffzr = "";
+          this.form.gyslxdh = "";
           return false;
         }
-        for (let i in this.tableData) {
-          if (this.tableData[i].purchaseNum <= 0) {
-            this.$Message.error("计划明细申购数量不能小于或等于0!");
+        this.form.gffzr = sup.gpcName;
+        this.form.gyslxdh = sup.gpcPhone;
+        // bank开户行   unionpay银行账号
+      }
+    },
+    //所属区域切换
+    ssqyChange() {
+      if (!this.form.glqy) {
+        return false;
+      }
+      let postData = {
+        areaId: this.form.glqy.split(",")[0],
+        userId: localStorage.user_id,
+      };
+      getProjectList(postData).then((res) => {
+        this.form.glxm = "";
+        this.glxmList = res.items;
+      });
+    },
+    //编辑采购订单
+    editCgdd() {
+      let mustArr = [
+        "glqy",
+        "glxm",
+        "xdrq",
+        "jhsj",
+        "cgrlxfs",
+        "shr",
+        "shrlxfs",
+        "gys",
+        "fptt",
+      ];
+      for (let i in mustArr) {
+        if (mustArr[i] == "cgrlxfs") {
+          if (!phoneFun(this.form[mustArr[i]])) {
+            this.$Message.error("请填写正确的采购人联系方式!");
             return false;
           }
-          if (this.tableData[i].price <= 0) {
-            this.$Message.error("计划明细单价不能小于或等于0!");
+        }
+        if (mustArr[i] == "shrlxfs") {
+          if (!phoneFun(this.form[mustArr[i]])) {
+            this.$Message.error("请填写正确的收货人联系方式!");
             return false;
           }
         }
-        for (let i in this.tableData) {
-          this.tableData[i].price = Number(this.tableData[i].price);
-          this.tableData[i].purchaseNum = Number(this.tableData[i].purchaseNum);
-          this.tableData[i].totalPrice = Number(
-            this.tableData[i].price * this.tableData[i].purchaseNum
-          );
+        if (!this.form[mustArr[i]]) {
+          this.$Message.error("请将信息填写完整!");
+          return false;
         }
-        let gpName = this.gysList.filter((a) => a.gpId == this.form.gys);
-        return new Promise((resolve, reject) => {
-          let postData = {
-            areaId: this.form.glqy.split(",")[0],
-            areaName: this.form.glqy.split(",")[1],
-            projectId: this.form.glxm.split(",")[0],
-            projectName: this.form.glxm.split(",")[1],
-            purchaserId: localStorage.user_id,
-            purchaserName: localStorage.user_name,
-            purchaserTel: this.form.cgrlxfs,
-            receivedName: this.form.shr,
-            receivedTel: this.form.shrlxfs,
-            orderTime: this.form.xdrq,
-            deliveryTime: this.form.jhsj,
-            deliveryPlace: this.form.jhdd,
-            // type: this.form.djlx,
-            instruction: this.form.sm,
-            attachmentList: this.form.filesList,
-            invoiceTitleCode: this.form.fptt,
-            gpId: this.form.gys, //供应商ID
-            gpNmae: gpName.length ? gpName[0].gpName : "", //供应商Name
-            orderId: this.orderId,
-            deleteId: this.deleteIds.join(","),
-            attachmentList: this.form.filesList,
-            detailList: this.tableData,
-          };
-          this.spinShow = true;
-          this.tableLoading = true;
-          editPurchaseOrder(postData).then((res) => {
-            this.spinShow = false;
-            this.tableLoading = false;
-            if (res.status == 200) {
-              this.$Message.success("编辑采购订单成功!");
-              this.getCgddXq(this.orderId);
-              resolve();
-            } else {
-              this.$Message.error(res.message);
-              reject();
-            }
-          });
-        });
-      },
-      //审批记录跳转
-      toSpjl() {
-        let link =
-          `http://oa.kingser.com:88/westvalley/PSWorkflow/PSWorkflowDecode.jsp?loginmsg=bG9naW5pZD1wbXMmdXNlcnBhc3N3b3JkPVBBYjEyMzQ1Nio=&requestid=${this.requestId}`;
-        window.open(link);
-      },
-      //提交订单
-      submitCgdd() {
-        if (this.submitLoading) {
+        if (this.form[mustArr[i]] == "" || this.form[mustArr[i]].length == 0) {
+          this.$Message.error("请将信息填写完整!");
           return false;
         }
-        let cango = true;
-        for (let i in this.tableData) {
-          if (this.tableData[i].purchaseNum <= 0) {
-            this.$Message.error("计划明细申购数量不能小于或等于0!");
-            cango = false;
-            return false;
-          }
-          if (this.tableData[i].price <= 0) {
-            this.$Message.error("计划明细单价不能小于或等于0!");
-            cango = false;
-            return false;
-          }
+      }
+      if (!this.gysGo) {
+        this.$Message.error(
+          "供应商信息不完整,请完善供应商信息或选择其他供应商!"
+        );
+        return false;
+      }
+      for (let i in this.tableData) {
+        if (this.tableData[i].purchaseNum <= 0) {
+          this.$Message.error("计划明细申购数量不能小于或等于0!");
+          return false;
         }
-        if (!cango) {
+        if (this.tableData[i].price <= 0) {
+          this.$Message.error("计划明细单价不能小于或等于0!");
           return false;
         }
-        this.submitLoading = true;
-        this.editCgdd()
-          .then(() => {
-            let gpName = this.gysList.filter((a) => a.gpId == this.form.gys);
-            let postData = {
-              orderId: this.orderId,
-            };
-            submitPurchaseOrder(postData).then((res) => {
-              this.submitLoading = false;
-              if (res.status == 200) {
-                this.$Message.success("提交采购订单成功!");
-                this.getCgddXq(this.orderId);
-              } else {
-                this.$Message.error(res.message);
-              }
-            });
-          })
-          .catch(() => {
-            this.submitLoading = false;
-          });
-      },
-      //获取采购订单详情
-      getCgddXq(id) {
-        this.orderId = id;
+      }
+      for (let i in this.tableData) {
+        this.tableData[i].price = Number(this.tableData[i].price);
+        this.tableData[i].purchaseNum = Number(this.tableData[i].purchaseNum);
+        this.tableData[i].totalPrice = Number(
+          this.tableData[i].price * this.tableData[i].purchaseNum
+        );
+      }
+      let gpName = this.gysList.filter((a) => a.gpId == this.form.gys);
+      return new Promise((resolve, reject) => {
         let postData = {
-          orderId: id,
+          areaId: this.form.glqy.split(",")[0],
+          areaName: this.form.glqy.split(",")[1],
+          projectId: this.form.glxm.split(",")[0],
+          projectName: this.form.glxm.split(",")[1],
+          purchaserId: localStorage.user_id,
+          purchaserName: localStorage.user_name,
+          purchaserTel: this.form.cgrlxfs,
+          receivedName: this.form.shr,
+          receivedTel: this.form.shrlxfs,
+          orderTime: this.form.xdrq,
+          deliveryTime: this.form.jhsj,
+          deliveryPlace: this.form.jhdd,
+          // type: this.form.djlx,
+          instruction: this.form.sm,
+          attachmentList: this.form.filesList,
+          invoiceTitleCode: this.form.fptt,
+          gpId: this.form.gys, //供应商ID
+          gpNmae: gpName.length ? gpName[0].gpName : "", //供应商Name
+          orderId: this.orderId,
+          deleteId: this.deleteIds.join(","),
+          attachmentList: this.form.filesList,
+          detailList: this.tableData,
         };
         this.spinShow = true;
-        findPurchaseOrder(postData).then((res) => {
+        this.tableLoading = true;
+        editPurchaseOrder(postData).then((res) => {
           this.spinShow = false;
+          this.tableLoading = false;
           if (res.status == 200) {
-            let data = res.data;
-            let tableArr = [];
-            this.form.dgbh = data.orderCode;
-            this.form.bt = data.title;
-            this.form.glqy = data.areaId + "," + data.areaName;
-            this.form.glxm = data.projectId + "," + data.projectName;
-            // this.form.djlx = data.type;
-            this.form.cgr = data.purchaserName;
-            this.form.cgrlxfs = data.purchaserTel;
-            this.form.xdrq = data.orderTime;
-            this.form.jhsj = data.deliveryTime;
-            this.form.shr = data.receivedName;
-            this.form.shrlxfs = data.receivedTel;
-            this.form.gys = data.gpId;
-            this.form.gffzr = data.gpcName;
-            this.form.gyslxdh = data.gpcPhone;
-            this.form.spzt = data.approvalState;
-            this.form.sm = data.instruction;
-            this.form.ddzt = data.orderState;
-            this.form.gysmc = data.gpName;
-            this.form.jhdd = data.deliveryPlace;
-            this.form.fptt = data.invoiceTitleCode;
-            this.requestId = data.requestId;
-            this.orderType = "edit";
-            for (let item in data.detailList) {
-              tableArr.push({
-                applyDetailId: data.detailList[item].applyDetailId,
-                applyRuleId: data.detailList[item].applyRuleId,
-                applyRuleCode: data.detailList[item].applyRuleCode,
-                code: data.detailList[item].detailList[0].code,
-                firstClassName: data.detailList[item].detailList[0].firstClassName,
-                materialName: data.detailList[item].detailList[0].materialName,
-                brandName: data.detailList[item].detailList[0].brandName,
-                specs: data.detailList[item].detailList[0].specs,
-                unit: data.detailList[item].detailList[0].unit,
-                amount: Number(data.detailList[item].detailList[0].amount),
-                billedAmount: Number(
-                  data.detailList[item].detailList[0].billedAmount
-                ).toFixed(3),
-                inventory: Number(
-                  data.detailList[item].detailList[0].inventory
-                ).toFixed(3),
-                storehouseName: data.detailList[item].detailList[0].storehouseName,
-                price: data.detailList[item].price,
-                totalPrice: 0,
-                purchaseNum: data.detailList[item].purchaseNum,
-                plannedArrivalTime: data.detailList[item].plannedArrivalTime,
-                isNumControl: data.detailList[item].isNumControl,
-                isTimeControl: data.detailList[item].isTimeControl,
-                applySurplusNum: Number(
-                  data.detailList[item].applySurplusNum
-                ).toFixed(3),
-                warehousedNum: Number(
-                  data.detailList[item].warehousedNum
-                ).toFixed(3),
-                remark: data.detailList[item].remark,
-              });
-              console.log(tableArr);
-              this.tableData = tableArr;
-            }
-            let postData = {
-              areaId: data.areaId,
-              userId: localStorage.user_id,
-            };
-            getProjectList(postData).then((res) => {
-              this.glxmList = res.items;
-            });
+            this.$Message.success("编辑采购订单成功!");
+            this.getCgddXq(this.orderId);
+            resolve();
           } else {
             this.$Message.error(res.message);
+            reject();
           }
         });
-      },
-      //新增明细
-      mxAddShow() {
-        this.contentShow = false;
-        debugger
-        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;
+      });
+    },
+    //审批记录跳转
+    toSpjl() {
+      let link = `http://oa.kingser.com:88/westvalley/PSWorkflow/PSWorkflowDecode.jsp?loginmsg=bG9naW5pZD1wbXMmdXNlcnBhc3N3b3JkPVBBYjEyMzQ1Nio=&requestid=${this.requestId}`;
+      window.open(link);
+    },
+    //提交订单
+    submitCgdd() {
+      if (this.submitLoading) {
+        return false;
+      }
+      let cango = true;
+      for (let i in this.tableData) {
+        if (this.tableData[i].purchaseNum <= 0) {
+          this.$Message.error("计划明细申购数量不能小于或等于0!");
+          cango = false;
+          return 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;
-        this.$refs.mxAdd.areaId = this.form.glqy;
-        this.$refs.mxAdd.projectId = this.form.glxm;
-        this.$refs.mxAdd.getTableData();
-        this.$refs.mxAdd.getCk();
-      },
-      //列表方法
-      getTableData() {
-        this.spinShow = false;
-      },
-      //删除采购明细
-      deleteRow(index) {
-        if (this.deleteIds.indexOf(this.tableData[index].applyDetailId) == -1) {
-          this.deleteIds.push(this.tableData[index].applyDetailId);
+        if (this.tableData[i].price <= 0) {
+          this.$Message.error("计划明细单价不能小于或等于0!");
+          cango = false;
+          return false;
         }
-        this.tableData.splice(index, 1);
-      },
-      printRow() {
-        this.printShow = true;
-        this.$refs.print.getData(this.orderId);
-      },
-      //批量添加
-      plAdd(list) {
-        console.log(list);
-        for (let item in list) {
-          if (this.deleteIds.indexOf(list[item].applyDetailId) != -1) {
-            this.deleteIds.splice(
-              this.deleteIds.indexOf(list[item].applyDetailId),
-              1
-            );
-          }
-          if (
-            this.tableData.filter(
-              (a) => a.applyDetailId == list[item].applyDetailId
-            ).length > 0
-          ) {} else {
-            this.tableData.push(list[item]);
+      }
+      if (!cango) {
+        return false;
+      }
+      this.submitLoading = true;
+      this.editCgdd()
+        .then(() => {
+          let gpName = this.gysList.filter((a) => a.gpId == this.form.gys);
+          let postData = {
+            orderId: this.orderId,
+          };
+          submitPurchaseOrder(postData).then((res) => {
+            this.submitLoading = false;
+            if (res.status == 200) {
+              this.$Message.success("提交采购订单成功!");
+              this.getCgddXq(this.orderId);
+            } else {
+              this.$Message.error(res.message);
+            }
+          });
+        })
+        .catch(() => {
+          this.submitLoading = false;
+        });
+    },
+    //获取采购订单详情
+    getCgddXq(id) {
+      this.orderId = id;
+      let postData = {
+        orderId: id,
+      };
+      this.spinShow = true;
+      findPurchaseOrder(postData).then((res) => {
+        this.spinShow = false;
+        if (res.status == 200) {
+          let data = res.data;
+          let tableArr = [];
+          this.form.dgbh = data.orderCode;
+          this.form.bt = data.title;
+          this.form.glqy = data.areaId + "," + data.areaName;
+          this.form.glxm = data.projectId + "," + data.projectName;
+          // this.form.djlx = data.type;
+          this.form.cgr = data.purchaserName;
+          this.form.cgrlxfs = data.purchaserTel;
+          this.form.xdrq = data.orderTime;
+          this.form.jhsj = data.deliveryTime;
+          this.form.shr = data.receivedName;
+          this.form.shrlxfs = data.receivedTel;
+          this.form.gys = data.gpId;
+          this.form.gffzr = data.gpcName;
+          this.form.gyslxdh = data.gpcPhone;
+          this.form.spzt = data.approvalState;
+          this.form.sm = data.instruction;
+          this.form.ddzt = data.orderState;
+          this.form.gysmc = data.gpName;
+          this.form.jhdd = data.deliveryPlace;
+          this.form.fptt = data.invoiceTitleCode;
+          this.requestId = data.requestId;
+          this.orderType = "edit";
+          for (let item in data.detailList) {
+            tableArr.push({
+              applyDetailId: data.detailList[item].applyDetailId,
+              applyRuleId: data.detailList[item].applyRuleId,
+              applyRuleCode: data.detailList[item].applyRuleCode,
+              code: data.detailList[item].detailList[0].code,
+              firstClassName:
+                data.detailList[item].detailList[0].firstClassName,
+              materialName: data.detailList[item].detailList[0].materialName,
+              brandName: data.detailList[item].detailList[0].brandName,
+              specs: data.detailList[item].detailList[0].specs,
+              unit: data.detailList[item].detailList[0].unit,
+              amount: Number(data.detailList[item].detailList[0].amount),
+              billedAmount: Number(
+                data.detailList[item].detailList[0].billedAmount
+              ).toFixed(3),
+              inventory: Number(
+                data.detailList[item].detailList[0].inventory
+              ).toFixed(3),
+              storehouseName:
+                data.detailList[item].detailList[0].storehouseName,
+              price: data.detailList[item].price,
+              totalPrice: 0,
+              purchaseNum: data.detailList[item].purchaseNum,
+              plannedArrivalTime: data.detailList[item].plannedArrivalTime,
+              isNumControl: data.detailList[item].isNumControl,
+              isTimeControl: data.detailList[item].isTimeControl,
+              applySurplusNum: Number(
+                data.detailList[item].applySurplusNum
+              ).toFixed(3),
+              warehousedNum: Number(
+                data.detailList[item].warehousedNum
+              ).toFixed(3),
+              remark: data.detailList[item].remark,
+            });
+            console.log(tableArr);
+            this.tableData = tableArr;
           }
+          let postData = {
+            areaId: data.areaId,
+            userId: localStorage.user_id,
+          };
+          getProjectList(postData).then((res) => {
+            this.glxmList = res.items;
+          });
+        } else {
+          this.$Message.error(res.message);
         }
-      },
-      tableOnSelect(selection, row) {},
-      //取消、返回
-      cancel() {
-        this.submitLoading = false;
-        this.form.dgbh = "";
-        this.form.bt = "";
-        this.form.glqy = "";
-        this.form.glxm = "";
-        this.form.djlx = "";
-        this.form.cgr = "";
-        this.form.cgrlxfs = "";
-        this.form.xdrq = "";
-        this.form.jhsj = "";
-        this.form.shr = "";
-        this.form.shrlxfs = "";
-        this.form.gys = "";
-        this.form.gffzr = "";
-        this.form.gyslxdh = "";
-        this.form.sm = "";
-        this.form.filesList = [];
-        this.form.spzt = 1;
-        this.tableData = [];
-        this.deleteIds = [];
-        this.spinShow = false;
-        this.orderType = "add";
-        this.$emit("return");
-      },
+      });
     },
-    watch: {
-      tableData: {
-        handler(val, name) {
-          let total = 0;
-          let arr = [];
-          let str = "";
-          for (let item in val) {
-            total += val[item].price * val[item].purchaseNum;
-            arr.push(val[item].applyRuleCode);
-          }
-          let set = new Set(arr);
-          this.form.totalPrice = total.toFixed(3);
-          this.form.glsgjh = [...set].join(",");
-        },
-        deep: true,
+    //新增明细
+    mxAddShow() {
+      this.contentShow = false;
+      debugger;
+      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;
+      this.$refs.mxAdd.areaId = this.form.glqy;
+      this.$refs.mxAdd.projectId = this.form.glxm;
+      this.$refs.mxAdd.getTableData();
+      this.$refs.mxAdd.getCk();
+    },
+    //列表方法
+    getTableData() {
+      this.spinShow = false;
+    },
+    //删除采购明细
+    deleteRow(index) {
+      if (this.deleteIds.indexOf(this.tableData[index].applyDetailId) == -1) {
+        this.deleteIds.push(this.tableData[index].applyDetailId);
+      }
+      this.tableData.splice(index, 1);
+    },
+    printRow() {
+      this.printShow = true;
+      this.$refs.print.getData(this.orderId);
+    },
+    //批量添加
+    plAdd(list) {
+      console.log(list);
+      for (let item in list) {
+        if (this.deleteIds.indexOf(list[item].applyDetailId) != -1) {
+          this.deleteIds.splice(
+            this.deleteIds.indexOf(list[item].applyDetailId),
+            1
+          );
+        }
+        if (
+          this.tableData.filter(
+            (a) => a.applyDetailId == list[item].applyDetailId
+          ).length > 0
+        ) {
+        } else {
+          this.tableData.push(list[item]);
+        }
+      }
+    },
+    tableOnSelect(selection, row) {},
+    //取消、返回
+    cancel() {
+      this.submitLoading = false;
+      this.form.dgbh = "";
+      this.form.bt = "";
+      this.form.glqy = "";
+      this.form.glxm = "";
+      this.form.djlx = "";
+      this.form.cgr = "";
+      this.form.cgrlxfs = "";
+      this.form.xdrq = "";
+      this.form.jhsj = "";
+      this.form.shr = "";
+      this.form.shrlxfs = "";
+      this.form.gys = "";
+      this.form.gffzr = "";
+      this.form.gyslxdh = "";
+      this.form.sm = "";
+      this.form.filesList = [];
+      this.form.spzt = 1;
+      this.tableData = [];
+      this.deleteIds = [];
+      this.spinShow = false;
+      this.orderType = "add";
+      this.$emit("return");
+    },
+  },
+  watch: {
+    tableData: {
+      handler(val, name) {
+        let total = 0;
+        let arr = [];
+        let str = "";
+        for (let item in val) {
+          total += val[item].price * val[item].purchaseNum;
+          arr.push(val[item].applyRuleCode);
+        }
+        let set = new Set(arr);
+        this.form.totalPrice = total.toFixed(3);
+        this.form.glsgjh = [...set].join(",");
       },
+      deep: true,
     },
-  };
-
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-  .mustSpan {
-    color: red;
-    margin-left: 2px;
-  }
-
-  button {
-    min-width: 80px;
-  }
+.mustSpan {
+  color: red;
+  margin-left: 2px;
+}
 
-  .uplCont {
-    border-left: 1px solid #e4e4e4;
+button {
+  min-width: 80px;
+}
 
-    .upl {
-      flex: auto;
-      border-right: 1px solid #e4e4e4;
+.uplCont {
+  border-left: 1px solid #e4e4e4;
 
-      &:nth-child(1),
-      &:nth-child(4) {
-        background: #f8f9fb;
-        display: flex;
-        align-items: center;
-        justify-content: center;
-      }
+  .upl {
+    flex: auto;
+    border-right: 1px solid #e4e4e4;
 
-      &:nth-child(5) {
-        display: flex;
-        align-items: center;
-        justify-content: center;
-      }
+    &:nth-child(1),
+    &:nth-child(4) {
+      background: #f8f9fb;
+      display: flex;
+      align-items: center;
+      justify-content: center;
     }
 
-    .uplf {
+    &:nth-child(5) {
       display: flex;
       align-items: center;
       justify-content: center;
-      min-height: 80px;
     }
   }
 
-  .mainCont .tables {
-    min-height: 50px;
-    border-right: 1px solid #e4e4e4;
-    border-bottom: 1px solid #e4e4e4;
+  .uplf {
     display: flex;
     align-items: center;
     justify-content: center;
-    word-break: break-all;
-
-    &:nth-child(2n + 1) {
-      background: #f8f9fb;
-    }
+    min-height: 80px;
   }
+}
 
-  .mainCont {
-    border-left: 1px solid #e4e4e4;
-    border-top: 1px solid #e4e4e4;
-  }
+.mainCont .tables {
+  min-height: 50px;
+  border-right: 1px solid #e4e4e4;
+  border-bottom: 1px solid #e4e4e4;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  word-break: break-all;
 
-  ivu-card-head-inner,
-  .ivu-card-head p {
-    display: inline-block;
-    width: 100%;
-    height: 20px;
-    line-height: 20px;
-    font-size: 14px;
-    color: #17233d;
-    font-weight: 700;
-    overflow: hidden;
-    text-overflow: ellipsis;
-    white-space: nowrap;
-    font-weight: normal;
+  &:nth-child(2n + 1) {
+    background: #f8f9fb;
   }
+}
+
+.mainCont {
+  border-left: 1px solid #e4e4e4;
+  border-top: 1px solid #e4e4e4;
+}
 
+ivu-card-head-inner,
+.ivu-card-head p {
+  display: inline-block;
+  width: 100%;
+  height: 20px;
+  line-height: 20px;
+  font-size: 14px;
+  color: #17233d;
+  font-weight: 700;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  font-weight: normal;
+}
 </style>

+ 1 - 0
src/page/purchase/purchasePool.vue

@@ -427,6 +427,7 @@ export default {
   },
   created() {
     // this.searchForm.applicantName = localStorage.user_name
+    // this.searchForm.purchaserId = localStorage.user_id
     this.getTableData();
     this.getUserAuth();
     getAreaList(localStorage.user_id).then((res) => {