|  |  | <template>
 | 
						
						
						
							|  |  |     <div>
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |         <el-form :model="formData" :rules="formRules" ref="dataForm">
 | 
						
						
						
							|  |  |             <el-row type="flex" justify="end">
 | 
						
						
						
							|  |  |                 <el-button-group style="display: flex;margin-bottom: 15px; margin-right: 50px">
 | 
						
						
						
							|  |  |                     <el-button
 | 
						
						
						
							|  |  |                         type="primary"
 | 
						
						
						
							|  |  |                         @click.native="saveOrder('1')"
 | 
						
						
						
							|  |  |                         :loading="loading"
 | 
						
						
						
							|  |  |                     >草稿保存
 | 
						
						
						
							|  |  |                     </el-button
 | 
						
						
						
							|  |  |                     >
 | 
						
						
						
							|  |  |                     <el-button
 | 
						
						
						
							|  |  |                         type="primary"
 | 
						
						
						
							|  |  |                         @click.native="saveOrder('2')"
 | 
						
						
						
							|  |  |                         :loading="loading"
 | 
						
						
						
							|  |  |                     >未配货提交
 | 
						
						
						
							|  |  |                     </el-button
 | 
						
						
						
							|  |  |                     >
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                     <el-button
 | 
						
						
						
							|  |  |                         type="primary"
 | 
						
						
						
							|  |  |                         @click.native="saveOrder('3')"
 | 
						
						
						
							|  |  |                         :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-input v-model="formData.billdate" auto-complete="off"></el-input>-->
 | 
						
						
						
							|  |  |                             <el-date-picker
 | 
						
						
						
							|  |  |                                 v-model="formData.billdate"
 | 
						
						
						
							|  |  |                                 type="date"
 | 
						
						
						
							|  |  |                                 placeholder="选择日期"
 | 
						
						
						
							|  |  |                                 style="width: 100%"
 | 
						
						
						
							|  |  |                                 :clearable="false"
 | 
						
						
						
							|  |  |                             >
 | 
						
						
						
							|  |  |                             </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="corpName">
 | 
						
						
						
							|  |  |                             <el-select
 | 
						
						
						
							|  |  |                                 v-model="formData.corp"
 | 
						
						
						
							|  |  |                                 filterable
 | 
						
						
						
							|  |  |                                 remote
 | 
						
						
						
							|  |  |                                 clearable="true"
 | 
						
						
						
							|  |  |                                 reserve-keyword
 | 
						
						
						
							|  |  |                                 placeholder="请输入往来单位"
 | 
						
						
						
							|  |  |                                 :remote-method="findMethod"
 | 
						
						
						
							|  |  |                                 :loading="loading"
 | 
						
						
						
							|  |  |                                 @change="unitChange"
 | 
						
						
						
							|  |  |                             >
 | 
						
						
						
							|  |  |                                 <!--                                @change="unitChange"-->
 | 
						
						
						
							|  |  |                                 <el-option
 | 
						
						
						
							|  |  |                                     v-for="item in fromOptions"
 | 
						
						
						
							|  |  |                                     :key="item.name"
 | 
						
						
						
							|  |  |                                     :label="item.name"
 | 
						
						
						
							|  |  |                                     :value="item"
 | 
						
						
						
							|  |  |                                 >
 | 
						
						
						
							|  |  |                                     <span style="float: left">{{ item.name }}</span>
 | 
						
						
						
							|  |  |                                 </el-option>
 | 
						
						
						
							|  |  |                             </el-select>
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                             <!--                            <el-select-->
 | 
						
						
						
							|  |  |                             <!--                                style="width: 100%"-->
 | 
						
						
						
							|  |  |                             <!--                                v-model="sValue"-->
 | 
						
						
						
							|  |  |                             <!--                                :multiple="false"-->
 | 
						
						
						
							|  |  |                             <!--                                filterable-->
 | 
						
						
						
							|  |  |                             <!--                                remote-->
 | 
						
						
						
							|  |  |                             <!--                                reserve-keyword-->
 | 
						
						
						
							|  |  |                             <!--                                placeholder="请输入供应商名称"-->
 | 
						
						
						
							|  |  |                             <!--                                :remote-method="remoteMethod"-->
 | 
						
						
						
							|  |  |                             <!--                                :loading="sLoading"-->
 | 
						
						
						
							|  |  |                             <!--                                @change="selectOne">-->
 | 
						
						
						
							|  |  |                             <!--                                <el-option-->
 | 
						
						
						
							|  |  |                             <!--                                    v-for="item in sOptions"-->
 | 
						
						
						
							|  |  |                             <!--                                    :key="idx"-->
 | 
						
						
						
							|  |  |                             <!--                                    :label="item.name"-->
 | 
						
						
						
							|  |  |                             <!--                                    :value="item">-->
 | 
						
						
						
							|  |  |                             <!--                                </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="billType">
 | 
						
						
						
							|  |  |                             <!--<el-select v-model="formData.billType" style="width: 100%" placeholder="业务类型" :disabled="true">-->
 | 
						
						
						
							|  |  |                             <!--<el-option label="送货单" value="deliveryNote"></el-option>-->
 | 
						
						
						
							|  |  |                             <!--</el-select>-->
 | 
						
						
						
							|  |  |                             <el-select v-model="formData.billType" placeholder="请选择业务类型">
 | 
						
						
						
							|  |  |                                 <el-option
 | 
						
						
						
							|  |  |                                     v-for="item in busTypes"
 | 
						
						
						
							|  |  |                                     :key="item.name"
 | 
						
						
						
							|  |  |                                     :label="item.name"
 | 
						
						
						
							|  |  |                                     :value="item.action">
 | 
						
						
						
							|  |  |                                     <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="type">
 | 
						
						
						
							|  |  |                             <el-select v-model="formData.type" style="width: 100%" placeholder="采购类型">
 | 
						
						
						
							|  |  |                                 <el-option label="预入库" value="1"></el-option>
 | 
						
						
						
							|  |  |                                 <el-option label="普通采购" value="2"></el-option>
 | 
						
						
						
							|  |  |                             </el-select>
 | 
						
						
						
							|  |  |                         </el-form-item>
 | 
						
						
						
							|  |  |                     </el-col>
 | 
						
						
						
							|  |  |                 </el-row>
 | 
						
						
						
							|  |  |             </el-card>
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |             <el-card>
 | 
						
						
						
							|  |  |                 <!--            <el-row :gutter="20" style="padding-bottom: 10px; margin-top: -10px">-->
 | 
						
						
						
							|  |  |                 <!--                <el-col :span="20">-->
 | 
						
						
						
							|  |  |                 <!--                    <el-button-->
 | 
						
						
						
							|  |  |                 <!--                        type="primary"-->
 | 
						
						
						
							|  |  |                 <!--                        size="small"-->
 | 
						
						
						
							|  |  |                 <!--                        @click.native.stop="addCode()"-->
 | 
						
						
						
							|  |  |                 <!--                        style="display: flex; height: 31px; margin-left: auto; margin-right: 0;"-->
 | 
						
						
						
							|  |  |                 <!--                        :loading="loading"-->
 | 
						
						
						
							|  |  |                 <!--                    >产品录入-->
 | 
						
						
						
							|  |  |                 <!--                    </el-button-->
 | 
						
						
						
							|  |  |                 <!--                    >-->
 | 
						
						
						
							|  |  |                 <!--                </el-col>-->
 | 
						
						
						
							|  |  |                 <!--            </el-row>-->
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                 <!--                <el-button-group style="display: flex">-->
 | 
						
						
						
							|  |  |                 <!--                    <el-button-->
 | 
						
						
						
							|  |  |                 <!--                        type="primary"-->
 | 
						
						
						
							|  |  |                 <!--                        size="small"-->
 | 
						
						
						
							|  |  |                 <!--                        @click.native.stop="addCode()"-->
 | 
						
						
						
							|  |  |                 <!--                        style="margin: 0px 60px 10px auto; height: 35px"-->
 | 
						
						
						
							|  |  |                 <!--                        :loading="loading"-->
 | 
						
						
						
							|  |  |                 <!--                    >产品录入-->
 | 
						
						
						
							|  |  |                 <!--                    </el-button-->
 | 
						
						
						
							|  |  |                 <!--                    >-->
 | 
						
						
						
							|  |  |                 <!--                </el-button-group>-->
 | 
						
						
						
							|  |  |                 <el-button-group style="display: flex">
 | 
						
						
						
							|  |  |                     <el-button
 | 
						
						
						
							|  |  |                         type="primary"
 | 
						
						
						
							|  |  |                         size="small"
 | 
						
						
						
							|  |  |                         @click.native.stop="selectProductFunction()"
 | 
						
						
						
							|  |  |                         style="margin: 0px 60px 10px auto; height: 35px"
 | 
						
						
						
							|  |  |                         :loading="loading"
 | 
						
						
						
							|  |  |                     >产品录入
 | 
						
						
						
							|  |  |                     </el-button
 | 
						
						
						
							|  |  |                     >
 | 
						
						
						
							|  |  |                 </el-button-group>
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                 <el-row :gutter="20">
 | 
						
						
						
							|  |  |                     <el-col :span="3">
 | 
						
						
						
							|  |  |                         <div class="ao-text">
 | 
						
						
						
							|  |  |                             <span>扫码录入:</span>
 | 
						
						
						
							|  |  |                         </div>
 | 
						
						
						
							|  |  |                     </el-col>
 | 
						
						
						
							|  |  |                     <el-col :span="10">
 | 
						
						
						
							|  |  |                         <el-form-item prop="code">
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                             <!--                            @keyup.native.enter="focusNext('iCount')"   @focus="getInputFocus($event)"
 | 
						
						
						
							|  |  |                                @keypress.enter.native="selectProductFunction($event)"
 | 
						
						
						
							|  |  |                             -->
 | 
						
						
						
							|  |  |                             <el-input
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                                 @keyup.enter.native="selectProductFunction($event)"
 | 
						
						
						
							|  |  |                                 v-model="code"
 | 
						
						
						
							|  |  |                                 auto-complete="off"
 | 
						
						
						
							|  |  |                                 ref='inputRef'
 | 
						
						
						
							|  |  |                                 @focus="getInputFocus($event)"
 | 
						
						
						
							|  |  |                             ></el-input>
 | 
						
						
						
							|  |  |                         </el-form-item>
 | 
						
						
						
							|  |  |                     </el-col>
 | 
						
						
						
							|  |  |                     <el-col :span="3">
 | 
						
						
						
							|  |  |                         <div class="ao-text">
 | 
						
						
						
							|  |  |                             <span>数量:</span>
 | 
						
						
						
							|  |  |                         </div>
 | 
						
						
						
							|  |  |                     </el-col>
 | 
						
						
						
							|  |  |                     <el-col :span="4">
 | 
						
						
						
							|  |  |                         <el-form-item prop="iCount">
 | 
						
						
						
							|  |  |                             <!--                            @keypress.enter.native="addCode()"-->
 | 
						
						
						
							|  |  |                             <el-input v-model="iCount" auto-complete="off" ref="iCount"
 | 
						
						
						
							|  |  |                                       @keypress.enter.native="iCountEnterFunction()"
 | 
						
						
						
							|  |  |                                       @focus="getInputFocus($event)"
 | 
						
						
						
							|  |  |                                       @input="iCountChange"
 | 
						
						
						
							|  |  |                                       oninput="value=value.replace(/[^\d]/g,'')"></el-input>
 | 
						
						
						
							|  |  |                         </el-form-item>
 | 
						
						
						
							|  |  |                     </el-col>
 | 
						
						
						
							|  |  |                 </el-row>
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                 <!--                highlight-current-row-->
 | 
						
						
						
							|  |  |                 <!--                @current-change="rowChange"-->
 | 
						
						
						
							|  |  |                 <el-table v-loading="loading" :data="codeArray" style="width: 100%;"
 | 
						
						
						
							|  |  |                           :row-class-name="tableRowClassName"
 | 
						
						
						
							|  |  |                           max-height="300" height="300" ref="multipleTable">
 | 
						
						
						
							|  |  |                     <!--                    <el-table-column-->
 | 
						
						
						
							|  |  |                     <!--                        type="selection"-->
 | 
						
						
						
							|  |  |                     <!--                        width="55">-->
 | 
						
						
						
							|  |  |                     <!--                    </el-table-column>-->
 | 
						
						
						
							|  |  |                     <el-table-column label="序号" type="index" width="50"></el-table-column>
 | 
						
						
						
							|  |  |                     <el-table-column width="150"
 | 
						
						
						
							|  |  |                                      label="产品名称"
 | 
						
						
						
							|  |  |                                      prop="productName"
 | 
						
						
						
							|  |  |                                      show-overflow-tooltip
 | 
						
						
						
							|  |  |                     ></el-table-column>
 | 
						
						
						
							|  |  |                     <el-table-column width="150"
 | 
						
						
						
							|  |  |                                      label="规格型号"
 | 
						
						
						
							|  |  |                                      prop="spec"
 | 
						
						
						
							|  |  |                                      show-overflow-tooltip
 | 
						
						
						
							|  |  |                     ></el-table-column>
 | 
						
						
						
							|  |  |                     <el-table-column width="150" label="批次号">
 | 
						
						
						
							|  |  |                         <template slot-scope="scope">
 | 
						
						
						
							|  |  |                             <el-input size="small" v-model="scope.row.batchNo"
 | 
						
						
						
							|  |  |                                       :disabled="scope.row.index !== selectedIndex"
 | 
						
						
						
							|  |  |                                       ref='inputBatchNoRef'
 | 
						
						
						
							|  |  |                                       placeholder="请输入批次号" style="width: 80%"></el-input>
 | 
						
						
						
							|  |  |                         </template>
 | 
						
						
						
							|  |  |                     </el-table-column>
 | 
						
						
						
							|  |  |                     <el-table-column width="150" label="生产日期">
 | 
						
						
						
							|  |  |                         <template slot-scope="scope">
 | 
						
						
						
							|  |  |                             <el-input size="small" v-model="scope.row.productDate"
 | 
						
						
						
							|  |  |                                       :disabled="scope.row.index !== selectedIndex"
 | 
						
						
						
							|  |  |                                       placeholder="请输入生产日期" style="width: 80%"></el-input>
 | 
						
						
						
							|  |  |                         </template>
 | 
						
						
						
							|  |  |                     </el-table-column>
 | 
						
						
						
							|  |  |                     <el-table-column width="150" label="失效日期">
 | 
						
						
						
							|  |  |                         <template slot-scope="scope">
 | 
						
						
						
							|  |  |                             <el-input size="small" v-model="scope.row.expireDate"
 | 
						
						
						
							|  |  |                                       :disabled="scope.row.index !== selectedIndex"
 | 
						
						
						
							|  |  |                                       placeholder="请输入失效日期" style="width: 80%"></el-input>
 | 
						
						
						
							|  |  |                         </template>
 | 
						
						
						
							|  |  |                     </el-table-column>
 | 
						
						
						
							|  |  |                     <el-table-column width="150" label="产品数量">
 | 
						
						
						
							|  |  |                         <template slot-scope="scope">
 | 
						
						
						
							|  |  |                             <el-input size="small" v-model="scope.row.count"
 | 
						
						
						
							|  |  |                                       placeholder="请输入数量" style="width: 80%"
 | 
						
						
						
							|  |  |                                       @change="tableCountChange(scope.row)"
 | 
						
						
						
							|  |  |                                       :disabled="scope.row.index !== selectedIndex"
 | 
						
						
						
							|  |  |                                       oninput="value=value.replace(/[^\d]/g,'')"></el-input>
 | 
						
						
						
							|  |  |                         </template>
 | 
						
						
						
							|  |  |                     </el-table-column>
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                     <el-table-column width="150" label="产品价格">
 | 
						
						
						
							|  |  |                         <template slot-scope="scope">
 | 
						
						
						
							|  |  |                             <el-input size="small" v-model="scope.row.price"
 | 
						
						
						
							|  |  |                                       placeholder="请输入价格" style="width: 80%"
 | 
						
						
						
							|  |  |                                       oninput="value=value.replace(/[^\d]/g,'')"></el-input>
 | 
						
						
						
							|  |  |                         </template>
 | 
						
						
						
							|  |  |                     </el-table-column>
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                     <el-table-column width="150"
 | 
						
						
						
							|  |  |                                      label="批准文号"
 | 
						
						
						
							|  |  |                                      prop="zczbhhzbapzbh"
 | 
						
						
						
							|  |  |                                      show-overflow-tooltip
 | 
						
						
						
							|  |  |                     ></el-table-column>
 | 
						
						
						
							|  |  |                     <el-table-column width="150"
 | 
						
						
						
							|  |  |                                      label="生产厂家"
 | 
						
						
						
							|  |  |                                      prop="ylqxzcrbarmc"
 | 
						
						
						
							|  |  |                                      show-overflow-tooltip
 | 
						
						
						
							|  |  |                     ></el-table-column>
 | 
						
						
						
							|  |  |                     <el-table-column label="操作" fixed="right" width="150">
 | 
						
						
						
							|  |  |                         <template slot-scope="scope">
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                             <!--                            v-if="orderEditor && scope.row.index !== selectedIndex"-->
 | 
						
						
						
							|  |  |                             <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"-->
 | 
						
						
						
							|  |  |                             <!--                                v-if="orderEditor && scope.row.index === selectedIndex"-->
 | 
						
						
						
							|  |  |                             <!--                                :disabled="scope.row.index !== selectedIndex"-->
 | 
						
						
						
							|  |  |                             <!--                                @click.stop="true"-->
 | 
						
						
						
							|  |  |                             <!--                                @click.native="saveCodeArray(scope.$index, scope.row)"-->
 | 
						
						
						
							|  |  |                             <!--                            >保存-->
 | 
						
						
						
							|  |  |                             <!--                            </el-button-->
 | 
						
						
						
							|  |  |                             <!--                            >-->
 | 
						
						
						
							|  |  |                             <el-button
 | 
						
						
						
							|  |  |                                 type="text"
 | 
						
						
						
							|  |  |                                 size="small"
 | 
						
						
						
							|  |  |                                 @click.stop="true"
 | 
						
						
						
							|  |  |                                 @click.native="copyDetail(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>
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                 <!--                <div class="block" v-if="orderEditor">-->
 | 
						
						
						
							|  |  |                 <!--                    <el-pagination-->
 | 
						
						
						
							|  |  |                 <!--                        @current-change="handleCurrentChange"-->
 | 
						
						
						
							|  |  |                 <!--                        layout="prev, pager, next"-->
 | 
						
						
						
							|  |  |                 <!--                        :page-size="query.limit"-->
 | 
						
						
						
							|  |  |                 <!--                        :total="total">-->
 | 
						
						
						
							|  |  |                 <!--                    </el-pagination>-->
 | 
						
						
						
							|  |  |                 <!--                </div>-->
 | 
						
						
						
							|  |  |             </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>
 | 
						
						
						
							|  |  |     import {
 | 
						
						
						
							|  |  |         stockOrderDetail,
 | 
						
						
						
							|  |  |         submitStockOrder,
 | 
						
						
						
							|  |  |         submitStockOrderError,
 | 
						
						
						
							|  |  |         uploadStockOrderDetailCount,
 | 
						
						
						
							|  |  |         stockOrderGenerateBillNo,
 | 
						
						
						
							|  |  |         getStockOrderDetailInstrument,
 | 
						
						
						
							|  |  |         deleteStockOrderById,
 | 
						
						
						
							|  |  |         insertStockOrderWeb,
 | 
						
						
						
							|  |  |         stockOrderDetailTemp,
 | 
						
						
						
							|  |  |         deleteStockOrderDetailById,
 | 
						
						
						
							|  |  |         addStockOrderDetailFromCode,
 | 
						
						
						
							|  |  |         uploadStockOrderDetail,
 | 
						
						
						
							|  |  |         copyStockOrderDetail,
 | 
						
						
						
							|  |  |         stockOrderDetailQueryProduct,
 | 
						
						
						
							|  |  |         addStockOrderDetailFromCodeById, getStockOrderDetailInstrumentById, stockOrderDetail2
 | 
						
						
						
							|  |  |     } from "../../api/inout/stockOrder";
 | 
						
						
						
							|  |  |     import draggable from "vuedraggable";
 | 
						
						
						
							|  |  |     import {saveAs} from "file-saver";
 | 
						
						
						
							|  |  |     import {parseTime} from "../../filtres/index";
 | 
						
						
						
							|  |  |     import store from "../../store";
 | 
						
						
						
							|  |  |     import stockOrderNewSelectProduct from "./stockOrderNewSelectProduct";
 | 
						
						
						
							|  |  |     import {getBasicUnitMaintains, getBasicUnitMaintains2} from "../../api/basic/basicUnitMaintain";
 | 
						
						
						
							|  |  |     import {getBussinessType} from "../../api/basic/bussinessType";
 | 
						
						
						
							|  |  |     import {getLocalBusType} from "../../api/basic/busLocalType";
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |     export default {
 | 
						
						
						
							|  |  |         name: "idQuery",
 | 
						
						
						
							|  |  |         props: {
 | 
						
						
						
							|  |  |             closeDialog: {
 | 
						
						
						
							|  |  |                 type: Function,
 | 
						
						
						
							|  |  |                 required: true,
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             idQuery: {
 | 
						
						
						
							|  |  |                 type: Object,
 | 
						
						
						
							|  |  |                 required: true,
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             closeConfirmFunction: {
 | 
						
						
						
							|  |  |                 type: Function,
 | 
						
						
						
							|  |  |                 required: true,
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |         },
 | 
						
						
						
							|  |  |         data() {
 | 
						
						
						
							|  |  |             return {
 | 
						
						
						
							|  |  |                 code: "",
 | 
						
						
						
							|  |  |                 query: {
 | 
						
						
						
							|  |  |                     orderIdFk: "",
 | 
						
						
						
							|  |  |                     page: 1,
 | 
						
						
						
							|  |  |                     limit: 10,
 | 
						
						
						
							|  |  |                 },
 | 
						
						
						
							|  |  |                 fromOptions:[],
 | 
						
						
						
							|  |  |                 formData: {},
 | 
						
						
						
							|  |  |                 formRules: {
 | 
						
						
						
							|  |  |                     corpName: [
 | 
						
						
						
							|  |  |                         {required: true, message: "请输入供应商", trigger: "blur"}
 | 
						
						
						
							|  |  |                     ],
 | 
						
						
						
							|  |  |                     billdate: [
 | 
						
						
						
							|  |  |                         {required: true, message: "请输入单据日期", trigger: "blur"}
 | 
						
						
						
							|  |  |                     ],
 | 
						
						
						
							|  |  |                     billType: [
 | 
						
						
						
							|  |  |                         {required: true, message: "请选择业务类型", trigger: "blur"}
 | 
						
						
						
							|  |  |                     ],
 | 
						
						
						
							|  |  |                     type: [
 | 
						
						
						
							|  |  |                         {required: true, message: "请选择采购类型", trigger: "blur"}
 | 
						
						
						
							|  |  |                     ],
 | 
						
						
						
							|  |  |                 },
 | 
						
						
						
							|  |  |                 codeArray: [],
 | 
						
						
						
							|  |  |                 total: 0,
 | 
						
						
						
							|  |  |                 loading: false,
 | 
						
						
						
							|  |  |                 index: null,
 | 
						
						
						
							|  |  |                 formLoading: false,
 | 
						
						
						
							|  |  |                 formVisible: false,
 | 
						
						
						
							|  |  |                 deleteLoading: false,
 | 
						
						
						
							|  |  |                 orderNo: null,
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                 statusMap: {
 | 
						
						
						
							|  |  |                     101: "未处理",
 | 
						
						
						
							|  |  |                     102: "已处理",
 | 
						
						
						
							|  |  |                     201: "未配货",
 | 
						
						
						
							|  |  |                     202: "已配货",
 | 
						
						
						
							|  |  |                     301: "已打印",
 | 
						
						
						
							|  |  |                     401: "异常",
 | 
						
						
						
							|  |  |                     501: "未提交",
 | 
						
						
						
							|  |  |                     502: "已提交",
 | 
						
						
						
							|  |  |                 },
 | 
						
						
						
							|  |  |                 typeMap: {
 | 
						
						
						
							|  |  |                     1: "预入库",
 | 
						
						
						
							|  |  |                     2: "普通采购",
 | 
						
						
						
							|  |  |                 },
 | 
						
						
						
							|  |  |                 orderEditor: true,
 | 
						
						
						
							|  |  |                 iCount: 0,
 | 
						
						
						
							|  |  |                 sOptions: [],
 | 
						
						
						
							|  |  |                 sValue: [],
 | 
						
						
						
							|  |  |                 sList: [],
 | 
						
						
						
							|  |  |                 sLoading: false,
 | 
						
						
						
							|  |  |                 busTypes: [],
 | 
						
						
						
							|  |  |                 currentRow: {},
 | 
						
						
						
							|  |  |                 selectedIndex: "",
 | 
						
						
						
							|  |  |                 selectProductVisible: false,
 | 
						
						
						
							|  |  |                 thisData: {},
 | 
						
						
						
							|  |  |             };
 | 
						
						
						
							|  |  |         },
 | 
						
						
						
							|  |  |         components: {
 | 
						
						
						
							|  |  |             draggable,
 | 
						
						
						
							|  |  |             stockOrderNewSelectProduct,
 | 
						
						
						
							|  |  |         },
 | 
						
						
						
							|  |  |         methods: {
 | 
						
						
						
							|  |  |             saveOrder(status) {
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                 this.code = "";
 | 
						
						
						
							|  |  |                 this.$refs.multipleTable.setCurrentRow();
 | 
						
						
						
							|  |  |                 this.currentRow = {};
 | 
						
						
						
							|  |  |                 this.selectedIndex = "";
 | 
						
						
						
							|  |  |                 this.iCount = 0;
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                 this.$refs["dataForm"].validate(valid => {
 | 
						
						
						
							|  |  |                     if (valid) {
 | 
						
						
						
							|  |  |                         if (this.codeArray.length < 1) {
 | 
						
						
						
							|  |  |                             this.$message.warning('未添加产品');
 | 
						
						
						
							|  |  |                             return;
 | 
						
						
						
							|  |  |                         }
 | 
						
						
						
							|  |  |                         for (let i = 0; i < this.codeArray.length; i++) {
 | 
						
						
						
							|  |  |                             if (this.$isBlank(this.codeArray[i].batchNo)) {
 | 
						
						
						
							|  |  |                                 return this.$message.error('批次号不能为空');
 | 
						
						
						
							|  |  |                             }
 | 
						
						
						
							|  |  |                             if (this.$isBlank(this.codeArray[i].productDate)) {
 | 
						
						
						
							|  |  |                                 return this.$message.error('生产日期不能为空');
 | 
						
						
						
							|  |  |                             }
 | 
						
						
						
							|  |  |                             if (this.$isBlank(this.codeArray[i].expireDate)) {
 | 
						
						
						
							|  |  |                                 return this.$message.error('失效日期不能为空');
 | 
						
						
						
							|  |  |                             }
 | 
						
						
						
							|  |  |                         }
 | 
						
						
						
							|  |  |                         if (status === '501') {
 | 
						
						
						
							|  |  |                             this.submitFunction(status);
 | 
						
						
						
							|  |  |                         } else {
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                             if (status == "1") {
 | 
						
						
						
							|  |  |                                 this.submitFunction(status);
 | 
						
						
						
							|  |  |                             } else {
 | 
						
						
						
							|  |  |                                 this.$confirm("是否提交订单?", "提示", {
 | 
						
						
						
							|  |  |                                     confirmButtonText: "确定",
 | 
						
						
						
							|  |  |                                     cancelButtonText: "取消",
 | 
						
						
						
							|  |  |                                     type: "warning",
 | 
						
						
						
							|  |  |                                 }).then(() => {
 | 
						
						
						
							|  |  |                                     this.submitFunction(status);
 | 
						
						
						
							|  |  |                                 }).catch(() => {
 | 
						
						
						
							|  |  |                                     this.loading = false;
 | 
						
						
						
							|  |  |                                 });
 | 
						
						
						
							|  |  |                             }
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                         }
 | 
						
						
						
							|  |  |                     }
 | 
						
						
						
							|  |  |                 });
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             submitFunction(status) {
 | 
						
						
						
							|  |  |                 let tMessage = status === '501' ? '保存' : '提交';
 | 
						
						
						
							|  |  |                 this.loading = true;
 | 
						
						
						
							|  |  |                 let tQuery = this.formData;
 | 
						
						
						
							|  |  |                 tQuery.status = status;
 | 
						
						
						
							|  |  |                 // if (!this.orderEditor) {
 | 
						
						
						
							|  |  |                 tQuery.subErpOrders = this.codeArray;
 | 
						
						
						
							|  |  |                 if(status == '3'){
 | 
						
						
						
							|  |  |                     tQuery.subErpOrders.forEach((obj) => {
 | 
						
						
						
							|  |  |                         obj.reCount = obj.count;
 | 
						
						
						
							|  |  |                         console.log(obj.reCount);
 | 
						
						
						
							|  |  |                     });
 | 
						
						
						
							|  |  |                 }
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                 console.log(tQuery);
 | 
						
						
						
							|  |  |                 insertStockOrderWeb(tQuery)
 | 
						
						
						
							|  |  |                     .then(response => {
 | 
						
						
						
							|  |  |                         this.loading = false;
 | 
						
						
						
							|  |  |                         if (response.code === 20000) {
 | 
						
						
						
							|  |  |                             this.$message.success(tMessage + "成功");
 | 
						
						
						
							|  |  |                             this.closeDialog(true);
 | 
						
						
						
							|  |  |                         } else {
 | 
						
						
						
							|  |  |                             this.$message.error(response.message);
 | 
						
						
						
							|  |  |                         }
 | 
						
						
						
							|  |  |                     })
 | 
						
						
						
							|  |  |                     .catch(() => {
 | 
						
						
						
							|  |  |                         this.loading = false;
 | 
						
						
						
							|  |  |                     })
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             submit(formName) {
 | 
						
						
						
							|  |  |                 if (this.total < 1) {
 | 
						
						
						
							|  |  |                     this.$message.warning('未添加产品');
 | 
						
						
						
							|  |  |                     return;
 | 
						
						
						
							|  |  |                 }
 | 
						
						
						
							|  |  |                 this.$confirm("是否提交?", "提示", {
 | 
						
						
						
							|  |  |                     confirmButtonText: "确定",
 | 
						
						
						
							|  |  |                     cancelButtonText: "取消",
 | 
						
						
						
							|  |  |                     type: "warning",
 | 
						
						
						
							|  |  |                 }).then(() => {
 | 
						
						
						
							|  |  |                     let tQuery = {
 | 
						
						
						
							|  |  |                         id: this.idQuery.id
 | 
						
						
						
							|  |  |                     }
 | 
						
						
						
							|  |  |                     this.loading = true;
 | 
						
						
						
							|  |  |                     submitStockOrder(tQuery)
 | 
						
						
						
							|  |  |                         .then((response) => {
 | 
						
						
						
							|  |  |                             this.loading = false;
 | 
						
						
						
							|  |  |                             if (response.code === 20000) {
 | 
						
						
						
							|  |  |                                 this.$message.success("提交成功");
 | 
						
						
						
							|  |  |                                 this.closeDialog(true);
 | 
						
						
						
							|  |  |                             } else {
 | 
						
						
						
							|  |  |                                 this.$message.error(response.message);
 | 
						
						
						
							|  |  |                             }
 | 
						
						
						
							|  |  |                         });
 | 
						
						
						
							|  |  |                 }).catch(() => {
 | 
						
						
						
							|  |  |                     this.loading = false;
 | 
						
						
						
							|  |  |                 });
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             selectProductFunction(event) {
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                 if (event == null) {
 | 
						
						
						
							|  |  |                     this.$refs.inputRef.focus();
 | 
						
						
						
							|  |  |                 } else event.target.select();
 | 
						
						
						
							|  |  |                 if (this.$isBlank(event)) {
 | 
						
						
						
							|  |  |                     this.code = "";
 | 
						
						
						
							|  |  |                     this.$refs.multipleTable.setCurrentRow();
 | 
						
						
						
							|  |  |                     this.currentRow = {};
 | 
						
						
						
							|  |  |                     this.selectedIndex = "";
 | 
						
						
						
							|  |  |                     this.iCount = 0;
 | 
						
						
						
							|  |  |                     this.thisData.code = "";
 | 
						
						
						
							|  |  |                     this.thisData.orderEditor = this.orderEditor;
 | 
						
						
						
							|  |  |                     this.thisData.orderId = "";
 | 
						
						
						
							|  |  |                     if (this.orderEditor) {
 | 
						
						
						
							|  |  |                         this.thisData.orderId = this.formData.id
 | 
						
						
						
							|  |  |                     }
 | 
						
						
						
							|  |  |                     this.selectProductVisible = true;
 | 
						
						
						
							|  |  |                     return;
 | 
						
						
						
							|  |  |                 }
 | 
						
						
						
							|  |  |                 this.code = this.code.trim();
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                 if (this.code.length > 13) {
 | 
						
						
						
							|  |  |                     let tStr = this.code.substring(0, 2);
 | 
						
						
						
							|  |  |                     tStr = tStr.replace('m', 'M');
 | 
						
						
						
							|  |  |                     tStr = tStr.replace('a', 'A');
 | 
						
						
						
							|  |  |                     if (tStr.indexOf("MA") !== -1) {
 | 
						
						
						
							|  |  |                         this.code = tStr + this.code.substring(2, this.code.length);
 | 
						
						
						
							|  |  |                     }
 | 
						
						
						
							|  |  |                 }
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                 this.loading = true;
 | 
						
						
						
							|  |  |                 let tQuery = {
 | 
						
						
						
							|  |  |                     code: this.code,
 | 
						
						
						
							|  |  |                     customerId: store.getters.customerId,
 | 
						
						
						
							|  |  |                 };
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                 stockOrderDetailQueryProduct(tQuery).then((response) => {
 | 
						
						
						
							|  |  |                     this.loading = false;
 | 
						
						
						
							|  |  |                     console.log(response)
 | 
						
						
						
							|  |  |                     if (response.code === 20000) {
 | 
						
						
						
							|  |  |                         if (response.data.getType === "1") {
 | 
						
						
						
							|  |  |                             this.loading = true;
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                             let ids = [response.data.getId];
 | 
						
						
						
							|  |  |                             let tQuery2 = {
 | 
						
						
						
							|  |  |                                 ids: ids,
 | 
						
						
						
							|  |  |                                 udiEntity: response.data
 | 
						
						
						
							|  |  |                             };
 | 
						
						
						
							|  |  |                             getStockOrderDetailInstrumentById(tQuery2).then((response) => {
 | 
						
						
						
							|  |  |                                 this.loading = false;
 | 
						
						
						
							|  |  |                                 if (response.code === 20000) {
 | 
						
						
						
							|  |  |                                     this.closeDialogC2(response.data);
 | 
						
						
						
							|  |  |                                 } else {
 | 
						
						
						
							|  |  |                                     this.$message.error(response.message);
 | 
						
						
						
							|  |  |                                 }
 | 
						
						
						
							|  |  |                             }).catch(() => {
 | 
						
						
						
							|  |  |                                 this.loading = false;
 | 
						
						
						
							|  |  |                             });
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                             // let tQuery2 = {
 | 
						
						
						
							|  |  |                             //     id: response.data.getId
 | 
						
						
						
							|  |  |                             // };
 | 
						
						
						
							|  |  |                             // if (this.orderEditor) {
 | 
						
						
						
							|  |  |                             //     tQuery2.orderId = this.formData.id;
 | 
						
						
						
							|  |  |                             //     console.log(tQuery2)
 | 
						
						
						
							|  |  |                             //     addStockOrderDetailFromCodeById(tQuery2).then((response) => {
 | 
						
						
						
							|  |  |                             //         this.loading = false;
 | 
						
						
						
							|  |  |                             //         if (response.code === 20000) {
 | 
						
						
						
							|  |  |                             //             this.closeDialogC2(response);
 | 
						
						
						
							|  |  |                             //         } else {
 | 
						
						
						
							|  |  |                             //             this.$message.error(response.message);
 | 
						
						
						
							|  |  |                             //         }
 | 
						
						
						
							|  |  |                             //     }).catch(() => {
 | 
						
						
						
							|  |  |                             //         this.loading = false;
 | 
						
						
						
							|  |  |                             //     });
 | 
						
						
						
							|  |  |                             // } else {
 | 
						
						
						
							|  |  |                             //     getStockOrderDetailInstrumentById(tQuery2).then((response) => {
 | 
						
						
						
							|  |  |                             //         this.loading = false;
 | 
						
						
						
							|  |  |                             //         if (response.code === 20000) {
 | 
						
						
						
							|  |  |                             //             this.closeDialogC2(response.data);
 | 
						
						
						
							|  |  |                             //         } else {
 | 
						
						
						
							|  |  |                             //             this.$message.error(response.message);
 | 
						
						
						
							|  |  |                             //         }
 | 
						
						
						
							|  |  |                             //     }).catch(() => {
 | 
						
						
						
							|  |  |                             //         this.loading = false;
 | 
						
						
						
							|  |  |                             //     });
 | 
						
						
						
							|  |  |                             // }
 | 
						
						
						
							|  |  |                         } else {
 | 
						
						
						
							|  |  |                             this.thisData = response.data;
 | 
						
						
						
							|  |  |                             this.thisData.code = this.code;
 | 
						
						
						
							|  |  |                             this.thisData.orderEditor = this.orderEditor;
 | 
						
						
						
							|  |  |                             this.thisData.orderId = "";
 | 
						
						
						
							|  |  |                             if (this.orderEditor) {
 | 
						
						
						
							|  |  |                                 this.thisData.orderId = this.formData.id
 | 
						
						
						
							|  |  |                             }
 | 
						
						
						
							|  |  |                             this.selectProductVisible = true;
 | 
						
						
						
							|  |  |                         }
 | 
						
						
						
							|  |  |                     } else {
 | 
						
						
						
							|  |  |                         this.$message.warning(response.message);
 | 
						
						
						
							|  |  |                         this.focusNext('inputRef');
 | 
						
						
						
							|  |  |                         if (this.$isNotBlank(event)) {
 | 
						
						
						
							|  |  |                             event.target.select();
 | 
						
						
						
							|  |  |                         }
 | 
						
						
						
							|  |  |                         // event.target.select();
 | 
						
						
						
							|  |  |                         // event.currentTarget.select();
 | 
						
						
						
							|  |  |                     }
 | 
						
						
						
							|  |  |                 });
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             closeDialogC2(rData) {//012693548470801311200226172302271020022632100025
 | 
						
						
						
							|  |  |                 this.selectProductVisible = false;
 | 
						
						
						
							|  |  |                 this.thisData = {};
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                 if (this.$isNotBlank(rData)) {
 | 
						
						
						
							|  |  |                     console.log(rData)
 | 
						
						
						
							|  |  |                     rData.forEach((obj, index) => {
 | 
						
						
						
							|  |  |                         if (this.codeArray.length === 0) {
 | 
						
						
						
							|  |  |                             this.codeArray.push(obj);
 | 
						
						
						
							|  |  |                         } else {
 | 
						
						
						
							|  |  |                             this.codeArray.unshift(obj);
 | 
						
						
						
							|  |  |                         }
 | 
						
						
						
							|  |  |                     });
 | 
						
						
						
							|  |  |                     this.$refs.multipleTable.setCurrentRow(this.codeArray[0]);
 | 
						
						
						
							|  |  |                     this.currentRow = this.codeArray[0];
 | 
						
						
						
							|  |  |                     this.selectedIndex = 0;
 | 
						
						
						
							|  |  |                     this.focusNext('iCount');
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                     this.closeConfirmFunction(true);
 | 
						
						
						
							|  |  |                 }
 | 
						
						
						
							|  |  |                 // if (this.orderEditor) {
 | 
						
						
						
							|  |  |                 //     this.getStockOrderDetailList();
 | 
						
						
						
							|  |  |                 //     if (this.$isNotBlank(rData)) {
 | 
						
						
						
							|  |  |                 //         this.$refs.multipleTable.setCurrentRow(this.codeArray[0]);
 | 
						
						
						
							|  |  |                 //         this.currentRow = this.codeArray[0];
 | 
						
						
						
							|  |  |                 //         this.selectedIndex = 0;
 | 
						
						
						
							|  |  |                 //         this.focusNext('iCount');
 | 
						
						
						
							|  |  |                 //     }
 | 
						
						
						
							|  |  |                 // } else {
 | 
						
						
						
							|  |  |                 //     if (this.$isNotBlank(rData)) {
 | 
						
						
						
							|  |  |                 //         // for (let i = 0; i < this.codeArray.length; i++) {
 | 
						
						
						
							|  |  |                 //         //     if (this.codeArray[i].productId === rData.productId) {
 | 
						
						
						
							|  |  |                 //         //         this.$alert("已添加", '提示', {
 | 
						
						
						
							|  |  |                 //         //             confirmButtonText: '确定',
 | 
						
						
						
							|  |  |                 //         //             type: 'warning',
 | 
						
						
						
							|  |  |                 //         //             closeOnClickModal: true,
 | 
						
						
						
							|  |  |                 //         //             callback: action => {
 | 
						
						
						
							|  |  |                 //         //                 this.$refs.inputRef.focus();
 | 
						
						
						
							|  |  |                 //         //             }
 | 
						
						
						
							|  |  |                 //         //         });
 | 
						
						
						
							|  |  |                 //         //         break;
 | 
						
						
						
							|  |  |                 //         //     }
 | 
						
						
						
							|  |  |                 //         //     if (i + 1 === this.codeArray.length) {
 | 
						
						
						
							|  |  |                 //         //         this.codeArray.push(rData);
 | 
						
						
						
							|  |  |                 //         //         this.$refs.multipleTable.setCurrentRow(this.codeArray[0]);
 | 
						
						
						
							|  |  |                 //         //         this.currentRow = this.codeArray[0];
 | 
						
						
						
							|  |  |                 //         //         this.selectedIndex = 0;
 | 
						
						
						
							|  |  |                 //         //     }
 | 
						
						
						
							|  |  |                 //         // }
 | 
						
						
						
							|  |  |                 //     }
 | 
						
						
						
							|  |  |                 // }
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             rowChange(val) {
 | 
						
						
						
							|  |  |                 this.currentRow = val;
 | 
						
						
						
							|  |  |                 this.selectedIndex = val.index;
 | 
						
						
						
							|  |  |                 this.iCount = val.count;
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                 this.focusNext('iCount');
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                 // let sc = this.selectedIndex + 'reCount';
 | 
						
						
						
							|  |  |                 // const _this = this;
 | 
						
						
						
							|  |  |                 // this.$nextTick(() => {
 | 
						
						
						
							|  |  |                 //     setTimeout(function() {
 | 
						
						
						
							|  |  |                 //         console.log(sc);
 | 
						
						
						
							|  |  |                 //         console.log(_this.$refs[sc]);
 | 
						
						
						
							|  |  |                 //         console.log(_this.$refs[sc].focus());
 | 
						
						
						
							|  |  |                 //         _this.$refs[sc].focus();
 | 
						
						
						
							|  |  |                 //     }, 1)
 | 
						
						
						
							|  |  |                 //     // this.$refs['inputBatchNoRef'][0].focus()
 | 
						
						
						
							|  |  |                 // })
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             iCountChange() {
 | 
						
						
						
							|  |  |                 // console.log(this.iCount)
 | 
						
						
						
							|  |  |                 // this.currentRow.count = this.iCount;
 | 
						
						
						
							|  |  |                 // this.currentRow.reCount = this.iCount;
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             iCountEnterFunction() {
 | 
						
						
						
							|  |  |                 if (this.$isNotBlank(this.currentRow)) {
 | 
						
						
						
							|  |  |                     this.currentRow.count = this.iCount;
 | 
						
						
						
							|  |  |                     // this.currentRow.reCount = this.iCount;
 | 
						
						
						
							|  |  |                 }
 | 
						
						
						
							|  |  |                 this.focusNext('inputRef');
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             tableCountChange(row) {
 | 
						
						
						
							|  |  |                 if (this.$isNotBlank(row)) {
 | 
						
						
						
							|  |  |                     // row.count = row.reCount;
 | 
						
						
						
							|  |  |                 }
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             tableRowClassName({row, rowIndex}) {
 | 
						
						
						
							|  |  |                 row.index = rowIndex;
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             focusNext(nextRef) {
 | 
						
						
						
							|  |  |                 this.$refs[nextRef].focus()
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             focusNextToTable(nextRef) {
 | 
						
						
						
							|  |  |                 this.$refs[nextRef][0].focus()
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             remoteMethod(query) {
 | 
						
						
						
							|  |  |                 if (query !== '') {
 | 
						
						
						
							|  |  |                     this.sLoading = true;
 | 
						
						
						
							|  |  |                     let tQuery = {
 | 
						
						
						
							|  |  |                         key: query,
 | 
						
						
						
							|  |  |                         page: 1,
 | 
						
						
						
							|  |  |                         limit: 20,
 | 
						
						
						
							|  |  |                     };
 | 
						
						
						
							|  |  |                     getBasicUnitMaintains2(tQuery)
 | 
						
						
						
							|  |  |                         .then((response) => {
 | 
						
						
						
							|  |  |                             console.log(response)
 | 
						
						
						
							|  |  |                             this.sLoading = false;
 | 
						
						
						
							|  |  |                             this.sOptions = response.data.list;
 | 
						
						
						
							|  |  |                         })
 | 
						
						
						
							|  |  |                         .catch(() => {
 | 
						
						
						
							|  |  |                             this.sLoading = false;
 | 
						
						
						
							|  |  |                             this.sOptions = [];
 | 
						
						
						
							|  |  |                         });
 | 
						
						
						
							|  |  |                 } else {
 | 
						
						
						
							|  |  |                     this.sOptions = [];
 | 
						
						
						
							|  |  |                 }
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             findMethod(query) {
 | 
						
						
						
							|  |  |                 console.log(query);
 | 
						
						
						
							|  |  |                 this.fromOptions = [];
 | 
						
						
						
							|  |  |                 let cQuery = {
 | 
						
						
						
							|  |  |                     key: query,
 | 
						
						
						
							|  |  |                 };
 | 
						
						
						
							|  |  |                 getBasicUnitMaintains(cQuery)
 | 
						
						
						
							|  |  |                     .then((response) => {
 | 
						
						
						
							|  |  |                         this.loading = false;
 | 
						
						
						
							|  |  |                         this.fromOptions = response.data.page.list || [];
 | 
						
						
						
							|  |  |                     })
 | 
						
						
						
							|  |  |                     .catch(() => {
 | 
						
						
						
							|  |  |                         this.loading = false;
 | 
						
						
						
							|  |  |                     });
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             // 刷新表单
 | 
						
						
						
							|  |  |             resetForm() {
 | 
						
						
						
							|  |  |                 if (this.$refs["dataForm"]) {
 | 
						
						
						
							|  |  |                     // 清空验证信息表单
 | 
						
						
						
							|  |  |                     this.$refs["dataForm"].clearValidate();
 | 
						
						
						
							|  |  |                     // 刷新表单
 | 
						
						
						
							|  |  |                     this.$refs["dataForm"].resetFields();
 | 
						
						
						
							|  |  |                     this.getList();
 | 
						
						
						
							|  |  |                 }
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             unitChange(row) {
 | 
						
						
						
							|  |  |                 console.log(row);
 | 
						
						
						
							|  |  |                 this.formData.corpId = row.erpId;
 | 
						
						
						
							|  |  |                 this.formData.corpName = row.name;
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             addCode() {
 | 
						
						
						
							|  |  |                 this.code = this.code.trim();
 | 
						
						
						
							|  |  |                 if (this.$isBlank(this.code)) {
 | 
						
						
						
							|  |  |                     this.$message.warning('请输入条码');
 | 
						
						
						
							|  |  |                     return;
 | 
						
						
						
							|  |  |                 }
 | 
						
						
						
							|  |  |                 if (this.iCount <= 0) {
 | 
						
						
						
							|  |  |                     this.$message.warning('请输入数量');
 | 
						
						
						
							|  |  |                     return;
 | 
						
						
						
							|  |  |                 }
 | 
						
						
						
							|  |  |                 this.loading = true;
 | 
						
						
						
							|  |  |                 let tQuery = {
 | 
						
						
						
							|  |  |                     orderId: this.formData.id,
 | 
						
						
						
							|  |  |                     count: this.iCount,
 | 
						
						
						
							|  |  |                     code: this.code,
 | 
						
						
						
							|  |  |                 };
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                 //012693548470801311200226172302271020022632100025
 | 
						
						
						
							|  |  |                 if (this.orderEditor) {
 | 
						
						
						
							|  |  |                     addStockOrderDetailFromCode(tQuery).then((response) => {
 | 
						
						
						
							|  |  |                         this.loading = false;
 | 
						
						
						
							|  |  |                         if (response.code === 20000) {
 | 
						
						
						
							|  |  |                             this.getStockOrderDetailList();
 | 
						
						
						
							|  |  |                         } else {
 | 
						
						
						
							|  |  |                             this.$alert(response.message, '提示', {
 | 
						
						
						
							|  |  |                                 confirmButtonText: '确定',
 | 
						
						
						
							|  |  |                                 type: 'warning',
 | 
						
						
						
							|  |  |                                 closeOnClickModal: true,
 | 
						
						
						
							|  |  |                                 callback: action => {
 | 
						
						
						
							|  |  |                                     this.$refs.inputRef.focus();
 | 
						
						
						
							|  |  |                                 }
 | 
						
						
						
							|  |  |                             });
 | 
						
						
						
							|  |  |                         }
 | 
						
						
						
							|  |  |                     });
 | 
						
						
						
							|  |  |                 } else {
 | 
						
						
						
							|  |  |                     getStockOrderDetailInstrument(tQuery).then((response) => {
 | 
						
						
						
							|  |  |                         this.loading = false;
 | 
						
						
						
							|  |  |                         if (response.code === 20000) {
 | 
						
						
						
							|  |  |                             for (let i = 0; i < this.codeArray.length; i++) {
 | 
						
						
						
							|  |  |                                 if (this.codeArray[i].productId === response.data.productId) {
 | 
						
						
						
							|  |  |                                     this.$alert("已添加", '提示', {
 | 
						
						
						
							|  |  |                                         confirmButtonText: '确定',
 | 
						
						
						
							|  |  |                                         type: 'warning',
 | 
						
						
						
							|  |  |                                         closeOnClickModal: true,
 | 
						
						
						
							|  |  |                                         callback: action => {
 | 
						
						
						
							|  |  |                                             this.$refs.inputRef.focus();
 | 
						
						
						
							|  |  |                                         }
 | 
						
						
						
							|  |  |                                     });
 | 
						
						
						
							|  |  |                                     break;
 | 
						
						
						
							|  |  |                                 }
 | 
						
						
						
							|  |  |                                 if (i + 1 === this.codeArray.length) {
 | 
						
						
						
							|  |  |                                     this.codeArray.push(response.data);
 | 
						
						
						
							|  |  |                                 }
 | 
						
						
						
							|  |  |                             }
 | 
						
						
						
							|  |  |                             if (this.codeArray.length === 0) {
 | 
						
						
						
							|  |  |                                 this.codeArray.push(response.data);
 | 
						
						
						
							|  |  |                             }
 | 
						
						
						
							|  |  |                         } else {
 | 
						
						
						
							|  |  |                             this.$alert(response.message, '提示', {
 | 
						
						
						
							|  |  |                                 confirmButtonText: '确定',
 | 
						
						
						
							|  |  |                                 type: 'warning',
 | 
						
						
						
							|  |  |                                 closeOnClickModal: true,
 | 
						
						
						
							|  |  |                                 callback: action => {
 | 
						
						
						
							|  |  |                                     this.$refs.inputRef.focus();
 | 
						
						
						
							|  |  |                                 }
 | 
						
						
						
							|  |  |                             });
 | 
						
						
						
							|  |  |                         }
 | 
						
						
						
							|  |  |                     });
 | 
						
						
						
							|  |  |                 }
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             saveCodeArray(index, row) {
 | 
						
						
						
							|  |  |                 if (this.$isBlank(row.batchNo)) {
 | 
						
						
						
							|  |  |                     return this.$message.error('批次号不能为空');
 | 
						
						
						
							|  |  |                 }
 | 
						
						
						
							|  |  |                 if (this.$isBlank(row.productDate)) {
 | 
						
						
						
							|  |  |                     return this.$message.error('生产日期不能为空');
 | 
						
						
						
							|  |  |                 }
 | 
						
						
						
							|  |  |                 if (this.$isBlank(row.expireDate)) {
 | 
						
						
						
							|  |  |                     return this.$message.error('失效日期不能为空');
 | 
						
						
						
							|  |  |                 }
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                 this.$refs.multipleTable.setCurrentRow();
 | 
						
						
						
							|  |  |                 this.currentRow = {};
 | 
						
						
						
							|  |  |                 this.selectedIndex = "";
 | 
						
						
						
							|  |  |                 this.iCount = 0;
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                 this.detailLoading = true;
 | 
						
						
						
							|  |  |                 // row.count = row.reCount;
 | 
						
						
						
							|  |  |                 let tQuery = row;
 | 
						
						
						
							|  |  |                 uploadStockOrderDetail(tQuery).then((response) => {
 | 
						
						
						
							|  |  |                     this.detailLoading = false;
 | 
						
						
						
							|  |  |                     if (response.code === 20000) {
 | 
						
						
						
							|  |  |                         this.$message.success("修改完成");
 | 
						
						
						
							|  |  |                         this.getStockOrderDetailList();
 | 
						
						
						
							|  |  |                         this.$refs.inputRef.focus();
 | 
						
						
						
							|  |  |                     } else {
 | 
						
						
						
							|  |  |                         this.$message.error(response.message);
 | 
						
						
						
							|  |  |                     }
 | 
						
						
						
							|  |  |                 });
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             deleteCodeArray(index, row) {
 | 
						
						
						
							|  |  |                 this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
 | 
						
						
						
							|  |  |                     confirmButtonText: "确定",
 | 
						
						
						
							|  |  |                     cancelButtonText: "取消",
 | 
						
						
						
							|  |  |                     type: "warning",
 | 
						
						
						
							|  |  |                 }).then(() => {
 | 
						
						
						
							|  |  |                     this.$refs.multipleTable.setCurrentRow();
 | 
						
						
						
							|  |  |                     this.currentRow = {};
 | 
						
						
						
							|  |  |                     this.selectedIndex = "";
 | 
						
						
						
							|  |  |                     this.iCount = 0;
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                     if (this.orderEditor) {
 | 
						
						
						
							|  |  |                         this.detailLoading = true;
 | 
						
						
						
							|  |  |                         if (this.$isNotBlank(row.id)) {
 | 
						
						
						
							|  |  |                             deleteStockOrderDetailById({id: 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);
 | 
						
						
						
							|  |  |                     }
 | 
						
						
						
							|  |  |                 }).catch(() => {
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                 });
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             copyDetail(row) {
 | 
						
						
						
							|  |  |                 this.$confirm("是否复制该记录?", "提示", {
 | 
						
						
						
							|  |  |                     confirmButtonText: "确定",
 | 
						
						
						
							|  |  |                     cancelButtonText: "取消",
 | 
						
						
						
							|  |  |                     type: "warning",
 | 
						
						
						
							|  |  |                 }).then(() => {
 | 
						
						
						
							|  |  |                     // let tQuery = {
 | 
						
						
						
							|  |  |                     //     id: row.id
 | 
						
						
						
							|  |  |                     // }
 | 
						
						
						
							|  |  |                     // this.detailLoading = true;
 | 
						
						
						
							|  |  |                     // copyStockOrderDetail(tQuery)
 | 
						
						
						
							|  |  |                     //     .then((response) => {
 | 
						
						
						
							|  |  |                     //         this.detailLoading = false;
 | 
						
						
						
							|  |  |                     //         if (response.code === 20000) {
 | 
						
						
						
							|  |  |                     //             this.$message.success("复制成功");
 | 
						
						
						
							|  |  |                     //             this.getStockOrderDetailList();
 | 
						
						
						
							|  |  |                     //         } else {
 | 
						
						
						
							|  |  |                     //             this.$message.error(response.message);
 | 
						
						
						
							|  |  |                     //         }
 | 
						
						
						
							|  |  |                     //     });
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |                     let rData = JSON.parse(JSON.stringify(row));
 | 
						
						
						
							|  |  |                     rData.id = null;
 | 
						
						
						
							|  |  |                     if (this.codeArray.length === 0) {
 | 
						
						
						
							|  |  |                         this.codeArray.push(rData);
 | 
						
						
						
							|  |  |                         this.$refs.multipleTable.setCurrentRow(this.codeArray[0]);
 | 
						
						
						
							|  |  |                         this.currentRow = this.codeArray[0];
 | 
						
						
						
							|  |  |                         this.selectedIndex = 0;
 | 
						
						
						
							|  |  |                     } else {
 | 
						
						
						
							|  |  |                         this.codeArray.unshift(rData);
 | 
						
						
						
							|  |  |                         this.$refs.multipleTable.setCurrentRow(this.codeArray[0]);
 | 
						
						
						
							|  |  |                         this.currentRow = this.codeArray[0];
 | 
						
						
						
							|  |  |                         this.selectedIndex = 0;
 | 
						
						
						
							|  |  |                     }
 | 
						
						
						
							|  |  |                     this.$message.success("复制成功");
 | 
						
						
						
							|  |  |                     this.iCount = this.currentRow.count;
 | 
						
						
						
							|  |  |                     this.focusNext('iCount');
 | 
						
						
						
							|  |  |                 }).catch(() => {
 | 
						
						
						
							|  |  |                 });
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             getInputFocus(event) {
 | 
						
						
						
							|  |  |                 event.currentTarget.select();
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             tableSelection() {
 | 
						
						
						
							|  |  |                 this.$refs.multipleTable.clearSelection();
 | 
						
						
						
							|  |  |                 this.$refs.multipleTable.toggleAllSelection();
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             handleSizeChange(val) {
 | 
						
						
						
							|  |  |                 this.query.limit = val;
 | 
						
						
						
							|  |  |                 this.getStockOrderDetailList();
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             handleCurrentChange(val) {
 | 
						
						
						
							|  |  |                 this.query.page = val;
 | 
						
						
						
							|  |  |                 this.getStockOrderDetailList();
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             getStockOrderDetailList() {
 | 
						
						
						
							|  |  |                 this.loading = true;
 | 
						
						
						
							|  |  |                 stockOrderDetail(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;
 | 
						
						
						
							|  |  |                     });
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             intentBack() {
 | 
						
						
						
							|  |  |                 this.$router.go(-1);
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             generateBillNo() {
 | 
						
						
						
							|  |  |                 let tQuery = {
 | 
						
						
						
							|  |  |                     action: this.formData.billType
 | 
						
						
						
							|  |  |                 }
 | 
						
						
						
							|  |  |                 this.loading = true;
 | 
						
						
						
							|  |  |                 stockOrderGenerateBillNo(tQuery)
 | 
						
						
						
							|  |  |                     .then((response) => {
 | 
						
						
						
							|  |  |                         this.loading = false;
 | 
						
						
						
							|  |  |                         if (response.code === 20000) {
 | 
						
						
						
							|  |  |                             this.formData.billNo = response.data;
 | 
						
						
						
							|  |  |                             // this.formData.billdate = parseTime(new Date(), '{y}{m}{d}');
 | 
						
						
						
							|  |  |                             this.formData.billdate = new Date();
 | 
						
						
						
							|  |  |                         } else {
 | 
						
						
						
							|  |  |                             this.closeDialog(true);
 | 
						
						
						
							|  |  |                         }
 | 
						
						
						
							|  |  |                     });
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |             getBusType() {
 | 
						
						
						
							|  |  |                 let query = {
 | 
						
						
						
							|  |  |                     enabled: true,
 | 
						
						
						
							|  |  |                 };
 | 
						
						
						
							|  |  |                 getLocalBusType(query)
 | 
						
						
						
							|  |  |                     .then((response) => {
 | 
						
						
						
							|  |  |                         this.busTypes = response.data.list || [];
 | 
						
						
						
							|  |  |                     })
 | 
						
						
						
							|  |  |                     .catch(() => {
 | 
						
						
						
							|  |  |                     });
 | 
						
						
						
							|  |  |             },
 | 
						
						
						
							|  |  |         },
 | 
						
						
						
							|  |  |         filters: {},
 | 
						
						
						
							|  |  |         mounted() {
 | 
						
						
						
							|  |  |             document.body.ondrop = function (event) {
 | 
						
						
						
							|  |  |                 event.preventDefault();
 | 
						
						
						
							|  |  |                 event.stopPropagation();
 | 
						
						
						
							|  |  |             };
 | 
						
						
						
							|  |  |         },
 | 
						
						
						
							|  |  |         created() {
 | 
						
						
						
							|  |  |             this.getBusType();
 | 
						
						
						
							|  |  |             this.formData = {};
 | 
						
						
						
							|  |  |             this.codeArray = [];
 | 
						
						
						
							|  |  |             this.closeConfirmFunction(false);
 | 
						
						
						
							|  |  |             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 = {
 | 
						
						
						
							|  |  |                     billdate: "",
 | 
						
						
						
							|  |  |                     corpName: store.getters.companyName,
 | 
						
						
						
							|  |  |                     customerId: store.getters.customerId,
 | 
						
						
						
							|  |  |                     // billType: "deliveryNote",
 | 
						
						
						
							|  |  |                     billType: "",
 | 
						
						
						
							|  |  |                     type: "2",
 | 
						
						
						
							|  |  |                     // type: "",
 | 
						
						
						
							|  |  |                 };
 | 
						
						
						
							|  |  |                 this.iCount = 0;
 | 
						
						
						
							|  |  |                 this.orderEditor = false;
 | 
						
						
						
							|  |  |                 this.generateBillNo();
 | 
						
						
						
							|  |  |             }
 | 
						
						
						
							|  |  |         },
 | 
						
						
						
							|  |  |     };
 | 
						
						
						
							|  |  | </script>
 | 
						
						
						
							|  |  | <style>
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  |     .ao-text {
 | 
						
						
						
							|  |  |         width: 100%;
 | 
						
						
						
							|  |  |         font-size: 13px;
 | 
						
						
						
							|  |  |         font-family: "Microsoft YaHei";
 | 
						
						
						
							|  |  |         float: right;
 | 
						
						
						
							|  |  |         text-align: right;
 | 
						
						
						
							|  |  |         margin-top: 10px;
 | 
						
						
						
							|  |  |     }
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  | </style>
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  | 
 | 
						
						
						
							|  |  | 
 |