<!-- Wappler include head-page="layouts/smain" fontawesome_5="cdn" bootstrap5="local" is="dmx-app" id="dspeckit" appConnect="local" components="{dmxNotifications:{},dmxBootstrap5Navigation:{},dmxAutocomplete:{},dmxStateManagement:{},dmxBootstrap5Modal:{},dmxBootstrap5TableGenerator:{}}" -->
<dmx-serverconnect id="conn_partssearch" url="/api/DSpec/searchpn" dmx-param:pn="" noload="true"></dmx-serverconnect>
<meta name="ac:route" content="/dspeckit">
<script is="dmx-flow" id="flow1" type="text/dmx-flow" autorun="true">{
  condition: {
    if: "{{query1.data.id}}",
    then: {
      steps: {
        run: {action: "{{var_partid.setValue(query1.data.id)}}", outputType: "text"}
      }
    },
    else: {
      steps: {
        run: {action: "{{api_allparttypes.load({})}}", outputType: "text"}
      }
    },
    outputType: "boolean"
  }
}</script>
<dmx-query-manager id="query1"></dmx-query-manager>
<div class="container visually-hidden">
    <div class="row">
        <div class="col">
            <input id="txt_useriddefault" name="useriddefault" type="text" class="form-control" value="-1">
            <input id="txt_testviewlocatioonid" name="viewlocationid" type="text" class="form-control" value="14">
            <input id="txt_testpartid" name="testpartid" type="text" class="form-control" dmx-bind:value="api_postpart.data.id">
        </div>
    </div>
</div>
<dmx-value id="var_comment"></dmx-value>
<dmx-value id="var_copy" dmx-bind:value="false"></dmx-value>
<dmx-value id="var_description"></dmx-value>
<dmx-value id="var_dspecid" dmx-bind:value="0"></dmx-value>
<dmx-value id="var_existingpartid" dmx-bind:value="0" dmx-on:updated=""></dmx-value>
<dmx-value id="var_listmaxdspec" dmx-on:updated="var_dspecid.setValue(value.getValueOrKey('id'))"></dmx-value>
<dmx-value id="var_newdspec" dmx-bind:value="0"></dmx-value>
<dmx-value id="var_partnumber" dmx-bind:value="var_parttypeid.value.toNumber().toString().concat('-'.concat(var_partcodeid.value.concat('-'.concat(api_maxpn.data.number))))"></dmx-value>
<dmx-value id="var_partcodeid" dmx-on:updated="api_getpartcodebyid.load({})"></dmx-value>
<dmx-value id="var_partid" dmx-bind:value="0" dmx-on:updated="api_getnewpartinfo.load({})"></dmx-value>
<dmx-value id="var_parttypeid"></dmx-value>
<dmx-value id="var_prevdspecid"></dmx-value>
<dmx-value id="var_rev" dmx-bind:value="0"></dmx-value>
<dmx-value id="var_statusid" dmx-bind:value="1"></dmx-value>
<dmx-value id="var_statusiddspec" dmx-bind:value="4"></dmx-value>
<dmx-value id="var_viewlocationid" dmx-bind:value="14"></dmx-value>
<dmx-value id="var_bominsertold"></dmx-value>
<dmx-value id="var_bominsertnew"></dmx-value>
<dmx-value id="var_bominsertpnid" dmx-on:updated="api_bominsertitem.load({})"></dmx-value>










<dmx-api-action id="api_allparttypes" dmx-bind:url="pg_apiurl.value.concat('parttypes')" dmx-on:success="mdl_newpart.inp_parttypes.setValue(-1)" noload="true"></dmx-api-action>
<dmx-api-action id="api_bominsertitem" noload="true" url="http://vapor.prelub.com/api/v1.0/boms/wapplerinsert" method="post" data-type="json" dmx-bind:url="pg_apiurl.value.concat('boms/wapplerinsert')" dmx-data:updatedate="NOW" dmx-data:viewlocationid="var_viewlocationid.value.toString()" dmx-data:old="var_bominsertold.value.toString()" dmx-data:createdate="NOW" dmx-data:designspecid="var_dspecid.value.toNumber().toString()" dmx-data:createuserid="txt_useriddefault.value" dmx-data:new="var_bominsertnew.value.toString()" dmx-data:updateuserid="txt_useriddefault.value" dmx-data:partnumberid="var_bominsertpnid.value.toString()" dmx-on:success="api_loadbombydspec.load({},true)"></dmx-api-action>
<dmx-api-action id="api_bomcopyitem" noload="true" url="http://vapor.prelub.com/api/v1.0/boms/copy/33760/33758" method="put" data-type="json" dmx-bind:url="pg_apiurl.value.concat('boms/copy/'.concat(mod_cpybom.inp_cpynewdspecid.value.concat('/'.concat(mod_cpybom.inp_cpyolddspecid.value))))" dmx-on:success="api_loadbombydspec.load({},true)"></dmx-api-action>
<dmx-api-action id="api_bompartselectbynumber" noload="true" url="http://vapor.prelub.com/api/v1.0/partnumbers/num/" dmx-bind:url="pg_apiurl.value.concat('partnumbers/num/'.concat(var_partsearch.value))"></dmx-api-action>
<dmx-api-action id="api_customers" url="http://vapor.prelub.com/api/v1.0/customers" dmx-bind:url="pg_apiurl.value.concat('customers')"></dmx-api-action>


<dmx-api-action id="api_loaddspec" noload="true" url="http://vapor.prelub.com/api/v1.0/designspecs/32458" dmx-bind:url="pg_apiurl.value.concat('designspecs/'.concat(var_dspecid.value))" dmx-on:success="api_loadbombydspec.load({});view_rev.setValue(api_loaddspec.data.revisionlevel);view_partcode.setValue(api_getnewpartinfo.data.partcode.name);view_obsolete.select((api_getnewpartinfo.data.status.id == 2));view_replacedby.setValue(api_getnewpartinfo.data.replacedby.number);view_description.setValue(api_getnewpartinfo.data.description);view_comments.setValue(api_getnewpartinfo.data.comments);inp_reasonforchange.setValue(api_loaddspec.data.reasonforchange);inp_validation.setValue(api_loaddspec.data.validation);inp_notes.setValue(api_loaddspec.data.note);api_getapps.load({})"></dmx-api-action>
<dmx-api-action id="api_loadexistingdspec" noload="true" url="http://vapor.prelub.com/api/v1.0/designspecs/max/106691" dmx-bind:url="pg_apiurl.value.concat('designspecs/max/'.concat(var_partid.value))" dmx-on:success="run([{run:{action:`var_dspecid.setValue(api_loadexistingdspec.data)`,outputType:'text'}},{run:{action:`api_loaddspec.load({})`,outputType:'text'}}])"></dmx-api-action>
<dmx-api-action id="api_filteredpartcodes" noload="true" url="http://vapor.prelub.com/api/v1.0/partcodes/bytype/6" dmx-bind:url="pg_apiurl.value.concat('partcodes/bytype/'.concat(mdl_newpart.inp_parttypes.value))"></dmx-api-action>
<dmx-api-action id="api_getnewpartinfo" noload="true" dmx-bind:url="pg_apiurl.value.concat('partnumbers/id/'.concat(var_partid.value))" dmx-on:success="run([{run:{action:`view_partnumber.setValue(api_getnewpartinfo.data.number)`,outputType:'text'}},{run:{action:`var_parttypeid.setValue(api_getnewpartinfo.data.partcode.parttype.id);var_partcodeid.setValue(api_getnewpartinfo.data.partcode.id);var_partnumber.setValue(api_getnewpartinfo.data.number);var_description.setValue(api_getnewpartinfo.data.description);var_comment.setValue(api_getnewpartinfo.data.comments)`,outputType:'text'}},{condition:{if:`query1.data.id`,then:{steps:{run:{action:`api_loadexistingdspec.load({})`,outputType:'text'}}},outputType:'boolean'}}])"></dmx-api-action>
<dmx-api-action id="api_getpartcodebyid" dmx-bind:url="pg_apiurl.value.concat('partcodes/'.concat(var_partcodeid.value))" noload="true" dmx-on:success="view_partcode.setValue(api_getpartcodebyid.data.name)"></dmx-api-action>
<dmx-api-action id="api_getparttypebyid" noload="true" url="http://vapor.prelub.com/api/v1.0/parttypes/1" dmx-bind:url="pg_apiurl.value.concat('parttypes/'.concat(var_parttypeid.value))"></dmx-api-action>
<dmx-api-action id="api_getexistingpartinfo" noload="true" dmx-bind:url="pg_apiurl.value.concat('partnumbers/id/'.concat(var_existingpartid.value))" dmx-on:success="var_partid.setValue(api_getnewpartinfo.data.id);view_partnumber.setValue(api_getnewpartinfo.data.number)"></dmx-api-action>
<dmx-api-action id="api_increasepn" noload="true" method="post" dmx-data:number="(api_maxpn.data.number + 1)" dmx-bind:url="pg_apiurl.value.concat('pns')" dmx-on:success="api_getnewpartinfo.load({})"></dmx-api-action>
<dmx-api-action id="api_makes" url="http://vapor.prelub.com/api/v1.0/makes" dmx-bind:url="pg_apiurl.value.concat('makes')"></dmx-api-action>
<dmx-api-action id="api_maxpn" url="http://vapor.prelub.com/api/v1.0/pns/max" dmx-on:success="run([{run:{action:`var_partnumber.setValue(var_parttypeid.value.toNumber().toString().concat(\'-\'.concat(var_partcodeid.value.concat(\'-\'.concat(api_maxpn.data.number)))))`,outputType:'text'}},{run:{action:`api_postpart.load({})`,outputType:'text'}}])" noload="true" dmx-bind:url="pg_apiurl.value.concat('pns/max')"></dmx-api-action>
<dmx-api-action id="api_models" url="http://vapor.prelub.com/api/v1.0/models" dmx-bind:url="pg_apiurl.value.concat('models')"></dmx-api-action>


<dmx-api-action id="api_postdspec" noload="true" method="post" dmx-data:revisionlevel="view_rev.value" dmx-data:partnumberid="var_partid.value.toNumber()" dmx-data:statusidpn="var_statusid.value.toNumber().toString()" dmx-data:partcodeid="var_partcodeid.value.toNumber().toString()" dmx-data:parttypeid="var_partid.value.toNumber().toString()" dmx-data:statusiddspec="var_statusiddspec.value.toNumber().toString()" dmx-data:effectivedate="inp_effectivedate.value" dmx-data:reasonforchange="inp_reasonforchange.value" dmx-data:validation="inp_validation.value" dmx-data:notes="inp_notes.value" dmx-bind:url="pg_apiurl.value.concat('designspecs/alt')" dmx-on:success="var_dspecid.setValue(api_postdspec.data.id)" url="http://vapor.prelub.com/api/v1.0/designspecs/alt"></dmx-api-action>
<dmx-api-action id="api_products" url="http://vapor.prelub.com/api/v1.0/products" dmx-bind:url="pg_apiurl.value.concat('products')"></dmx-api-action>
<dmx-api-action id="api_copydspec" noload="true" method="post" dmx-data:revisionlevel="view_rev.value" dmx-data:partnumberid="var_partid.value.toNumber()" dmx-data:statusidpn="var_statusid.value.toNumber().toString()" dmx-data:partcodeid="var_partcodeid.value.toNumber().toString()" dmx-data:parttypeid="var_partid.value.toNumber().toString()" dmx-data:statusiddspec="var_statusiddspec.value.toNumber().toString()" dmx-data:effectivedate="inp_effectivedate.value" dmx-data:reasonforchange="inp_reasonforchange.value" dmx-data:validation="inp_validation.value" dmx-data:notes="inp_notes.value" dmx-bind:url="pg_apiurl.value.concat('designspecs/alt')" dmx-on:success="run({meta:{$param:[{type:'number',name:'count'},{type:'number',name:'index'}]},exec:{steps:[{run:{action:`var_dspecid.setValue(api_copydspec.data.id)`,outputType:'text'}},{run:{action:`mod_cpybom.inp_cpynewdspecid.setValue(api_copydspec.data.id)`,outputType:'text'}},{run:{action:`mod_cpybom.show()`,outputType:'text'}}]}})" url="http://vapor.prelub.com/api/v1.0/designspecs/alt"></dmx-api-action>
















<dmx-api-action id="api_postpart" noload="true" method="post" data-type="json" dmx-data:number="var_partnumber.value" dmx-data:statusid="var_statusid.value" dmx-data:description="var_description.value" dmx-data:comments="var_comment.value" dmx-data:partcodeid="var_partcodeid.value.toNumber().toString()" dmx-data:parttypeid="var_parttypeid.value.toNumber().toString()" dmx-bind:url="pg_apiurl.value.concat('partnumbers/alt')" url="http://vapor.prelub.com/api/v1.0/partnumbers/alt" dmx-on:success="run([{run:{action:`var_partid.setValue(api_postpart.data.id)`,outputType:'text'}},{run:{action:`mdl_newpart.hide()`,outputType:'text'}},{run:{action:`api_increasepn.load({})`,outputType:'text'}}])"></dmx-api-action>
<div class="modal" id="mod_cpybom" is="dmx-bs5-modal" tabindex="-1">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Copy Bom?</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <input id="inp_cpyolddspecid" name="cpyolddspecid" type="text" class="form-control" dmx-bind:value="api_loaddspec.data.id">
                <input id="inp_cpynewdspecid" name="cpynewdspecid1" type="text" class="form-control" dmx-bind:value="api_copydspec.data.id">
                <p>Modal body text goes here.</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" data-bs-dismiss="modal" dmx-on:click="api_bomcopyitem.load({})">Yes</button>
                <button type="button" class="btn btn-primary">No</button>
            </div>
        </div>
    </div>
</div>
<div class="modal rounded rounded-3 border-dark" id="mdl_app" is="dmx-bs5-modal" tabindex="-1">
    <div class="modal-dialog modal-dialog-centered modal-dialog-scrollable modal-xl" role="document">
        <div class="modal-content">
            <dmx-value id="var_newmodelid"></dmx-value>
            <dmx-api-action id="api_postapplication" noload="true" dmx-bind:url="pg_apiurl.value.concat('applications/create')" url="http://vapor.prelub.com/api/applications/create" method="post" dmx-data:id="txt_appid.value.toNumber()" dmx-data:engineid="inp_appengine.value.toNumber()" dmx-data:modelid="inp_appmodel.value.toNumber()" dmx-data:oe="inp_chkoe.checked" dmx-data:partnumberid="var_partid.value.toNumber()" dmx-data:description="inp_appdesc.value" dmx-data:arrangement="inp_arrangement.value" dmx-data:serialprefix="inp_serialprefix.value" dmx-data:motor="inp_motor.value" dmx-data:electric="inp_electric.value" dmx-data:plumbing="inp_plumbing.value" dmx-data:voltage="inp_voltage.value" dmx-data:type="inp_type.value" dmx-data:enginecapacity="inp_engcapacity.value" dmx-data:transcapacity="inp_transcapacity.value" dmx-data:hydcapacity="inp_hydcapacity.value" dmx-data:startingserial="inp_serialstart.value" dmx-data:endingserial="inp_serialend.value" data-type="json" dmx-on:success="txt_appid.setValue();mdl_app.hide();var_appid.setValue(0);api_getapps.load({})"></dmx-api-action>
            <div class="modal-header">
                <h5 class="modal-title">Application</h5>&nbsp;&nbsp;
                &nbsp;&nbsp;
                <a href="#" class="btn btn-sm btn-secondary" id="anc_newmodel" dmx-on:click="mod_newmodel.show()">New Model</a>&nbsp;&nbsp;
                <a href="#" class="btn btn-sm btn-secondary" id="anc_newengine" dmx-on:click="mod_newengine.show();mod_newengine.inp_newengineproduct.setValue(6);mod_newengine.inp_newengineproduct.disable(true)">New Engine</a><button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <div class="modal bg-secondary rounded-pill border-dark rounded-1" id="mod_newmodel" is="dmx-bs5-modal" tabindex="-1">
                    <div class="modal-dialog modal-dialog-centered" role="document">
                        <div class="modal-content">
                            <dmx-api-action id="api_postmodel" noload="true" url="http://vapor.prelub.com/api/v1.0/models/insert" method="post" data-type="json" dmx-data:name="inp_newmodelname.value" dmx-data:makeid="inp_newmodelmake.value.toNumber()" dmx-data:productid="inp_newmodelproduct.value.toNumber()" dmx-data:description="null" dmx-data:createuserid="-1" dmx-data:updateuserid="-1" dmx-on:success="api_models.load({});var_newmodelid.setValue(api_postmodel.data.id);inp_appmodel.setValue(api_postmodel.data.id);mod_newmodel.hide();mod_confirmnewmodel.hide()" dmx-bind:url="pg_apiurl.value.concat('models')" dmx-data:displacement="null"></dmx-api-action>
                            <div class="modal-header">
                                <h5 class="modal-title" id="mod_customer1">New Model</h5>
                                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                            </div>
                            <div class="modal-body">
                                <div class="modal" id="mod_confirmnewmodel" is="dmx-bs5-modal" tabindex="-1">
                                    <div class="modal-dialog modal-sm modal-dialog-centered" role="document">
                                        <div class="modal-content">

                                            <div class="modal-body">
                                                <p class="lh-sm small text-center">Model already exists. Do you still wish to add it?</p>
                                            </div>
                                            <div class="modal-footer">
                                                <button id="btn_yes" class="btn btn-success btn-sm" dmx-on:click="api_postmodel.load({})">YES</button>
                                                <button id="btn_cancel" class="btn btn-danger btn-sm" dmx-on:click="mod_confirmnewmodel.hide()">NO</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="container">
                                    <div class="row">
                                        <div class="col" style="display: flex; width: 100%;">
                                            <label>Name:</label>
                                            <input id="inp_newmodelname" name="newmodelname" type="text" class="form-control">
                                            &nbsp;&nbsp;

                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col" style="display: flex; width: 100%;">
                                            <label>Product:</label>
                                            <input id="inp_newmodelproduct" name="inpnewmodelproduct" type="text" class="form-control" is="dmx-autocomplete" dmx-bind:data="api_products.data" optiontext="name" optionvalue="id" optionsearch="name">&nbsp;&nbsp;

                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col" style="display: flex; width: 100%;">
                                            <label>Make:</label>
                                            <input id="inp_newmodelmake" name="inpnewmodelmake" type="text" class="form-control" is="dmx-autocomplete" dmx-bind:data="api_makes.data" optiontext="name" optionvalue="id" optionsearch="name">&nbsp;&nbsp;

                                        </div>
                                    </div>

                                </div>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                                <button type="button" class="btn btn-primary" dmx-on:click="run({condition:{if:`api_models.data.where(\`name\`, inp_newmodelname.value, \'==\')`,then:{steps:{run:{action:`mod_confirmnewmodel.show()`,outputType:'text'}}},else:{steps:{run:{action:`api_postmodel.load({})`,outputType:'text'}}},outputType:'boolean'}})">Save changes</button>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal bg-secondary" id="mod_newengine" is="dmx-bs5-modal" tabindex="-1">
                    <div class="modal-dialog modal-dialog-centered" role="document">
                        <div class="modal-content">
                            <dmx-api-action id="api_postenginemodel" noload="true" url="http://vapor.prelub.com/api/v1.0/models/insert" method="post" data-type="json" dmx-data:name="inp_newenginename.value" dmx-data:makeid="inp_newenginemake.value.toNumber()" dmx-data:productid="inp_newengineproduct.value.toNumber()" dmx-data:description="null" dmx-data:createuserid="-1" dmx-data:updateuserid="-1" dmx-on:success="api_models.load({});inp_appengine.setValue(api_postenginemodel.data.id);mod_confirmnewengine.hide();mod_newengine.hide()" dmx-bind:url="pg_apiurl.value.concat('models')" dmx-data:displacement="inp_newenginedisplacement.value"></dmx-api-action>
                            <div class="modal-header">
                                <h5 class="modal-title" id="mod_customer2">New Engine</h5>
                                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                            </div>
                            <div class="modal-body">
                                <div class="modal" id="mod_confirmnewengine" is="dmx-bs5-modal" tabindex="-1">
                                    <div class="modal-dialog modal-sm modal-dialog-centered" role="document">
                                        <div class="modal-content">

                                            <div class="modal-body">
                                                <p class="lh-sm small text-center">Model already exists. Do you still wish to add it?</p>
                                            </div>
                                            <div class="modal-footer">
                                                <button id="btn_yesengine" class="btn btn-success btn-sm" dmx-on:click="api_postenginemodel.load({})">YES</button>
                                                <button id="btn_cancelengine" class="btn btn-danger btn-sm" dmx-on:click="mod_confirmnewengine.hide()">NO</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="container">
                                    <div class="row">
                                        <div class="col" style="display: flex; width: 100%;">
                                            <label>Displacement:</label>
                                            <input id="inp_newenginename" name="newenginename" type="text" class="form-control">
                                            &nbsp;&nbsp;

                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col" style="display: flex; width: 100%;">
                                            <label>Name:</label>
                                            <input id="inp_newenginedisplacement" name="newenginedisplacement" type="text" class="form-control">
                                            &nbsp;&nbsp;

                                        </div>
                                    </div>
                                    <div class="row visually-hidden">
                                        <div class="col" style="display: flex; width: 100%;">
                                            <label>Product:</label>
                                            <input id="inp_newengineproduct" name="inpnewengineproduct" type="text" class="form-control" is="dmx-autocomplete" dmx-bind:data="api_products.data" optiontext="name" optionvalue="id" optionsearch="name">&nbsp;&nbsp;

                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col" style="display: flex; width: 100%;">
                                            <label>Make:</label>
                                            <input id="inp_newenginemake" name="inpnewenginemake" type="text" class="form-control" is="dmx-autocomplete" dmx-bind:data="api_makes.data" optiontext="name" optionvalue="id" optionsearch="name">&nbsp;&nbsp;

                                        </div>
                                    </div>

                                </div>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                                <button type="button" class="btn btn-primary" dmx-on:click="run({condition:{if:`api_models.data.where(\`name\`, inp_newenginename.value, \'==\')`,then:{steps:{run:{action:`mod_confirmnewengine.show()`,outputType:'text'}}},else:{steps:{run:{action:`api_postenginemodel.load({})`,outputType:'text'}}},outputType:'boolean'}})">Save changes</button>
                            </div>
                        </div>
                    </div>
                </div>
                <input id="txt_appid" name="appid" type="text" class="form-control visually-hidden">
                <div class="row align-items-center justify-content-start g-0" style="padding-top: 1px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px;">
                    <div class="align-self-center col-4" style="display: flex; width: 100%;">

                        <label style="padding: 10px;">Model:</label>
                        <input id="inp_appmodel" name="inpappmodel" type="text" class="form-control" is="dmx-autocomplete" dmx-bind:data="api_models.data.where(`product.id`, 6, '!=')" optiontext="name" optionvalue="id" optionsearch="name" style="padding: 10px;">
                        <label style="padding: 10px;">Engine:</label>
                        <input id="inp_appengine" name="inpappengine" type="text" class="form-control" is="dmx-autocomplete" dmx-bind:data="api_models.data.where(`product.id`, 6, '==')" optiontext="name" optionvalue="id" optionsearch="name" style="padding: 10px;">

                    </div>
                </div>
                <div class="row align-items-center justify-content-start g-0" style="padding-top: 1px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px;">
                    <div class="align-self-center col-4" style="display: flex; width: 100%;">
                        <label style="padding: 10px;">Description:</label>
                        <textarea id="inp_appdesc" class="form-control" name="appdesc" style="padding: 10px;"></textarea>
                        <label style="padding: 10px;">Arrangement:</label>
                        <input id="inp_arrangement" name="inparrangement" type="text" class="form-control form-control-sm" style="padding: 10px;">

                    </div>
                </div>
                <div class="row align-items-center justify-content-start g-0" style="padding-top: 1px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px;">
                    <div class="align-self-center col-4" style="display: flex; width: 100%;">
                        <label>Serial Prefix:</label>
                        <input id="inp_serialprefix" name="inpserialprefix" type="text" class="form-control form-control-sm" style="width: 100px; padding: 10px;">
                        <label class="form-check-label" for="inpchkoe" style="padding: 10px;">OE:</label>
                        <div class="form-check" style="padding: 10px;">
                            <input class="form-check-input" type="checkbox" value="" id="inp_chkoe" name="inpchkoe">
                        </div>
                        <label style="padding: 10px;">Motor:</label>
                        <input id="inp_motor" name="inpmotor" type="text" class="form-control form-control-sm" style="width: 100px; padding: 10px;">
                    </div>
                </div>
                <div class="row align-items-center justify-content-start g-0" style="padding-top: 1px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px;">
                    <div class="align-self-center col-4" style="display: flex; width: 100%;">
                        <label style="padding: 10px;">Electric:</label>
                        <input id="inp_electric" name="inpelectric" type="text" class="form-control form-control-sm" style="width: 100px; padding: 10px;">
                        <label style="padding: 10px;">Plumbing:</label>
                        <input id="inp_plumbing" name="inpplumbing" type="text" class="form-control form-control-sm" style="width: 100px; padding: 10px;">
                        <label style="padding: 10px;">Voltage:</label>
                        <input id="inp_voltage" name="inpvoltage" type="text" class="form-control form-control-sm" style="width: 100px; padding: 10px;">
                    </div>
                </div>
                <div class="row align-items-center justify-content-start g-0" style="padding-top: 1px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px;">
                    <div class="align-self-center col-4" style="display: flex; width: 100%;">
                        <label style="padding: 10px;">Starting Serial:</label>
                        <input id="inp_serialstart" name="inpserialstart" type="text" class="form-control form-control-sm" style="width: 200px; padding: 10px;">
                        <label style="padding: 10px;">Ending Serial:</label>
                        <input id="inp_serialend" name="inpserialend" type="text" class="form-control form-control-sm" style="width: 200px; padding: 10px;">
                        <label style="padding: 10px;">type:</label>
                        <input id="inp_type" name="inptype" type="text" class="form-control form-control-sm" style="width: 200px; padding: 10px;">
                    </div>
                </div>
                <div class="row align-items-center justify-content-start g-0" style="padding-top: 1px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px;">
                    <div class="align-self-center col-4" style="display: flex; width: 100%;">
                        <label style="padding: 10px;">Engine Capacity:</label>
                        <input id="inp_engcapacity" name="inpengcapacity" type="text" class="form-control form-control-sm" style="width: 200px; padding: 10px;">
                        <label style="padding: 10px;">Trans Capacity:</label>
                        <input id="inp_transcapacity" name="inptranscapacity" type="text" class="form-control form-control-sm" style="width: 200px; padding: 10px;">
                        <label style="padding: 10px;">Hyd Capacity:</label>
                        <input id="inp_hydcapacity" name="inphydcapacity" type="text" class="form-control form-control-sm" style="width: 200px; padding: 10px;">
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal" dmx-on:click="var_appid.setValue(0);var_newmodelid.setValue(0);txt_appid.setValue();inp_appmodel.setValue(0);inp_appengine.setValue(0);inp_appdesc.setValue();inp_arrangement.setValue();inp_serialprefix.setValue();inp_chkoe.select(false);inp_motor.setValue();inp_electric.setValue();inp_plumbing.setValue();inp_voltage.setValue();inp_serialstart.setValue();inp_serialend.setValue();inp_type.setValue();inp_engcapacity.setValue();inp_transcapacity.setValue();inp_hydcapacity.setValue()">Close</button>
                <button type="button" class="btn btn-primary" dmx-on:click="api_postapplication.load({});txt_appid.setValue();inp_appmodel.setValue(0);inp_appengine.setValue(0);inp_appdesc.setValue();inp_arrangement.setValue();inp_serialprefix.setValue();inp_chkoe.select(false);inp_motor.setValue();inp_electric.setValue();inp_plumbing.setValue();inp_voltage.setValue();inp_serialstart.setValue();inp_serialend.setValue();inp_type.setValue();inp_engcapacity.setValue();inp_transcapacity.setValue();inp_hydcapacity.setValue();mdl_app.hide()">Save changes</button>
            </div>
        </div>
    </div>
</div>
<div class="modal" id="modal_copybom" is="dmx-bs5-modal" tabindex="-1" dmx-on:hide-bs-modal="inp_cpyfromotherbom.setValue(null)">
    <div class="modal-dialog modal-lg modal-dialog-scrollable modal-dialog-centered" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Copy Bom</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <div class="container">
                    <div class="row">
                        <div class="col align-self-center">
                            <div class="form-group mb-3 row">
                                <label for="inp_cpyfromotherbom" class="col-sm-2 col-form-label" style="width: fit-content;">Part #</label>
                                <input type="text" class="form-control" id="inp_cpyfromotherbom" name="input1" aria-describedby="input1_help" style="width: fit-content;" dmx-on:blur="conn_partssearch.load({pn: value},true)">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col">
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover table-sm">
                                    <thead>
                                        <tr>
                                            <th>Id</th>
                                            <th>Partnumberid</th>
                                            <th>Partnumber</th>
                                            <th>Description</th>
                                            <th>Tab</th>
                                            <th>Old</th>
                                            <th>New</th>
                                        </tr>
                                    </thead>
                                    <tbody is="dmx-repeat" dmx-generator="bs5table" dmx-bind:repeat="conn_partssearch.data.api1.data" id="tableRepeat6">
                                        <tr>
                                            <td dmx-text="id"></td>
                                            <td dmx-text="partnumberid"></td>
                                            <td dmx-text="partnumber"></td>
                                            <td dmx-text="description"></td>
                                            <td dmx-text="tab"></td>
                                            <td dmx-text="old"></td>
                                            <td dmx-text="new"></td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                <button type="button" class="btn btn-primary">Copy</button>
            </div>
        </div>
    </div>
</div>










<div class="container">
    <div class="row">
        <div class="col placeholder-glow border-3 rounded rounded-3 border-dark">
            <div class="card border-1 border-dark rounded rounded-3">
                <div class="card-body">

                    <div class="btn-group" role="group" aria-label="Button Group">
                        <button id="btn_revup" class="btn btn-danger" dmx-on:click="run([{run:{action:`mod_cpybom.inp_cpyolddspecid.setValue(api_loaddspec.data.id)`,outputType:'text'}},{run:{action:`var_prevdspecid.setValue(var_dspecid.value)`,outputType:'text'}},{run:{action:`api_copydspec.load({})`,outputType:'text'}}])">New Rev</button>
                    </div>
                    <h4 class="card-title" id="crd_partinfo">
                        <div style="float: left; padding-right: 10px;">Part Info: </div>

                        <input type="text" class="form-control" id="view_partnumber" name="viewpartnumber" aria-describedby="input1_help" readonly="true" style="width: 30%; float: left; padding-right: 10px;">

                        <div style="float: left; padding-right: 10px; padding-left: 10px;">Rev:</div>

                        <input type="text" class="form-control" id="view_rev" name="viewrev" aria-describedby="input1_help" readonly="true" style="width: 10%; float: left;" value="0" dmx-bind:value="var_rev.value">
                    </h4>
                    <div class="row" style="padding-top: 10px;">
                        <div class="col" style="width: 33%;">
                            <div class="form-group mb-3 row">
                                <label for="view_partcode" class="col-sm-2 col-form-label" style="width: 30%;">Part Code:</label>
                                <div class="col-sm-10" style="width: 50%">
                                    <input type="text" class="form-control" id="view_partcode" name="viewpartcode" aria-describedby="input1_help" readonly="true" dmx-bind:value="api_getpartinfo.data.partcode.name">
                                </div>
                            </div>

                        </div>
                        <div class="col" style="width:33%;">
                            <div class="form-group mb-3 row">
                                <div class="col-sm-10">
                                    <div class="form-check">
                                        <input class="form-check-input" type="checkbox" value="" id="view_obsolete" name="viewobsolete" readonly="true" disabled="true" dmx-bind:checked="(api_getpartinfo.data.status.id == 2)">
                                        <label class="form-check-label" for="view_obsolete">Obsolete</label>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col">
                            <div class="form-group mb-3 row">
                                <label for="view_replacedby" style="width: 40%; " class="col-sm-2 col-form-label">Replaced By:</label>
                                <div class="col-sm-10" style="width: 40%; float: left;">
                                    <input type="text" class="form-control" id="view_replacedby" name="viewreplacedby" aria-describedby="input1_help" readonly="true" dmx-bind:value="api_getpartinfo.data.replacedby.number">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col">
                            <p>Description</p>
                            <textarea id="view_description" class="form-control" name="viewpartdescription" dmx-bind:value="var_description.value" readonly="true"></textarea>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col">
                            <p>Comments</p>
                            <textarea id="view_comments" class="form-control" name="viewpartcomments" dmx-bind:value="var_comment.value" readonly="true"></textarea>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col" style="padding-top: 10px;">
            <div class="card border-1 rounded rounded-3 border-dark">
                <div class="card-body">
                    <h4 class="card-title">DSpec</h4>
                    <div class="row">
                        <div class="col" style="width= 30%; float: left;">
                            <div class="form-group mb-3 row">
                                <div style="float: left;">
                                    <label for="inp_effectivedate" class="col-sm-2 col-form-label" style="width: 35%; float: left;">Effective Date</label>
                                    <div class="col-sm-10">
                                        <input id="inp_effectivedate" name="effectivedate" type="date" class="form-control">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col">
                            <div class="form-group mb-3 row">
                                <div style="float: left;">
                                    <label for="inp_application" class="col-sm-2 col-form-label" style="width: 40%; float: left;">Work Instruction</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" id="inp_workinstruction" name="workinstruction" aria-describedby="input1_help" style="width: 40%; float left;">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col">
                            <div class="form-group mb-3 row">
                                <div style="float: left;">
                                    <label for="inp_application" class="col-sm-2 col-form-label" style="width: 30%; float: left;">Application</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" id="inp_application" name="application" aria-describedby="input1_help" style="width: 60%; float left;">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col">
                            <label for="inp_reasonforchange" class="col-sm-2 col-form-label">Reason for Change</label>
                            <textarea id="inp_reasonforchange" class="form-control" name="reasonforchange"></textarea>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col">
                            <label for="inp_validation" class="col-sm-2 col-form-label">Validation</label>
                            <textarea id="inp_validation" class="form-control" name="validation"></textarea>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col">
                            <label for="inp_notes" class="col-sm-2 col-form-label">Notes</label>
                            <textarea id="inp_notes" class="form-control" name="notes"></textarea>
                        </div>
                    </div>
                    <div class="row" style="padding-top: 10px;">
                        <div class="col">
                            <button id="btn_savedspec" class="btn btn-success" style="float: right; padding-top: 5px;" dmx-on:click="api_postdspec.load({})">Save</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col rounded rounded-3 border-dark border-5">
            <dmx-api-action id="api_getapps" url="http://vapor.prelub.com/api/v1.0/applications/pn/10644" dmx-bind:url="pg_apiurl.value.concat('applications/pn/'.concat(var_partid.value))" noload="true"></dmx-api-action>
            <dmx-value id="var_deleteapp" dmx-bind:value="0" dmx-on:updated="run({condition:{if:`(value.toNumber() &gt; 0)`,then:{steps:[{run:{action:`api_deleteapp.load({})`,outputType:'text'}},{wait:{delay:1000}},{run:{action:`api_getapps.load({})`,outputType:'text'}}]},outputType:'boolean'}})"></dmx-value>
            <dmx-value id="var_appid" dmx-on:updated="run({condition:{if:`(value.toNumber() != 0)`,then:{steps:[{run:{action:`mdl_app.txt_appid.setValue(api_getapps.data.where(\`id\`, value, \'==\')[0].id);mdl_app.inp_appmodel.setValue(api_getapps.data.where(\`id\`, value.toNumber(), \'==\')[0].model.id);mdl_app.inp_appdesc.setValue(api_getapps.data.where(\`id\`, value.toNumber(), \'==\')[0].description);mdl_app.inp_appengine.setValue(api_getapps.data.where(\`id\`, value, \'==\')[0].engine.id);mdl_app.inp_arrangement.setValue(api_getapps.data.where(\`id\`, value, \'==\')[0].arrangement);mdl_app.inp_serialprefix.setValue(api_getapps.data.where(\`id\`, value, \'==\')[0].serialprefix);mdl_app.inp_chkoe.select(api_getapps.data.where(\`id\`, value, \'==\')[0].oe);mdl_app.inp_motor.setValue(api_getapps.data.where(\`id\`, value, \'==\')[0].motor);mdl_app.inp_electric.setValue(api_getapps.data.where(\`id\`, value, \'==\')[0].electric);mdl_app.inp_plumbing.setValue(api_getapps.data.where(\`id\`, value, \'==\')[0].plumbing);mdl_app.inp_voltage.setValue(api_getapps.data.where(\`id\`, value, \'==\')[0].voltage);mdl_app.inp_serialstart.setValue(api_getapps.data.where(\`id\`, value, \'==\')[0].startingserial);mdl_app.inp_serialend.setValue(api_getapps.data.where(\`id\`, value, \'==\')[0].endingserial);mdl_app.inp_type.setValue(api_getapps.data.where(\`id\`, value, \'==\')[0].type);mdl_app.inp_engcapacity.setValue(api_getapps.data.where(\`id\`, value, \'==\')[0].enginecapacity);mdl_app.inp_transcapacity.setValue(api_getapps.data.where(\`id\`, value, \'==\')[0].transcapacity);mdl_app.inp_hydcapacity.setValue(api_getapps.data.where(\`id\`, value, \'==\')[0].hydcapacity)`,outputType:'text'}},{run:{action:`mdl_app.show()`,outputType:'text'}}]},outputType:'boolean'}})" dmx-bind:value="0"></dmx-value>
            <dmx-value id="var_partidtodelete" dmx-on:updated="api_deletethisitem.load({})"></dmx-value>
            <dmx-value id="var_partsearch" dmx-on:updated="api_bompartselectbynumber.load({})"></dmx-value>
            <dmx-api-action id="api_loadbombydspec" noload="true" url="http://vapor.prelub.com/api/v1.0/boms/bydspec/33726" dmx-bind:url="pg_apiurl.value.concat('boms/bydspec/'.concat(var_dspecid.value))"></dmx-api-action>
            <dmx-api-action id="api_deletethisitem" noload="true" method="delete" dmx-bind:url="pg_apiurl.value.concat('boms/'.concat(var_partidtodelete.value))"></dmx-api-action>
            <dmx-api-action id="api_deleteapp" noload="true" url="http://vapor.prelub.com/api/v1.0/applications" method="delete" dmx-bind:url="pg_apiurl.value.concat('applications/'.concat(var_deleteapp.value))" dmx-on:success="api_getapps.load({})"></dmx-api-action>
            <button id="btn_copybom" class="btn" dmx-on:click="modal_copybom.show();modal_copybom.show()">Copy BOM</button>

            <ul class="nav nav-tabs" id="navTabs1_tabs" role="tablist">
                <li class="nav-item">
                    <a class="nav-link active" id="navTabs1_1_tab" data-bs-toggle="tab" href="#" data-bs-target="#navTabs1_1" role="tab" aria-controls="navTabs1_1" aria-selected="true" dmx-on:click="var_viewlocationid.setValue(14)">Motor</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" id="navTabs1_2_tab" data-bs-toggle="tab" href="#" data-bs-target="#navTabs1_2" role="tab" aria-controls="navTabs1_2" aria-selected="false" dmx-on:click="var_viewlocationid.setValue(19)">Electrical</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" id="navTabs1_3_tab" data-bs-toggle="tab" href="#" data-bs-target="#navTabs1_3" role="tab" aria-controls="navTabs1_3" aria-selected="false" dmx-on:click="var_viewlocationid.setValue(17)">Plumbing</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" id="navTabs1_4_tab" data-bs-toggle="tab" href="#" data-bs-target="#navTabs1_4" role="tab" aria-controls="navTabs1_4" aria-selected="false" dmx-on:click="var_viewlocationid.setValue(11)">Instructions</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" id="navTabs1_5_tab" data-bs-toggle="tab" href="#" data-bs-target="#navTabs1_5" role="tab" aria-controls="navTabs1_5" aria-selected="false" dmx-on:click="var_viewlocationid.setValue(21)">Applications</a>
                </li>
            </ul>
            <div class="tab-content" id="navTabs1_content" dmx-on:blur="frm_motor.reset()">
                <div class="tab-pane fade show active" id="navTabs1_1" role="tabpanel">
                    <div class="table-responsive">
                        <table class="table">
                            <thead>
                                <tr>
                                    <th>Partnumber</th>

                                    <th>Description</th>
                                    <th>Old</th>
                                    <th>New</th>
                                    <th scope="row">Action</th>
                                </tr>
                                <tr>
                                    <td>
                                        <input id="inp_pnmotor" name="inppnmotor" type="text" class="form-control" dmx-on:blur="var_partsearch.setValue(value)">
                                    </td>
                                    <td>
                                        <input id="inp_descmotor" name="inpdescmotor" type="text" class="form-control" readonly="true" dmx-bind:value="api_bompartselectbynumber.data.description" disabled="true">
                                    </td>
                                    <td>
                                        <input id="inp_oldmotor" name="inpoldmotor" type="text" class="form-control" dmx-on:blur="var_bominsertold.setValue(value)">
                                    </td>
                                    <td>
                                        <input id="inp_newmotor" name="inpnewmotor" type="text" class="form-control" dmx-on:blur="var_bominsertnew.setValue(value)">
                                    </td>
                                    <td>
                                        <button id="btn_newmotor" class="btn btn-danger" dmx-bind:value="api_bompartselectbynumber.data.id" dmx-on:click="run({run:{action:`var_bominsertpnid.setValue(value)`,outputType:'text'}})">Add</button>
                                    </td>
                                </tr>
                            </thead>
                            <tbody is="dmx-repeat" dmx-generator="bs5table" dmx-bind:repeat="api_loadbombydspec.data.where(`tab`, 14, '==')" id="tableRepeat1">
                                <tr>
                                    <td dmx-text="partnumber"></td>

                                    <td dmx-text="description"></td>
                                    <td dmx-text="old"></td>
                                    <td dmx-text="new"></td>
                                    <td>
                                        <button id="btn_deletemotor" class="btn btn-danger" dmx-bind:value="id" dmx-on:click="run([{run:{action:`var_partidtodelete.setValue(value)`,outputType:'text'}},{wait:{delay:1000}},{run:{action:`api_loadbombydspec.load({})`,outputType:'text'}}])">X</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="tab-pane fade" id="navTabs1_2" role="tabpanel">
                    <div class="table-responsive">
                        <table class="table">
                            <thead>
                                <tr>
                                    <th>Partnumber</th>

                                    <th>Description</th>
                                    <th>Old</th>
                                    <th>New</th>
                                    <th scope="row">Action</th>
                                </tr>
                                <tr>
                                    <td>
                                        <input id="inp_pnelec" name="inppnelec" type="text" class="form-control" dmx-on:blur="var_partsearch.setValue(value)">
                                    </td>
                                    <td>
                                        <input id="inp_descelec" name="inpdescelec" type="text" class="form-control" readonly="true" dmx-bind:value="api_bompartselectbynumber.data.description" disabled="true">
                                    </td>
                                    <td>
                                        <input id="inp_oldelec" name="inpoldelec" type="text" class="form-control" dmx-on:blur="var_bominsertold.setValue(value)">
                                    </td>
                                    <td>
                                        <input id="inp_newelec" name="inpnewelec" type="text" class="form-control" dmx-on:blur="var_bominsertnew.setValue(value)">
                                    </td>
                                    <td>
                                        <button id="btn_newelec" class="btn btn-danger" dmx-bind:value="api_bompartselectbynumber.data.id" dmx-on:click="run({run:{action:`var_bominsertpnid.setValue(value)`,outputType:'text'}})">Add</button>
                                    </td>
                                </tr>
                            </thead>
                            <tbody is="dmx-repeat" dmx-generator="bs5table" dmx-bind:repeat="api_loadbombydspec.data.where(`tab`, 19, '==')" id="tableRepeat2">
                                <tr>
                                    <td dmx-text="partnumber"></td>

                                    <td dmx-text="description"></td>
                                    <td dmx-text="old"></td>
                                    <td dmx-text="new"></td>
                                    <td>
                                        <button id="btn_deleteelec" class="btn btn-danger" dmx-bind:value="id" dmx-on:click="run([{run:{action:`var_partidtodelete.setValue(value)`,outputType:'text'}},{wait:{delay:1000}},{run:{action:`api_loadbombydspec.load({})`,outputType:'text'}}])">X</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="tab-pane fade" id="navTabs1_3" role="tabpanel">
                    <div class="table-responsive">
                        <table class="table">
                            <thead>
                                <tr>
                                    <th>Partnumber</th>

                                    <th>Description</th>
                                    <th>Old</th>
                                    <th>New</th>
                                    <th scope="row">Action</th>
                                </tr>
                                <tr>
                                    <td>
                                        <input id="inp_pnplumb" name="inppnplumb" type="text" class="form-control" dmx-on:blur="var_partsearch.setValue(value)">
                                    </td>
                                    <td>
                                        <input id="inp_descplumb" name="inpdescplumb" type="text" class="form-control" readonly="true" dmx-bind:value="api_bompartselectbynumber.data.description" disabled="true">
                                    </td>
                                    <td>
                                        <input id="inp_oldplumb" name="inpoldplumb" type="text" class="form-control" dmx-on:blur="var_bominsertold.setValue(value)">
                                    </td>
                                    <td>
                                        <input id="inp_newplumb" name="inpnewplumb" type="text" class="form-control" dmx-on:blur="var_bominsertnew.setValue(value)">
                                    </td>
                                    <td>
                                        <button id="btn_newplumb" class="btn btn-danger" dmx-bind:value="api_bompartselectbynumber.data.id" dmx-on:click="run({run:{action:`var_bominsertpnid.setValue(value)`,outputType:'text'}})">Add</button>
                                    </td>
                                </tr>
                            </thead>
                            <tbody is="dmx-repeat" dmx-generator="bs5table" dmx-bind:repeat="api_loadbombydspec.data.where(`tab`, 17, '==')" id="tableRepeat3">
                                <tr>
                                    <td dmx-text="partnumber"></td>

                                    <td dmx-text="description"></td>
                                    <td dmx-text="old"></td>
                                    <td dmx-text="new"></td>
                                    <td>
                                        <button id="btn_deleteplumb" class="btn btn-danger" dmx-bind:value="id" dmx-on:click="run([{run:{action:`var_partidtodelete.setValue(value)`,outputType:'text'}},{wait:{delay:1000}},{run:{action:`api_loadbombydspec.load({})`,outputType:'text'}}])">X</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="tab-pane fade" id="navTabs1_4" role="tabpanel">
                    <div class="table-responsive">
                        <table class="table">
                            <thead>
                                <tr>
                                    <th>Partnumber</th>

                                    <th>Description</th>
                                    <th>Old</th>
                                    <th>New</th>
                                    <th scope="row">Action</th>
                                </tr>
                                <tr>
                                    <td>
                                        <input id="inp_pnins" name="inppnins" type="text" class="form-control" dmx-on:blur="var_partsearch.setValue(value)">
                                    </td>
                                    <td>
                                        <input id="inp_descins" name="inpdescins" type="text" class="form-control" readonly="true" dmx-bind:value="api_bompartselectbynumber.data.description" disabled="true">
                                    </td>
                                    <td>
                                        <input id="inp_oldins" name="inpoldins" type="text" class="form-control" dmx-on:blur="var_bominsertold.setValue(value)">
                                    </td>
                                    <td>
                                        <input id="inp_newins" name="inpnewins" type="text" class="form-control" dmx-on:blur="var_bominsertnew.setValue(value)">
                                    </td>
                                    <td>
                                        <button id="btn_newins" class="btn btn-danger" dmx-bind:value="api_bompartselectbynumber.data.id" dmx-on:click="run({run:{action:`var_bominsertpnid.setValue(value)`,outputType:'text'}})">Add</button>
                                    </td>
                                </tr>
                            </thead>
                            <tbody is="dmx-repeat" dmx-generator="bs5table" dmx-bind:repeat="api_loadbombydspec.data.where(`tab`, 11, '==')" id="tableRepeat4">
                                <tr>
                                    <td dmx-text="partnumber"></td>

                                    <td dmx-text="description"></td>
                                    <td dmx-text="old"></td>
                                    <td dmx-text="new"></td>
                                    <td>
                                        <button id="btn_deleteins" class="btn btn-danger" dmx-bind:value="id" dmx-on:click="run([{run:{action:`var_partidtodelete.setValue(value)`,outputType:'text'}},{wait:{delay:1000}},{run:{action:`api_loadbombydspec.load({})`,outputType:'text'}}])">X</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="tab-pane fade" id="navTabs1_5" role="tabpanel">
                    <button id="btn_newapp" class="btn btn-secondary" dmx-on:click="mdl_app.show()">Add</button>
                    <div class="table-responsive">
                        <table class="table">
                            <thead>
                                <tr>
                                    <th scope="row">Action</th>
                                    <th>Serialprefix</th>
                                    <th>Startingserial</th>
                                    <th>Endingserial</th>
                                    <th>Type</th>


                                    <th>Model</th>
                                    <th>Product</th>
                                    <th>Description</th>
                                </tr>
                            </thead>
                            <tbody is="dmx-repeat" dmx-generator="bs5table" dmx-bind:repeat="api_getapps.data" id="tableRepeat5">
                                <tr>
                                    <td style="display: inline-block;">
                                        <button id="btn_viewapp" class="btn btn-primary btn-sm" dmx-bind:value="id" dmx-on:click="var_appid.setValue(value)">View</button>
                                        <button id="btn_deleteapp" class="btn btn-danger btn-sm" dmx-bind:value="id" dmx-on:click="var_deleteapp.setValue(value)">X</button>
                                    </td>
                                    <td dmx-text="serialprefix"></td>
                                    <td dmx-text="startingserial"></td>
                                    <td dmx-text="endingserial"></td>
                                    <td dmx-text="type"></td>


                                    <td dmx-text="model.name"></td>
                                    <td dmx-text="model.product.name"></td>
                                    <td dmx-text="description"></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>



        </div>
    </div>




</div>