diff --git a/src/main.js b/src/main.js
index 3dfc8b2..329e1dc 100644
--- a/src/main.js
+++ b/src/main.js
@@ -17,6 +17,7 @@ import VueClipboard from 'vue-clipboard2'
 
 import "./assets/icons/iconfont";
 import IconSvg from "./components/common/IconSvg.vue"; // svg组件
+import {parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree} from "@/utils/ruoyi";
 
 import {getUUID} from "@/utils/strUtil";
 import axios from "axios";
@@ -35,7 +36,7 @@ Vue.use(VueClipboard)
 Vue.config.productionTip = false;
 
 Vue.prototype.getUUID = getUUID
-
+Vue.prototype.parseTime = parseTime
 
 let getUrl = "";
 let startApp = function () {
diff --git a/src/utils/ruoyi.js b/src/utils/ruoyi.js
new file mode 100644
index 0000000..b80c9ba
--- /dev/null
+++ b/src/utils/ruoyi.js
@@ -0,0 +1,237 @@
+/**
+ * 通用js方法封装处理
+ * Copyright (c) 2019 ruoyi
+ */
+
+// 日期格式化
+export function parseTime(time, pattern) {
+    if (arguments.length === 0 || !time) {
+        return null
+    }
+    const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
+    let date
+    if (typeof time === 'object') {
+        date = time
+    } else {
+        if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
+            time = parseInt(time)
+        } else if (typeof time === 'string') {
+            time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm), '');
+        }
+        if ((typeof time === 'number') && (time.toString().length === 10)) {
+            time = time * 1000
+        }
+        date = new Date(time)
+    }
+    const formatObj = {
+        y: date.getFullYear(),
+        m: date.getMonth() + 1,
+        d: date.getDate(),
+        h: date.getHours(),
+        i: date.getMinutes(),
+        s: date.getSeconds(),
+        a: date.getDay()
+    }
+    const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
+        let value = formatObj[key]
+        // Note: getDay() returns 0 on Sunday
+        if (key === 'a') {
+            return ['日', '一', '二', '三', '四', '五', '六'][value]
+        }
+        if (result.length > 0 && value < 10) {
+            value = '0' + value
+        }
+        return value || 0
+    })
+    return time_str
+}
+
+// 表单重置
+export function resetForm(refName) {
+    if (this.$refs[refName]) {
+        this.$refs[refName].resetFields();
+    }
+}
+
+// 添加日期范围
+export function addDateRange(params, dateRange, propName) {
+    let search = params;
+    search.params = typeof (search.params) === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {};
+    dateRange = Array.isArray(dateRange) ? dateRange : [];
+    if (typeof (propName) === 'undefined') {
+        search.params['beginTime'] = dateRange[0];
+        search.params['endTime'] = dateRange[1];
+    } else {
+        search.params['begin' + propName] = dateRange[0];
+        search.params['end' + propName] = dateRange[1];
+    }
+    return search;
+}
+
+// 回显数据字典
+export function selectDictLabel(datas, value) {
+    if (value === undefined) {
+        return "";
+    }
+    var actions = [];
+    Object.keys(datas).some((key) => {
+        if (datas[key].value == ('' + value)) {
+            actions.push(datas[key].label);
+            return true;
+        }
+    })
+    if (actions.length === 0) {
+        actions.push(value);
+    }
+    return actions.join('');
+}
+
+// 回显数据字典(字符串数组)
+export function selectDictLabels(datas, value, separator) {
+    if (value === undefined) {
+        return "";
+    }
+    var actions = [];
+    var currentSeparator = undefined === separator ? "," : separator;
+    var temp = value.split(currentSeparator);
+    Object.keys(value.split(currentSeparator)).some((val) => {
+        var match = false;
+        Object.keys(datas).some((key) => {
+            if (datas[key].value == ('' + temp[val])) {
+                actions.push(datas[key].label + currentSeparator);
+                match = true;
+            }
+        })
+        if (!match) {
+            actions.push(temp[val] + currentSeparator);
+        }
+    })
+    return actions.join('').substring(0, actions.join('').length - 1);
+}
+
+// 字符串格式化(%s )
+export function sprintf(str) {
+    var args = arguments, flag = true, i = 1;
+    str = str.replace(/%s/g, function () {
+        var arg = args[i++];
+        if (typeof arg === 'undefined') {
+            flag = false;
+            return '';
+        }
+        return arg;
+    });
+    return flag ? str : '';
+}
+
+// 转换字符串,undefined,null等转化为""
+export function parseStrEmpty(str) {
+    if (!str || str == "undefined" || str == "null") {
+        return "";
+    }
+    return str;
+}
+
+// 数据合并
+export function mergeRecursive(source, target) {
+    for (var p in target) {
+        try {
+            if (target[p].constructor == Object) {
+                source[p] = mergeRecursive(source[p], target[p]);
+            } else {
+                source[p] = target[p];
+            }
+        } catch (e) {
+            source[p] = target[p];
+        }
+    }
+    return source;
+};
+
+/**
+ * 构造树型结构数据
+ * @param {*} data 数据源
+ * @param {*} id id字段 默认 'id'
+ * @param {*} parentId 父节点字段 默认 'parentId'
+ * @param {*} children 孩子节点字段 默认 'children'
+ */
+export function handleTree(data, id, parentId, children) {
+    let config = {
+        id: id || 'id',
+        parentId: parentId || 'parentId',
+        childrenList: children || 'children'
+    };
+
+    var childrenListMap = {};
+    var nodeIds = {};
+    var tree = [];
+
+    for (let d of data) {
+        let parentId = d[config.parentId];
+        if (childrenListMap[parentId] == null) {
+            childrenListMap[parentId] = [];
+        }
+        nodeIds[d[config.id]] = d;
+        childrenListMap[parentId].push(d);
+    }
+
+    for (let d of data) {
+        let parentId = d[config.parentId];
+        if (nodeIds[parentId] == null) {
+            tree.push(d);
+        }
+    }
+
+    for (let t of tree) {
+        adaptToChildrenList(t);
+    }
+
+    function adaptToChildrenList(o) {
+        if (childrenListMap[o[config.id]] !== null) {
+            o[config.childrenList] = childrenListMap[o[config.id]];
+        }
+        if (o[config.childrenList]) {
+            for (let c of o[config.childrenList]) {
+                adaptToChildrenList(c);
+            }
+        }
+    }
+
+    return tree;
+}
+
+/**
+ * 参数处理
+ * @param {*} params  参数
+ */
+export function tansParams(params) {
+    let result = ''
+    for (const propName of Object.keys(params)) {
+        const value = params[propName];
+        var part = encodeURIComponent(propName) + "=";
+        if (value !== null && value !== "" && typeof (value) !== "undefined") {
+            if (typeof value === 'object') {
+                for (const key of Object.keys(value)) {
+                    if (value[key] !== null && value[key] !== "" && typeof (value[key]) !== 'undefined') {
+                        let params = propName + '[' + key + ']';
+                        var subPart = encodeURIComponent(params) + "=";
+                        result += subPart + encodeURIComponent(value[key]) + "&";
+                    }
+                }
+            } else {
+                result += part + encodeURIComponent(value) + "&";
+            }
+        }
+    }
+    return result
+}
+
+// 验证是否为blob格式
+export async function blobValidate(data) {
+    try {
+        const text = await data.text();
+        JSON.parse(text);
+        return false;
+    } catch (error) {
+        return true;
+    }
+}
diff --git a/src/views/purchase/purApplyEditDiaolog.vue b/src/views/purchase/purApplyEditDiaolog.vue
index 9c665b2..32c8f94 100644
--- a/src/views/purchase/purApplyEditDiaolog.vue
+++ b/src/views/purchase/purApplyEditDiaolog.vue
@@ -62,7 +62,8 @@
 
                     <el-col :span="7">
                         <el-form-item prop="locStorageCode">
-                            <el-select v-model="formData.locStorageCode" placeholder="当前仓库信息" @change="locInChange" style="width: 50%"
+                            <el-select v-model="formData.locStorageCode" placeholder="当前仓库信息" @change="locInChange"
+                                       style="width: 50%"
                                        clearable>
                                 <el-option
                                     v-for="item in storageList"
@@ -223,8 +224,8 @@ export default {
                 billDate: "",
                 remark: "",
                 deptCode: null,
-                locStorageCode:null,
-                invWarehouseCode:null,
+                locStorageCode: null,
+                invWarehouseCode: null,
             },
             formRules: {},
             codeArray: [],
@@ -371,7 +372,9 @@ export default {
                 if (this.orderEditor) {
                     this.detailLoading = true;
                     if (this.$isNotBlank(row.id)) {
-                        delApplyDetail(row.id)
+                        let delIds = [];
+                        delIds.push(row.id)
+                        delApplyDetail(delIds)
                             .then(response => {
                                 this.detailLoading = false;
                                 if (response.code === 20000) {
@@ -474,8 +477,8 @@ export default {
                 billDate: "",
                 remark: "",
                 deptCode: null,
-                locStorageCode:null,
-                invWarehouseCode:null,
+                locStorageCode: null,
+                invWarehouseCode: null,
             };
             this.orderEditor = false;
         }
diff --git a/src/views/purchase/purPlanEditDialog.vue b/src/views/purchase/purPlanEditDialog.vue
index f60c441..597f652 100644
--- a/src/views/purchase/purPlanEditDialog.vue
+++ b/src/views/purchase/purPlanEditDialog.vue
@@ -54,6 +54,27 @@
                 </el-row>
 
                 <el-row :gutter="20" style="margin-top: -10px">
+
+                    <el-col :span="3">
+                        <div class="ao-text">
+                            <span>采购类型:</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="7">
+                        <el-form-item prop="billType">
+                            <el-select v-model="formData.billType" placeholder="请选择采购类型" style="width: 100%"
+                                       clearable>
+                                <el-option
+                                    v-for="item in busTypes"
+                                    :key="item.originAction"
+                                    :label="item.originName"
+                                    :value="item.originAction">
+                                    <span style="float: left">{{ item.originName }}</span>
+                                </el-option>
+                            </el-select>
+                        </el-form-item>
+                    </el-col>
+
                     <el-col :span="3">
                         <div class="ao-text">
                             <span>采购仓库:</span>
@@ -85,6 +106,10 @@
                             </el-select>
                         </el-form-item>
                     </el-col>
+
+                </el-row>
+
+                <el-row :gutter="20" style="margin-top: -10px">
                     <el-col :span="3">
                         <div class="ao-text">
                             <span>采购说明:</span>
@@ -197,6 +222,7 @@ import stockOrderNewSelectProduct from "../warehouse/stockOrderNewSelectProduct"
 import {inserThrOrderWeb, delApplyDetail, listApplyDetail} from "@/api/purchase/purPlan";
 import {filterAllByUser} from "@/api/basic/invWarehouse";
 import {filterSubByInv} from "@/api/basic/invSubWarehouse";
+import {getBusChange} from "@/api/basic/busTypeChange";
 
 export default {
     name: "idQuery",
@@ -371,7 +397,9 @@ export default {
                 if (this.orderEditor) {
                     this.detailLoading = true;
                     if (this.$isNotBlank(row.id)) {
-                        delApplyDetail(row.id)
+                        let delIds = [];
+                        delIds.push(row.id)
+                        delApplyDetail(delIds)
                             .then(response => {
                                 this.detailLoading = false;
                                 if (response.code === 20000) {
@@ -450,6 +478,18 @@ export default {
             this.formData.locStorageCode = item;
             this.findSubInvs();
         },
+        getBusType() {
+            let query = {
+                enable: false,
+                type: 3,
+            };
+            getBusChange(query)
+                .then((response) => {
+                    this.busTypes = response.data.list || [];
+                })
+                .catch(() => {
+                });
+        },
     },
     filters: {},
     mounted() {
@@ -480,6 +520,7 @@ export default {
             this.orderEditor = false;
         }
         this.getStorage();
+        this.getBusType();
         this.codeArray = [];
     },
 };
diff --git a/src/views/purchase/pureApplyDetailDialog.vue b/src/views/purchase/pureApplyDetailDialog.vue
index d4c734e..adbb474 100644
--- a/src/views/purchase/pureApplyDetailDialog.vue
+++ b/src/views/purchase/pureApplyDetailDialog.vue
@@ -1,191 +1,239 @@
 <template>
-  <div>
-
-    <el-form :model="formData" :rules="formRules" ref="dataForm">
-      <el-row type="flex" justify="end" v-if="editType == 1">
-        <el-button-group style="display: flex;margin-bottom: 15px; margin-right: 50px">
-          <el-button
-              type="primary"
-              @click.native="saveOrder('3')"
-              :loading="loading"
-          >审核通过
-          </el-button
-          >
-          <el-button
-              type="primary"
-              @click.native="saveOrder('4')"
-              :loading="loading"
-          >拒绝申请
-          </el-button
-          >
-        </el-button-group>
-      </el-row>
-
-      <el-card style="margin-top: -5px;">
-        <el-row :gutter="20" style="margin-top: 10px;">
-          <el-col :span="3">
-            <div class="ao-text">
-              <span>单据号:</span>
-            </div>
-          </el-col>
-          <el-col :span="7">
-            <el-form-item prop="billNo">
-              <el-input v-model="formData.billNo" auto-complete="off" :disabled="true"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="3">
-            <div class="ao-text">
-              <span>单据日期:</span>
-            </div>
-          </el-col>
-          <el-col :span="7">
-            <el-form-item prop="billdate">
-              <el-date-picker
-                  v-model="formData.billDate"
-                  type="datetime"
-                  placeholder="选择日期"
-                  style="width: 100%" :disabled="true"
-                  :clearable="false"
-                  value-format="yyyy-MM-dd HH:mm:ss"
-              >
-              </el-date-picker>
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <el-row :gutter="20" style="margin-top: -10px">
-          <el-col :span="3">
-            <div class="ao-text">
-              <span>申购科室:</span>
-            </div>
-          </el-col>
-
-          <el-col :span="7">
-            <el-form-item prop="locStorageCode">
-              <el-select v-model="formData.locStorageCode" placeholder="当前仓库信息" @change="locInChange"
-                         :disabled="true"
-                         style="width: 50%"
-                         clearable>
-                <el-option
-                    v-for="item in storageList"
-                    :key="item.name"
-                    :label="item.name"
-                    :value="item.code">
-                  <span style="float: left">{{ item.name }}</span>
-                </el-option>
-              </el-select>
-              <el-select v-model="formData.invWarehouseCode" placeholder="当前分库信息" style="width: 50%"
-                         :disabled="true"
-                         clearable>
-                <el-option
-                    v-for="item in subInvList"
-                    :key="item.name"
-                    :label="item.name"
-                    :value="item.code">
-                  <span style="float: left">{{ item.name }}</span>
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="3">
-            <div class="ao-text">
-              <span>申购说明:</span>
-            </div>
-          </el-col>
-          <el-col :span="7">
-            <el-form-item prop="billNo">
-              <el-input v-model="formData.remark" auto-complete="off" type="textarea" :disabled="true"
-                        autosize></el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="3">
-            <div class="ao-text">
-              <span>审核说明:</span>
-            </div>
-          </el-col>
-          <el-col :span="7">
-            <el-form-item prop="billNo">
-              <el-input v-model="formData.auditRemark" auto-complete="off" type="textarea"
-                        autosize></el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-
-      </el-card>
-
-      <el-card>
-
-        <el-table v-loading="loading" :data="codeArray" style="width: 100%;"
-                  :row-class-name="tableRowClassName"
-                  max-height="300" height="300" ref="multipleTable">
-          <el-table-column label="序号" type="index" width="50"></el-table-column>
-          <el-table-column
-              label="产品通用名"
-              prop="productName"
-              show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-              label="规格型号"
-              prop="spec"
-              show-overflow-tooltip
-          ></el-table-column>
-
-          <el-table-column
-              label="计量单位"
-              prop="measname"
-              show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-              label="生产厂家"
-              prop="manufactory"
-              show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column width="150" label="单据数量" prop="count">
-          </el-table-column>
-
-          <el-table-column label="操作" fixed="right" width="150">
-            <template slot-scope="scope">
-              <el-button
-                  type="text"
-                  size="small"
-                  :disabled="scope.row.index === selectedIndex"
-                  @click.stop="true"
-                  @click.native="rowChange(scope.row)"
-              >编辑
-              </el-button
-              >
-              <el-button
-                  type="text"
-                  size="small"
-                  @click.stop="true"
-                  @click.native="deleteCodeArray(scope.$index, scope.row)"
-              >删除
-              </el-button
-              >
-            </template>
-          </el-table-column>
-        </el-table>
-      </el-card>
-    </el-form>
-
-    <el-dialog
-        title="产品录入"
-        :visible.sync="selectProductVisible"
-        :close-on-click-modal="false"
-        :close-on-press-escape="false"
-        width="85%"
-        v-if="selectProductVisible"
-        :append-to-body='true'
-    >
-      <stockOrderNewSelectProduct
-          :closeDialog="closeDialogC2"
-          :data="thisData"
-      ></stockOrderNewSelectProduct>
-    </el-dialog>
-  </div>
+    <div>
+
+        <el-form :model="formData" :rules="formRules" ref="dataForm">
+            <el-row type="flex" justify="end" v-if="editType == 1">
+                <el-button-group style="display: flex;margin-bottom: 15px; margin-right: 50px">
+                    <el-button
+                        type="primary"
+                        @click.native="saveOrder('3')"
+                        :loading="loading"
+                    >审核通过
+                    </el-button
+                    >
+                    <el-button
+                        type="primary"
+                        @click.native="saveOrder('4')"
+                        :loading="loading"
+                    >拒绝申请
+                    </el-button
+                    >
+                </el-button-group>
+            </el-row>
+
+            <el-card style="margin-top: -5px;">
+                <el-row :gutter="20" style="margin-top: 10px;">
+                    <el-col :span="3">
+                        <div class="ao-text">
+                            <span>单据号:</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="7">
+                        <el-form-item prop="billNo">
+                            <el-input v-model="formData.billNo" auto-complete="off" :disabled="true"></el-input>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="3">
+                        <div class="ao-text">
+                            <span>单据日期:</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="7">
+                        <el-form-item prop="billdate">
+                            <el-date-picker
+                                v-model="formData.billDate"
+                                type="datetime"
+                                placeholder="选择日期"
+                                style="width: 100%" :disabled="true"
+                                :clearable="false"
+                                value-format="yyyy-MM-dd HH:mm:ss"
+                            >
+                            </el-date-picker>
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+
+                <el-row :gutter="20" style="margin-top: -10px">
+                    <el-col :span="3">
+                        <div class="ao-text">
+                            <span>申购科室:</span>
+                        </div>
+                    </el-col>
+
+                    <el-col :span="7">
+                        <el-form-item prop="locStorageCode">
+                            <el-select v-model="formData.locStorageCode" placeholder="当前仓库信息"
+                                       :disabled="true"
+                                       style="width: 50%"
+                                       clearable>
+                                <el-option
+                                    v-for="item in storageList"
+                                    :key="item.name"
+                                    :label="item.name"
+                                    :value="item.code">
+                                    <span style="float: left">{{ item.name }}</span>
+                                </el-option>
+                            </el-select>
+                            <el-select v-model="formData.invWarehouseCode" placeholder="当前分库信息" style="width: 50%"
+                                       :disabled="true"
+                                       clearable>
+                                <el-option
+                                    v-for="item in subInvList"
+                                    :key="item.name"
+                                    :label="item.name"
+                                    :value="item.code">
+                                    <span style="float: left">{{ item.name }}</span>
+                                </el-option>
+                            </el-select>
+                        </el-form-item>
+                    </el-col>
+
+
+                    <el-col :span="3">
+                        <div class="ao-text">
+                            <span>当前仓库:</span>
+                        </div>
+                    </el-col>
+
+                    <el-col :span="7">
+                        <el-form-item prop="targetInv">
+                            <el-select v-model="formData.targetInv" placeholder="当前仓库信息" @change="locInChange"
+                                       style="width: 50%"
+                                       clearable>
+                                <el-option
+                                    v-for="item in targetInvList"
+                                    :key="item.name"
+                                    :label="item.name"
+                                    :value="item.code">
+                                    <span style="float: left">{{ item.name }}</span>
+                                </el-option>
+                            </el-select>
+                            <el-select v-model="formData.targetSubInv" placeholder="当前分库信息" style="width: 50%"
+                                       clearable>
+                                <el-option
+                                    v-for="item in targetSubInvList"
+                                    :key="item.name"
+                                    :label="item.name"
+                                    :value="item.code">
+                                    <span style="float: left">{{ item.name }}</span>
+                                </el-option>
+                            </el-select>
+                        </el-form-item>
+                    </el-col>
+
+
+                </el-row>
+
+
+                <el-row :gutter="20" style="margin-top: -10px">
+
+
+                    <el-col :span="3">
+                        <div class="ao-text">
+                            <span>生成采购计划:</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="7">
+                        <el-form-item prop="billType">
+                            <el-select v-model="formData.targetBillType" placeholder="请选择采购类型" style="width: 100%"
+                                       clearable>
+                                <el-option
+                                    v-for="item in busTypes"
+                                    :key="item.originAction"
+                                    :label="item.originName"
+                                    :value="item.originAction">
+                                    <span style="float: left">{{ item.originName }}</span>
+                                </el-option>
+                            </el-select>
+                        </el-form-item>
+                    </el-col>
+
+                    <el-col :span="3">
+                        <div class="ao-text">
+                            <span>审核说明:</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="7">
+                        <el-form-item prop="billNo">
+                            <el-input v-model="formData.auditRemark" auto-complete="off" type="textarea"
+                                      autosize></el-input>
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+
+
+            </el-card>
+
+            <el-card>
+
+                <el-table v-loading="loading" :data="codeArray" style="width: 100%;"
+                          :row-class-name="tableRowClassName"
+                          max-height="300" height="300" ref="multipleTable">
+                    <el-table-column label="序号" type="index" width="50"></el-table-column>
+                    <el-table-column
+                        label="产品通用名"
+                        prop="productName"
+                        show-overflow-tooltip
+                    ></el-table-column>
+                    <el-table-column
+                        label="规格型号"
+                        prop="spec"
+                        show-overflow-tooltip
+                    ></el-table-column>
+
+                    <el-table-column
+                        label="计量单位"
+                        prop="measname"
+                        show-overflow-tooltip
+                    ></el-table-column>
+                    <el-table-column
+                        label="生产厂家"
+                        prop="manufactory"
+                        show-overflow-tooltip
+                    ></el-table-column>
+                    <el-table-column width="150" label="单据数量" prop="count">
+                    </el-table-column>
+
+                    <el-table-column label="操作" fixed="right" width="150">
+                        <template slot-scope="scope">
+                            <el-button
+                                type="text"
+                                size="small"
+                                :disabled="scope.row.index === selectedIndex"
+                                @click.stop="true"
+                                @click.native="rowChange(scope.row)"
+                            >编辑
+                            </el-button
+                            >
+                            <el-button
+                                type="text"
+                                size="small"
+                                @click.stop="true"
+                                @click.native="deleteCodeArray(scope.$index, scope.row)"
+                            >删除
+                            </el-button
+                            >
+                        </template>
+                    </el-table-column>
+                </el-table>
+            </el-card>
+        </el-form>
+
+        <el-dialog
+            title="产品录入"
+            :visible.sync="selectProductVisible"
+            :close-on-click-modal="false"
+            :close-on-press-escape="false"
+            width="85%"
+            v-if="selectProductVisible"
+            :append-to-body='true'
+        >
+            <stockOrderNewSelectProduct
+                :closeDialog="closeDialogC2"
+                :data="thisData"
+            ></stockOrderNewSelectProduct>
+        </el-dialog>
+    </div>
 </template>
 
 <script>
@@ -194,288 +242,341 @@ import stockOrderNewSelectProduct from "../warehouse/stockOrderNewSelectProduct"
 import {delApplyDetail, listApplyDetail, auditOrder} from "@/api/purchase/purApply";
 import {filterAllByUser} from "@/api/basic/invWarehouse";
 import {filterSubByInv} from "@/api/basic/invSubWarehouse";
+import {getBusChange} from "@/api/basic/busTypeChange";
 
 export default {
-  name: "idQuery",
-  props: {
-    closeDialog: {
-      type: Function,
-      required: true,
-    },
-    idQuery: {
-      type: Object,
-      required: true,
-    },
-    editType: {
-      type: Object,
-      required: true,
+    name: "idQuery",
+    props: {
+        closeDialog: {
+            type: Function,
+            required: true,
+        },
+        idQuery: {
+            type: Object,
+            required: true,
+        },
+        editType: {
+            type: Object,
+            required: true,
+        },
+
     },
+    data() {
+        return {
+            code: "",
+            query: {
+                orderIdFk: "",
+                page: 1,
+                limit: 10,
+            },
+            formData: {
+                status: null,
+                id: null,
+                billNo: null,
+                billDate: "",
+                remark: "",
+                deptCode: null,
+                locStorageCode: null,
+                invWarehouseCode: null,
+                targetInv: null,
+                targetSubInv: null,
+                targetBillType:null,
+            },
+            formRules: {},
+            codeArray: [],
+            total: 0,
+            loading: false,
+            index: null,
+            formLoading: false,
+            formVisible: false,
+            deleteLoading: false,
+            orderNo: null,
+            statusMap: {
+                1: "草稿",
+                2: "未审核",
+                3: "已审核",
+            },
+            typeMap: {
+                1: "预入库",
+                2: "普通采购",
+            },
+            orderEditor: true,
+            sOptions: [],
+            sValue: [],
+            sList: [],
+            sLoading: false,
+            busTypes: [],
+            currentRow: {},
+            selectedIndex: "",
+            selectProductVisible: false,
+            thisData: {},
+            storageList: [],
+            subInvList: [],
+
+
+            targetInvList: [],
+            targetSubInvList: [],
 
-  },
-  data() {
-    return {
-      code: "",
-      query: {
-        orderIdFk: "",
-        page: 1,
-        limit: 10,
-      },
-      formData: {
-        status: null,
-        id: null,
-        billNo: null,
-        billDate: "",
-        remark: "",
-        deptCode: null,
-        locStorageCode: null,
-        invWarehouseCode: null,
-      },
-      formRules: {},
-      codeArray: [],
-      total: 0,
-      loading: false,
-      index: null,
-      formLoading: false,
-      formVisible: false,
-      deleteLoading: false,
-      orderNo: null,
-      statusMap: {
-        1: "草稿",
-        2: "未审核",
-        3: "已审核",
-      },
-      typeMap: {
-        1: "预入库",
-        2: "普通采购",
-      },
-      orderEditor: true,
-      sOptions: [],
-      sValue: [],
-      sList: [],
-      sLoading: false,
-      busTypes: [],
-      currentRow: {},
-      selectedIndex: "",
-      selectProductVisible: false,
-      thisData: {},
-      storageList: [],
-      subInvList: [],
-      invQueryData: {},
-
-    };
-  },
-  components: {
-    draggable,
-    stockOrderNewSelectProduct,
-  },
-  methods: {
-    saveOrder(status) {
-      let tip = "";
-      if (status == "3") {
-        tip = "是否确定通过该申购请求?";
-      } else {
-        tip = "是否确定拒绝该申购请求?";
-      }
-      this.$confirm(tip, "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      }).then(() => {
-        this.submitFunction(status);
-      }).catch(() => {
-        this.loading = false;
-      });
+            invQueryData: {},
+
+        };
+    },
+    components: {
+        draggable,
+        stockOrderNewSelectProduct,
     },
-    submitFunction(status) {
-      this.loading = true;
-      this.formData.status = status;
-      auditOrder(this.formData)
-          .then(response => {
-            this.loading = false;
-            if (response.code === 20000) {
-              this.$message.success("更新成功!");
-              this.closeDialog(true);
+    methods: {
+        saveOrder(status) {
+            let tip = "";
+            if (status == "3") {
+                tip = "是否确定通过该申购请求?";
             } else {
-              this.$message.error(response.message);
+                tip = "是否确定拒绝该申购请求?";
             }
-          })
-          .catch(() => {
-            this.loading = false;
-          })
-    },
-    selectProductFunction() {
-      this.selectProductVisible = true;
-    },
-    closeDialogC2(rData) {
-      this.selectProductVisible = false;
-      this.thisData = {};
-      if (this.$isNotBlank(rData)) {
-        this.codeArray = [];
-        rData.forEach((obj, index) => {
-          this.codeArray.unshift(obj);
-        });
-        this.$refs.multipleTable.setCurrentRow(this.codeArray[0]);
-        this.currentRow = this.codeArray[0];
-        this.selectedIndex = 0;
-      }
-    },
-    rowChange(val) {
-      this.currentRow = val;
-      this.selectedIndex = val.index;
-    },
-    tableCountChange(row) {
-      if (this.$isNotBlank(row)) {
-        // row.count = row.reCount;
-      }
-    },
-    tableRowClassName({row, rowIndex}) {
-      row.index = rowIndex;
-    },
-    // 刷新表单
-    resetForm() {
-      if (this.$refs["dataForm"]) {
-        // 清空验证信息表单
-        this.$refs["dataForm"].clearValidate();
-        // 刷新表单
-        this.$refs["dataForm"].resetFields();
-        this.getList();
-      }
-    },
-    deleteCodeArray(index, row) {
-      this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      }).then(() => {
-        this.$refs.multipleTable.setCurrentRow();
-        this.currentRow = {};
-        this.selectedIndex = "";
-
-        if (this.orderEditor) {
-          this.detailLoading = true;
-          if (this.$isNotBlank(row.id)) {
-            delApplyDetail(row.id)
+            this.$confirm(tip, "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+            }).then(() => {
+                this.submitFunction(status);
+            }).catch(() => {
+                this.loading = false;
+            });
+        },
+        submitFunction(status) {
+            this.loading = true;
+            this.formData.status = status;
+            auditOrder(this.formData)
                 .then(response => {
-                  this.detailLoading = false;
-                  if (response.code === 20000) {
-                    this.$message.success(response.data);
-                    // this.getStockOrderDetailList();
+                    this.loading = false;
+                    if (response.code === 20000) {
+                        this.$message.success("更新成功!");
+                        this.closeDialog(true);
+                    } else {
+                        this.$message.error(response.message);
+                    }
+                })
+                .catch(() => {
+                    this.loading = false;
+                })
+        },
+        selectProductFunction() {
+            this.selectProductVisible = true;
+        },
+        closeDialogC2(rData) {
+            this.selectProductVisible = false;
+            this.thisData = {};
+            if (this.$isNotBlank(rData)) {
+                this.codeArray = [];
+                rData.forEach((obj, index) => {
+                    this.codeArray.unshift(obj);
+                });
+                this.$refs.multipleTable.setCurrentRow(this.codeArray[0]);
+                this.currentRow = this.codeArray[0];
+                this.selectedIndex = 0;
+            }
+        },
+        rowChange(val) {
+            this.currentRow = val;
+            this.selectedIndex = val.index;
+        },
+        tableCountChange(row) {
+            if (this.$isNotBlank(row)) {
+                // row.count = row.reCount;
+            }
+        },
+        tableRowClassName({row, rowIndex}) {
+            row.index = rowIndex;
+        },
+        // 刷新表单
+        resetForm() {
+            if (this.$refs["dataForm"]) {
+                // 清空验证信息表单
+                this.$refs["dataForm"].clearValidate();
+                // 刷新表单
+                this.$refs["dataForm"].resetFields();
+                this.getList();
+            }
+        },
+        deleteCodeArray(index, row) {
+            this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+            }).then(() => {
+                this.$refs.multipleTable.setCurrentRow();
+                this.currentRow = {};
+                this.selectedIndex = "";
+
+                if (this.orderEditor) {
+                    this.detailLoading = true;
+                    if (this.$isNotBlank(row.id)) {
+                        delApplyDetail(row.id)
+                            .then(response => {
+                                this.detailLoading = false;
+                                if (response.code === 20000) {
+                                    this.$message.success(response.data);
+                                    // this.getStockOrderDetailList();
+                                    this.codeArray.splice(index, 1);
+                                } else {
+                                    this.$message.error(response.message);
+                                }
+                            })
+                            .catch(() => {
+                                this.detailLoading = false;
+                            })
+                    } else {
+                        this.$message.success('删除成功');
+                        this.codeArray.splice(index, 1);
+                    }
+                } else {
+                    this.$message.success('删除成功');
                     this.codeArray.splice(index, 1);
-                  } else {
-                    this.$message.error(response.message);
-                  }
+                }
+            }).catch(() => {
+
+            });
+        },
+        getStockOrderDetailList() {
+            this.loading = true;
+            listApplyDetail(this.query) //查找该单号下的所有条码
+                .then((response) => {
+                    console.log(response)
+                    this.codeArray = response.data.list || [];
+                    this.total = response.data.total || 0;
+                    this.loading = false;
                 })
                 .catch(() => {
-                  this.detailLoading = false;
+                    this.loading = false;
+                    this.list = [];
+                    this.total = 0;
+                });
+        },
+
+
+        getStorage() {
+            this.storageList = [];
+            filterAllByUser()
+                .then((response) => {
+                    this.storageList = response.data || [];
                 })
-          } else {
-            this.$message.success('删除成功');
-            this.codeArray.splice(index, 1);
-          }
-        } else {
-          this.$message.success('删除成功');
-          this.codeArray.splice(index, 1);
-        }
-      }).catch(() => {
+                .catch(() => {
+                });
+        },
+        findSubInvs() {
+            this.subInvList = [];
+            let query = {
+                pcode: this.formData.locStorageCode
+            };
+            filterSubByInv(query)
+                .then((response) => {
+                    this.subInvList = response.data || [];
+                    if (this.subInvList != null && this.subInvList.length == 1) {
+                        this.formData.invWarehouseCode = this.subInvList[0].code;
+                    }
+                })
+                .catch(() => {
+                });
+        },
 
-      });
-    },
-    getStockOrderDetailList() {
-      this.loading = true;
-      listApplyDetail(this.query) //查找该单号下的所有条码
-          .then((response) => {
-            console.log(response)
-            this.codeArray = response.data.list || [];
-            this.total = response.data.total || 0;
-            this.loading = false;
-          })
-          .catch(() => {
-            this.loading = false;
-            this.list = [];
-            this.total = 0;
-          });
-    },
 
+        getTargetStorage() {
+            this.targetInvList = [];
+            filterAllByUser()
+                .then((response) => {
+                    this.targetInvList = response.data || [];
+                    if (this.targetInvList != null && this.targetInvList.length == 1) {
+                        this.formData.targetInv = this.targetInvList[0].code;
+                    }
+                    this.findTargetSubInvs();
+
+                })
+                .catch(() => {
+                });
+        },
+        findTargetSubInvs() {
+            this.targetSubInvList = [];
+            let query = {
+                pcode: this.formData.targetInv
+            };
+            filterSubByInv(query)
+                .then((response) => {
+                    this.targetSubInvList = response.data || [];
+                    if (this.targetSubInvList != null && this.targetSubInvList.length == 1) {
+                        this.formData.targetSubInv = this.targetSubInvList[0].code;
+                    }
+                })
+                .catch(() => {
+                });
+        },
 
-    getStorage() {
-      this.storageList = [];
-      filterAllByUser()
-          .then((response) => {
-            this.storageList = response.data || [];
-            if (this.storageList != null && this.storageList.length == 1) {
-              this.formData.locStorageCode = this.storageList[0].code;
+
+        locInChange(item) {
+            if (this.formData.targetSubInv != null) {
+                this.formData.targetSubInv = "";
             }
-            this.findSubInvs();
+            this.formData.targetInv = item;
+            this.findTargetSubInvs();
+        },
 
-          })
-          .catch(() => {
-          });
+        getBusType() {
+            let query = {
+                enable: false,
+                type: 3,
+            };
+            getBusChange(query)
+                .then((response) => {
+                    this.busTypes = response.data.list || [];
+                })
+                .catch(() => {
+                });
+        },
     },
-    findSubInvs() {
-      this.subInvList = [];
-      let query = {
-        pcode: this.formData.locStorageCode
-      };
-      filterSubByInv(query)
-          .then((response) => {
-            this.subInvList = response.data || [];
-            if (this.subInvList != null && this.subInvList.length == 1) {
-              this.formData.invWarehouseCode = this.subInvList[0].code;
-            }
-          })
-          .catch(() => {
-          });
+    filters: {},
+    mounted() {
+        document.body.ondrop = function (event) {
+            event.preventDefault();
+            event.stopPropagation();
+        };
     },
-    locInChange(item) {
-      if (this.formData.invWarehouseCode != null) {
-        this.formData.invWarehouseCode = "";
-      }
-      this.formData.locStorageCode = item;
-      this.findSubInvs();
+    created() {
+
+        if (this.$isNotBlank(this.idQuery.id)) {
+            this.query.limit = 100;
+            this.query.orderIdFk = this.idQuery.id;
+            this.formData = this.idQuery.formData;
+            this.orderEditor = true;
+            this.sValue = this.formData.corpName;
+            this.getStockOrderDetailList();
+        } else {
+            this.formData = {
+                id: null,
+                billNo: null,
+                billDate: "",
+                remark: "",
+                deptCode: null,
+                locStorageCode: null,
+                invWarehouseCode: null,
+            };
+            this.orderEditor = false;
+        }
+        this.getStorage();
+        this.findSubInvs();
+        this.getTargetStorage();
+        this.codeArray = [];
+        this.getBusType();
     },
-  },
-  filters: {},
-  mounted() {
-    document.body.ondrop = function (event) {
-      event.preventDefault();
-      event.stopPropagation();
-    };
-  },
-  created() {
-
-    if (this.$isNotBlank(this.idQuery.id)) {
-      this.query.limit = 100;
-      this.query.orderIdFk = this.idQuery.id;
-      this.formData = this.idQuery.formData;
-      this.orderEditor = true;
-      this.sValue = this.formData.corpName;
-      this.getStockOrderDetailList();
-    } else {
-      this.formData = {
-        id: null,
-        billNo: null,
-        billDate: "",
-        remark: "",
-        deptCode: null,
-        locStorageCode: null,
-        invWarehouseCode: null,
-      };
-      this.orderEditor = false;
-    }
-    this.getStorage();
-    this.codeArray = [];
-  },
 };
 </script>
 <style>
 
 .ao-text {
-  width: 100%;
-  font-size: 13px;
-  font-family: "Microsoft YaHei";
-  float: right;
-  text-align: right;
-  margin-top: 10px;
+    width: 100%;
+    font-size: 13px;
+    font-family: "Microsoft YaHei";
+    float: right;
+    text-align: right;
+    margin-top: 10px;
 }
 
 </style>
diff --git a/src/views/thrsys/SysUdimsConfig.vue b/src/views/thrsys/SysUdimsConfig.vue
index 33e0396..3f321c2 100644
--- a/src/views/thrsys/SysUdimsConfig.vue
+++ b/src/views/thrsys/SysUdimsConfig.vue
@@ -114,6 +114,17 @@
                 <el-checkbox v-model="configQuery.dbDiProducts" :disabled="configQuery.downstreamEnable">DI产品信息
                 </el-checkbox>
             </el-descriptions-item>
+
+
+            <el-descriptions-item>
+                <template slot="label">
+                    首营资质证书
+                </template>
+                <el-checkbox v-model="configQuery.unCheckCert" :disabled="configQuery.downstreamEnable">未审核
+                </el-checkbox>
+                <el-checkbox v-model="configQuery.checkedCert" :disabled="configQuery.downstreamEnable">已审核
+                </el-checkbox>
+            </el-descriptions-item>
         </el-descriptions>
 
         <el-descriptions class="margin-top" title="同步至UDI管理系统单据" :column="1" :size="100" style="margin-top: 30px"
@@ -287,6 +298,9 @@ export default {
                 orderSyncTime: null,
                 orderSyncStart: null,
                 entrustAction: null,
+                unCheckCert: null,
+                checkedCert: null,
+
             },
             checkedBusTypes: [],
             busQuery: {
diff --git a/src/views/thrsys/thrOrderNew.vue b/src/views/thrsys/thrOrderNew.vue
index 32bc873..84e5173 100644
--- a/src/views/thrsys/thrOrderNew.vue
+++ b/src/views/thrsys/thrOrderNew.vue
@@ -921,6 +921,7 @@ export default {
         getBusType() {
             let query = {
                 enable: false,
+                type: 1,
             };
             getBusChange(query)
                 .then((response) => {